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

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x418458
mov eax, dword fs:[0]
push eax
sub esp, 0x10
mov eax, dword [0x42100c]
xor eax, ebp
mov dword [ebp - 0x10], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
call fcn.00405000
mov ecx, eax
test ecx, ecx
je 0x402d51
mov eax, dword [ecx]
call dword [eax + 0xc]
lea esi, [eax + 0x10]
mov dword [ebp - 0x14], esi
push 0x104
push 0x4224e0
push 0
mov dword [ebp - 4], 0
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
test eax, eax
jne 0x402b2b
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.GetModuleFileName_failed_w_err_0x_08lx_n
jmp 0x402c7f
mov eax, dword [ecx]
push 1
push dword [edi - 0xc]
call dword [eax]
mov ebx, eax
test ebx, ebx
je 0x402d5b
jmp 0x402cbd
push 0x4224e0
lea eax, [ebp - 0x14]
push str.__s_
push eax
call fcn.00404cf0
add esp, 0xc
push 0xf003f
push 0
push 0
call dword [sym.imp.ADVAPI32.dll_OpenSCManagerA]
mov dword [0x4224dc], eax
test eax, eax
jne 0x402bed
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.OpenSCManager_failed_w_err_0x_08lx_n
push 0x42260c
call fcn.00404cf0
mov esi, dword [0x42260c]
add esp, 8
mov ebx, esp
mov dword [ebp - 0x1c], ebx
mov ecx, dword [esi - 0x10]
mov eax, dword [ecx]
call dword [eax + 0x10]
cmp dword [esi - 4], 0
mov ecx, eax
lea eax, [esi - 4]
jl 0x402bb1
cmp ecx, dword [esi - 0x10]
jne 0x402bb1
lea edi, [esi - 0x10]
lock inc dword [eax]
lea eax, [edi + 0x10]
mov dword [ebx], eax
call fcn.00401710
mov esi, dword [ebp - 0x14]
jmp 0x402ce1
mov eax, dword [ecx]
push 1
push dword [esi - 0xc]
call dword [eax]
mov edi, eax
test edi, edi
je 0x402d60
mov eax, dword [esi - 0xc]
lea ecx, [edi + 0x10]
mov dword [edi + 4], eax
mov edx, dword [esi - 0xc]
inc edx
push edx
push esi
call fcn.00404b50
add esp, 8
lea eax, [edi + 0x10]
mov dword [ebx], eax
call fcn.00401710
mov esi, dword [ebp - 0x14]
jmp 0x402ce1
mov esi, dword [ebp - 0x14]
push 0
push 0
push 0
push 0
push 0
push esi
push 1
push 2
push 0x10
push 0xf01ff
push 0x41ebd4
push 0x41eb6c
push eax
call dword [sym.imp.ADVAPI32.dll_CreateServiceA]
mov dword [0x4224d8], eax
test eax, eax
jne 0x402c2e
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.CreateService_failed_w_err_0x_08lx_n
jmp 0x402c7f
push 0xf01ff
push 0x41eb6c
push dword [0x4224dc]
call dword [sym.imp.ADVAPI32.dll_OpenServiceA]
mov dword [0x4224d8], eax
test eax, eax
jne 0x402c5b
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.OpenService_failed_w_err_0x_08lx_n
jmp 0x402c7f
lea ecx, [ebp - 0x18]
mov dword [ebp - 0x18], 0x41ebd4
push ecx
push 1
push eax
call dword [sym.imp.ADVAPI32.dll_ChangeServiceConfig2A]
test eax, eax
jns 0x402ce4
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.ChangeServiceConfig2_failed_w_err_0x_08lx_n
push 0x42260c
call fcn.00404cf0
mov edi, dword [0x42260c]
add esp, 8
mov dword [ebp - 0x1c], esp
mov ecx, dword [edi - 0x10]
mov eax, dword [ecx]
call dword [eax + 0x10]
cmp dword [edi - 4], 0
mov ecx, eax
lea eax, [edi - 4]
jl 0x402b13
cmp ecx, dword [edi - 0x10]
jne 0x402b13
lea ebx, [edi - 0x10]
lock inc dword [eax]
jmp 0x402cd4
mov eax, dword [edi - 0xc]
lea ecx, [ebx + 0x10]
mov dword [ebx + 4], eax
mov edx, dword [edi - 0xc]
inc edx
push edx
push edi
call fcn.00404b50
add esp, 8
mov ecx, dword [ebp - 0x1c]
lea eax, [ebx + 0x10]
mov dword [ecx], eax
call fcn.00401710
add esp, 4
mov eax, dword [0x4224dc]
mov edi, dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
test eax, eax
je 0x402d00
push eax
call edi
mov dword [0x4224dc], 0
mov eax, dword [0x4224d8]
test eax, eax
je 0x402d16
push eax
call edi
mov dword [0x4224d8], 0
mov dword [ebp - 4], 0xffffffff
add esi, 0xfffffff0
or eax, 0xffffffff
lock xadd dword [esi + 0xc], eax
dec eax
test eax, eax
jg 0x402d35
mov ecx, dword [esi]
push esi
mov eax, dword [ecx]
call dword [eax + 4]
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.004052ed
mov esp, ebp
pop ebp
ret
push 0x80004005
call fcn.00405130
call fcn.004048e0
call fcn.004048e0
int3