Function at 0x405190
Capabilities:
Enumerate services
Query service configuration
Resolve function by parsing pe exports

Disassembly:
push 0xffffffffffffffff
push 0x470940
mov eax, dword fs:[0]
push eax
sub esp, 0x5c
mov eax, dword [0x48ea40]
xor eax, esp
mov dword [esp + 0x58], eax
push ebx
push ebp
push esi
push edi
mov eax, dword [0x48ea40]
xor eax, esp
push eax
lea eax, [esp + 0x70]
mov dword fs:[0], eax
mov eax, dword [esp + 0x84]
mov ecx, dword [esp + 0x80]
mov dword [esp + 0x20], eax
xor ebx, ebx
mov eax, ecx
mov dword [esp + 0x4c], 0xf
mov dword [esp + 0x48], ebx
mov byte [esp + 0x38], bl
lea esi, [eax + 1]
jmp 0x4051f0
mov dl, byte [eax]
add eax, 1
cmp dl, bl
jne 0x4051f0
sub eax, esi
push eax
push ecx
lea ecx, [esp + 0x3c]
call fcn.00404f80
lea ecx, [esp + 0x34]
push ecx
mov dword [esp + 0x7c], ebx
call fcn.00405050
add esp, 4
push 4
push ebx
push ebx
call dword [sym.imp.ADVAPI32.dll_OpenSCManagerA]
mov edi, eax
cmp edi, ebx
mov dword [esp + 0x28], edi
jne 0x405246
cmp dword [esp + 0x4c], 0x10
jb 0x40523f
mov edx, dword [esp + 0x38]
push edx
call fcn.0045c39e
add esp, 4
xor al, al
jmp 0x40541e
mov esi, dword [sym.imp.ADVAPI32.dll_EnumServicesStatusA]
lea eax, [esp + 0x2c]
push eax
lea ecx, [esp + 0x20]
push ecx
lea edx, [esp + 0x20]
push edx
push ebx
push ebx
push 3
push 0x30
push edi
mov dword [esp + 0x38], ebx
mov dword [esp + 0x3c], ebx
mov dword [esp + 0x4c], ebx
mov byte [esp + 0x37], bl
call esi
test eax, eax
jne 0x4053ff
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0xea
jne 0x4053ff
mov eax, dword [esp + 0x18]
push eax
call fcn.0045cd98
mov ebp, eax
add esp, 4
cmp ebp, ebx
mov dword [esp + 0x30], ebp
je 0x4053ff
lea ecx, [esp + 0x2c]
push ecx
mov ecx, dword [esp + 0x1c]
lea edx, [esp + 0x20]
push edx
lea eax, [esp + 0x20]
push eax
push ecx
push ebp
push 3
push 0x30
push edi
call esi
test eax, eax
je 0x4053f6
cmp dword [esp + 0x1c], ebx
mov dword [esp + 0x24], ebx
jbe 0x4053f6
lea ebx, [ebx]
cmp byte [esp + 0x17], bl
jne 0x4053f2
mov edx, dword [ebp]
push closesocket
push edx
push edi
call dword [sym.imp.ADVAPI32.dll_OpenServiceA]
mov esi, eax
cmp esi, ebx
je 0x4053f2
lea eax, [esp + 0x18]
push eax
push ebx
push ebx
push esi
call dword [sym.imp.ADVAPI32.dll_QueryServiceConfigA]
test eax, eax
jne 0x4053d3
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x7a
jne 0x4053d3
mov ecx, dword [esp + 0x18]
push ecx
call fcn.0045cd98
mov edi, eax
add esp, 4
cmp edi, ebx
je 0x4053cf
mov eax, dword [esp + 0x18]
lea edx, [esp + 0x18]
push edx
push eax
push edi
push esi
call dword [sym.imp.ADVAPI32.dll_QueryServiceConfigA]
cmp eax, ebx
je 0x4053c6
mov ecx, dword [edi + 0xc]
push ecx
lea ecx, [esp + 0x54]
call fcn.00405150
lea edx, [esp + 0x50]
push edx
mov byte [esp + 0x7c], 1
call fcn.00405050
mov eax, dword [esp + 0x3c]
add esp, 4
cmp dword [esp + 0x4c], 0x10
jae 0x405384
lea eax, [esp + 0x38]
push ebx
push eax
lea ecx, [esp + 0x58]
call fcn.00404bf0
cmp eax, 0xffffffff
je 0x4053b9
mov eax, dword [ebp]
mov ecx, dword [esp + 0x20]
push pe_nt_image_headers32
push eax
push ecx
mov byte [esp + 0x23], 1
call fcn.0045d150
mov edx, dword [esp + 0x2c]
add esp, 0xc
mov byte [edx + 0xff], bl
lea ecx, [esp + 0x50]
mov byte [esp + 0x78], bl
call fcn.00404e00
push edi
call fcn.0045d145
add esp, 4
mov edi, dword [esp + 0x28]
push esi
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
mov eax, dword [esp + 0x24]
add eax, 1
add ebp, 0x24
cmp eax, dword [esp + 0x1c]
mov dword [esp + 0x24], eax
jb 0x4052e0
mov ebp, dword [esp + 0x30]
push ebp
call fcn.0045d145
add esp, 4
push edi
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
cmp dword [esp + 0x4c], 0x10
jb 0x40541a
mov eax, dword [esp + 0x38]
push eax
call fcn.0045c39e
add esp, 4
mov al, byte [esp + 0x17]
mov ecx, dword [esp + 0x70]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebp
pop ebx
mov ecx, dword [esp + 0x58]
xor ecx, esp
call fcn.0045c20d
add esp, 0x68
ret