Function at 0x407f5c
Capabilities:
Create service
Modify service
Persist via windows service

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
push 0xffffffffffffffff
push 0x41d0f9
mov eax, dword fs:[0]
push eax
sub esp, 0x260
mov eax, dword [0x4280b0]
xor eax, esp
mov dword [esp + 0x258], eax
push ebx
push esi
push edi
mov eax, dword [0x4280b0]
xor eax, esp
push eax
lea eax, [esp + 0x270]
mov dword fs:[0], eax
mov eax, dword [0x428020]
mov ebx, 0x428020
sub esi, esi
push ebx
pop ecx
mov dword [esp + 0x14], esi
call dword [eax + 0xc]
add eax, 0x10
mov dword [esp + 0x10], eax
push 0x104
lea eax, [esp + 0x60]
push eax
push esi
mov dword [esp + 0x284], esi
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
mov eax, dword [0x428020]
push ebx
pop ecx
call dword [eax + 0xc]
add eax, 0x10
mov dword [esp + 0x1c], eax
lea eax, [esp + 0x5c]
push eax
push str.__s_
lea eax, [esp + 0x24]
mov byte [esp + 0x280], 1
call fcn.00402420
pop ecx
pop ecx
push 3
push esi
push esi
call dword [sym.imp.ADVAPI32.dll_OpenSCManagerW]
mov dword [esp + 0x24], eax
cmp eax, esi
je 0x4082a4
mov eax, dword [0x428020]
push ebx
pop ecx
call dword [eax + 0xc]
add eax, 0x10
mov dword [esp + 0x18], eax
mov edi, 0x3e9
push edi
mov byte [esp + 0x27c], 2
call fcn.0040295b
pop ecx
cmp eax, esi
je 0x408049
push edi
push eax
lea eax, [esp + 0x20]
push eax
call fcn.00402a88
lea eax, [esp + 0x20]
push eax
push 0xf01ff
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
push eax
call dword [sym.imp.ADVAPI32.dll_OpenProcessToken]
or eax, eax
je 0x408268
lea eax, [esp + 0x34]
push eax
push 0x4243c8
push esi
call dword [sym.imp.ADVAPI32.dll_LookupPrivilegeValueW]
or eax, eax
je 0x408240
mov ecx, dword [esp + 0x34]
push 0x10
pop eax
push 2
mov dword [esp + 0x44], ecx
mov ecx, dword [esp + 0x3c]
pop edi
mov dword [esp + 0x44], ecx
lea ecx, [esp + 0x2c]
push ecx
lea ecx, [esp + 0x50]
push ecx
push eax
mov dword [esp + 0x38], eax
lea eax, [esp + 0x48]
push eax
push esi
push dword [esp + 0x34]
mov dword [esp + 0x54], 1
mov dword [esp + 0x60], edi
call dword [sym.imp.ADVAPI32.dll_AdjustTokenPrivileges]
or eax, eax
je 0x408239
push esi
push esi
push esi
push esi
push esi
push dword [esp + 0x30]
push 1
push edi
push 0x10
push 0x1060016
push dword [esp + 0x40]
push 0x4221c0
push dword [esp + 0x54]
call dword [sym.imp.ADVAPI32.dll_CreateServiceW]
push eax
pop edi
cmp edi, esi
je 0x408108
push dword [esp + 0x18]
push str.UtilInstallService:__s_installed._n
call fcn.0040709d
pop ecx
pop ecx
jmp 0x408165
lea eax, [esp + 0x28]
push eax
mov edi, str.Could_not_create_service_with_ACCESS_SYSTEM_SECURITY___using_alt_method
call fcn.00402d3a
lea ecx, [esp + 0x28]
mov byte [esp + 0x278], 3
call fcn.004071fa
push esi
push esi
push esi
push esi
push esi
push dword [esp + 0x30]
push 1
push 2
push 0x10
push 0x60016
push dword [esp + 0x40]
push 0x4221c0
push dword [esp + 0x54]
call dword [sym.imp.ADVAPI32.dll_CreateServiceW]
push eax
pop edi
mov byte [esp + 0x278], 2
mov eax, dword [esp + 0x28]
add eax, 0xfffffff0
call fcn.00402daa
cmp edi, esi
je 0x4081f8
mov eax, dword [0x428020]
push ebx
pop ecx
call dword [eax + 0xc]
lea ebx, [eax + 0x10]
mov dword [esp + 0x14], ebx
push 0x3ea
mov byte [esp + 0x27c], 4
call fcn.0040295b
pop ecx
cmp eax, esi
je 0x4081a9
push 0x3ea
push eax
lea eax, [esp + 0x1c]
push eax
call fcn.00402a88
mov ebx, dword [esp + 0x14]
lea eax, [esp + 0x30]
push eax
push 1
push edi
mov dword [esp + 0x3c], ebx
call dword [sym.imp.ADVAPI32.dll_ChangeServiceConfig2W]
or eax, eax
jne 0x4081d7
push str.Could_not_set_service_description
lea eax, [esp + 0x14]
push eax
call fcn.00402d02
lea ecx, [esp + 0x10]
call fcn.004071fa
call fcn.00407b66
push edi
call fcn.004076f2
pop ecx
push edi
mov dword [esp + 0x18], eax
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
lea eax, [ebx - 0x10]
call fcn.00402daa
jmp 0x408221
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x431
je 0x408221
push str.Could_not_create_service
lea eax, [esp + 0x14]
push eax
call fcn.00402d02
lea ecx, [esp + 0x10]
call fcn.004071fa
mov dword [esp + 0x14], eax
push esi
push esi
push dword [esp + 0x34]
lea eax, [esp + 0x58]
push eax
push esi
push dword [esp + 0x34]
call dword [sym.imp.ADVAPI32.dll_AdjustTokenPrivileges]
jmp 0x40825c
push str.Could_not_enable_security_privilege
jmp 0x408245
push str.Could_not_lookup_security_privilege
lea eax, [esp + 0x14]
push eax
call fcn.00402d02
lea ecx, [esp + 0x10]
call fcn.004071fa
mov dword [esp + 0x14], eax
push dword [esp + 0x20]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x408284
push str.Could_not_open_process_token
lea eax, [esp + 0x14]
push eax
call fcn.00402d02
lea ecx, [esp + 0x10]
call fcn.004071fa
mov dword [esp + 0x14], eax
push dword [esp + 0x24]
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
mov byte [esp + 0x278], 1
mov eax, dword [esp + 0x18]
add eax, 0xfffffff0
call fcn.00402daa
jmp 0x4082c0
push str.Could_not_open_the_service_manager
lea eax, [esp + 0x14]
push eax
call fcn.00402d02
lea ecx, [esp + 0x10]
call fcn.004071fa
mov dword [esp + 0x14], eax
cmp dword [esp + 0x14], esi
je 0x4082e4
mov eax, dword [esp + 0x10]
push ecx
add eax, 0xfffffff0
mov dword [esp + 0x34], esp
mov esi, esp
call fcn.004028be
add eax, 0x10
mov dword [esi], eax
call fcn.00409f19
pop ecx
mov eax, dword [esp + 0x1c]
add eax, 0xfffffff0
call fcn.00402daa
mov eax, dword [esp + 0x10]
add eax, 0xfffffff0
call fcn.00402daa
mov eax, dword [esp + 0x14]
mov ecx, dword [esp + 0x270]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x258]
xor ecx, esp
call fcn.0040b965
mov esp, ebp
pop ebp
ret