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

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x417a18
mov eax, dword fs:[0]
push eax
sub esp, 0x10
mov eax, dword [0x42000c]
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.00404870
mov ecx, eax
test ecx, ecx
je 0x402741
mov eax, dword [ecx]
call dword [eax + 0xc]
lea esi, [eax + 0x10]
mov dword [ebp - 0x14], esi
push 0x104
push 0x4214a8
push 0
mov dword [ebp - 4], 0
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
test eax, eax
jne 0x40251b
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.GetModuleFileName_failed_w_err_0x_08lx_n
jmp 0x40266f
mov eax, dword [ecx]
push 1
push dword [edi - 0xc]
call dword [eax]
mov ebx, eax
test ebx, ebx
je 0x40274b
jmp 0x4026ad
push 0x4214a8
lea eax, [ebp - 0x14]
push str.__s_
push eax
call fcn.00404560
add esp, 0xc
push 0xf003f
push 0
push 0
call dword [sym.imp.ADVAPI32.dll_OpenSCManagerA]
mov dword [0x4214a4], eax
test eax, eax
jne 0x4025dd
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.OpenSCManager_failed_w_err_0x_08lx_n
push 0x4215d4
call fcn.00404560
mov esi, dword [0x4215d4]
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 0x4025a1
cmp ecx, dword [esi - 0x10]
jne 0x4025a1
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 0x4026d1
mov eax, dword [ecx]
push 1
push dword [esi - 0xc]
call dword [eax]
mov edi, eax
test edi, edi
je 0x402750
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.00404370
add esp, 8
lea eax, [edi + 0x10]
mov dword [ebx], eax
call fcn.00401710
mov esi, dword [ebp - 0x14]
jmp 0x4026d1
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 0x41db10
push 0x41dab0
push eax
call dword [sym.imp.ADVAPI32.dll_CreateServiceA]
mov dword [0x4214a0], eax
test eax, eax
jne 0x40261e
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.CreateService_failed_w_err_0x_08lx_n
jmp 0x40266f
push 0xf01ff
push 0x41dab0
push dword [0x4214a4]
call dword [sym.imp.ADVAPI32.dll_OpenServiceA]
mov dword [0x4214a0], eax
test eax, eax
jne 0x40264b
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.OpenService_failed_w_err_0x_08lx_n
jmp 0x40266f
lea ecx, [ebp - 0x18]
mov dword [ebp - 0x18], 0x41db10
push ecx
push 1
push eax
call dword [sym.imp.ADVAPI32.dll_ChangeServiceConfig2A]
test eax, eax
jns 0x4026d4
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.ChangeServiceConfig2_failed_w_err_0x_08lx_n
push 0x4215d4
call fcn.00404560
mov edi, dword [0x4215d4]
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 0x402503
cmp ecx, dword [edi - 0x10]
jne 0x402503
lea ebx, [edi - 0x10]
lock inc dword [eax]
jmp 0x4026c4
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.00404370
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 [0x4214a4]
mov edi, dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
test eax, eax
je 0x4026f0
push eax
call edi
mov dword [0x4214a4], 0
mov eax, dword [0x4214a0]
test eax, eax
je 0x402706
push eax
call edi
mov dword [0x4214a0], 0
mov dword [ebp - 4], 0xffffffff
add esi, 0xfffffff0
or eax, 0xffffffff
lock xadd dword [esi + 0xc], eax
dec eax
test eax, eax
jg 0x402725
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.00404b3d
mov esp, ebp
pop ebp
ret
push 0x80004005
call fcn.00404980
call fcn.00404160
call fcn.00404160
int3