Function at 0x404850
Capabilities:
Create service
Link many functions at runtime

Disassembly:
push 0xffffffffffffffff
push 0x4281dc
mov eax, dword fs:[0]
push eax
sub esp, 0x444
mov eax, dword [0x432ac0]
xor eax, esp
mov dword [esp + 0x440], eax
push ebx
push ebp
push esi
push edi
mov eax, dword [0x432ac0]
xor eax, esp
push eax
lea eax, [esp + 0x458]
mov dword fs:[0], eax
mov esi, dword [esp + 0x46c]
mov ebp, ecx
mov ecx, dword [esp + 0x468]
mov dword [esp + 0x18], esi
call fcn.00402480
mov dword [esi], 0
mov esi, dword [sym.imp.KERNEL32.dll_GetModuleHandleA]
push str.ADVAPI32.DLL
mov dword [esp + 0x24], 0
call esi
mov edi, dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov ebx, eax
push str.RegisterServiceCtrlHandlerExA
push ebx
mov dword [esp + 0x2c], ebx
call edi
push str.EnumServicesStatusExA
push ebx
mov dword [esp + 0x30], eax
call edi
mov dword [esp + 0x2c], eax
push 0xa
push str.ServicesActive
push 0
mov dword [esp + 0x46c], 0
call dword [sym.imp.ADVAPI32.dll_OpenSCManagerA]
test eax, eax
mov dword [esp + 0x1c], eax
je 0x404a02
push eax
call dword [sym.imp.ADVAPI32.dll_LockServiceDatabase]
mov dword [esp + 0x20], eax
mov eax, dword [ebp]
mov edx, dword [eax + 0xa8]
mov ecx, ebp
call edx
push str.ADVAPI32.DLL
mov ebx, eax
call esi
mov esi, eax
push str.QueryServiceConfig2A
push esi
mov dword [esp + 0x44], esi
call edi
push str.ChangeServiceConfig2A
push esi
mov dword [esp + 0x48], eax
call edi
push str.QueryServiceStatusEx
push esi
mov dword [esp + 0x4c], eax
call edi
mov dword [esp + 0x48], eax
mov byte [esp + 0x460], 1
mov ecx, dword [ebp + 0x18]
mov edx, dword [ebp + 0x14]
mov esi, dword [ebp + 0x10]
lea eax, [ebp + 0x18]
mov dword [esp + 0x14], eax
mov eax, dword [ecx - 0xc]
neg eax
sbb eax, eax
and eax, ecx
mov ecx, dword [edx - 0xc]
push eax
mov eax, dword [ebp + 0xd8]
lea edi, [ebp + 0x14]
neg ecx
sbb ecx, ecx
and ecx, edx
mov edx, dword [esi - 0xc]
push ecx
push ebx
push 0
neg edx
sbb edx, edx
and edx, esi
mov esi, dword [ebp + 4]
push edx
push eax
mov eax, dword [ebp + 0xc]
push eax
mov eax, dword [ebp + 8]
push eax
mov eax, dword [ebp + 0x60]
push esi
push 0xf01ff
push eax
mov eax, dword [ebp + 0x58]
push eax
mov eax, dword [esp + 0x4c]
push eax
call dword [sym.imp.ADVAPI32.dll_CreateServiceA]
mov esi, eax
test esi, esi
mov dword [esp + 0x38], esi
jne 0x404a09
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, dword [esp + 0x18]
push ebx
mov dword [ecx], eax
call fcn.004074c6
add esp, 4
call fcn.004047e0
mov edi, dword [esp + 0x14]
call fcn.004047e0
mov eax, dword [esp + 0x20]
test eax, eax
je 0x4049f7
push eax
call dword [sym.imp.ADVAPI32.dll_UnlockServiceDatabase]
mov edx, dword [esp + 0x1c]
push edx
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
xor eax, eax
jmp 0x404bb0
call fcn.004047e0
mov edi, dword [esp + 0x14]
call fcn.004047e0
push ebx
call fcn.004074c6
add esp, 4
cmp dword [ebp + 0x3c], 0
je 0x404b76
mov eax, dword [ebp + 0x1c]
mov eax, dword [eax - 0xc]
test eax, eax
lea ebx, [ebp + 0x1c]
jne 0x404ab5
push 0x104
lea ecx, [esp + 0x150]
push ecx
push eax
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
push 0
push 0
push pe_nt_image_headers32
lea edx, [esp + 0x58]
push edx
push pe_nt_image_headers32
lea eax, [esp + 0x264]
push eax
push 3
lea ecx, [esp + 0x30]
push ecx
lea edx, [esp + 0x16c]
push edx
call fcn.00413235
push 0x42c930
lea eax, [esp + 0x74]
push eax
lea ecx, [esp + 0x27c]
push ecx
lea edx, [esp + 0x44]
push edx
lea eax, [esp + 0x384]
push 0x104
push eax
call fcn.0041501d
add esp, 0x3c
lea ecx, [esp + 0x350]
push ecx
mov ecx, ebx
call fcn.00402570
lea edi, [ebp + 0x70]
lea esi, [esp + 0x34]
mov eax, edi
call fcn.00406250
mov dword [esp + 0x14], eax
lea esi, [esp + 0x30]
mov eax, edi
mov byte [esp + 0x460], 2
call fcn.00406230
mov byte [esp + 0x460], 3
mov edx, dword [esp + 0x14]
mov eax, dword [eax]
mov ecx, dword [ebx]
mov edi, dword [edx]
push eax
call fcn.00406af0
add esp, 4
test eax, eax
mov byte [esp + 0x460], 2
mov eax, dword [esp + 0x30]
sete bl
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x404b22
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov byte [esp + 0x460], 1
mov eax, dword [esp + 0x34]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x404b4a
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
test bl, bl
je 0x404b72
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, dword [esp + 0x38]
mov ecx, dword [esp + 0x18]
push edx
mov dword [ecx], eax
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
lea esi, [esp + 0x1c]
call fcn.00407390
xor eax, eax
jmp 0x404bb0
mov esi, dword [esp + 0x38]
mov eax, dword [ebp + 0x68]
add ebp, 0x68
cmp dword [eax - 0xc], 0
je 0x404b8c
push ebp
lea ecx, [esp + 0x3c]
call fcn.00407280
push esi
mov esi, dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
call esi
mov eax, dword [esp + 0x20]
test eax, eax
je 0x404ba4
push eax
call dword [sym.imp.ADVAPI32.dll_UnlockServiceDatabase]
mov ecx, dword [esp + 0x1c]
push ecx
call esi
mov eax, 1
mov ecx, dword [esp + 0x458]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebp
pop ebx
mov ecx, dword [esp + 0x440]
xor ecx, esp
call fcn.00412a4c
add esp, 0x450
ret 8