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

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
push 0xffffffffffffffff
push 0x499de0
mov eax, dword fs:[0]
push eax
sub esp, 0x68
mov eax, dword [0x4ba700]
xor eax, esp
mov dword [esp + 0x60], eax
push ebx
push esi
push edi
mov eax, dword [0x4ba700]
xor eax, esp
push eax
lea eax, [esp + 0x78]
mov dword fs:[0], eax
mov eax, dword [ebp + 8]
mov dword [esp + 0x34], eax
xor esi, esi
mov eax, ecx
mov dword [esp + 0x50], 0xf
mov dword [esp + 0x4c], esi
mov byte [esp + 0x3c], 0
lea edi, [eax + 1]
mov dl, byte [eax]
inc eax
test dl, dl
jne 0x406e16
sub eax, edi
push eax
push ecx
lea ecx, [esp + 0x40]
call fcn.004072d0
lea edi, [esp + 0x38]
mov dword [esp + 0x80], esi
call fcn.00406ce0
push 4
push esi
push esi
call dword [sym.imp.ADVAPI32.dll_OpenSCManagerA]
mov ebx, eax
mov dword [esp + 0x24], ebx
cmp ebx, esi
jne 0x406e74
mov dword [esp + 0x80], 0xffffffff
cmp dword [esp + 0x50], 0x10
jb 0x406e6d
mov ecx, dword [esp + 0x3c]
push ecx
call fcn.0047c43d
add esp, 4
xor al, al
jmp 0x407061
lea edx, [esp + 0x30]
push edx
lea eax, [esp + 0x24]
push eax
lea ecx, [esp + 0x20]
push ecx
push esi
push esi
push 3
push 0x30
mov dword [esp + 0x34], esi
mov dword [esp + 0x3c], esi
mov dword [esp + 0x4c], esi
mov esi, dword [sym.imp.ADVAPI32.dll_EnumServicesStatusA]
push ebx
mov byte [esp + 0x37], 0
call esi
test eax, eax
jne 0x407037
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0xea
jne 0x407037
mov edx, dword [esp + 0x18]
push edx
call fcn.0047cc97
mov edi, eax
add esp, 4
mov dword [esp + 0x28], edi
test edi, edi
je 0x407037
lea eax, [esp + 0x30]
push eax
mov eax, dword [esp + 0x1c]
lea ecx, [esp + 0x24]
push ecx
lea edx, [esp + 0x20]
push edx
push eax
push edi
push 3
push 0x30
push ebx
call esi
test eax, eax
je 0x40702e
cmp dword [esp + 0x20], 0
mov dword [esp + 0x2c], 0
jbe 0x40702e
mov dword [esp + 0x1c], edi
cmp byte [esp + 0x17], 0
jne 0x40702e
mov ecx, dword [esp + 0x1c]
mov edx, dword [ecx]
push bind
push edx
push ebx
call dword [sym.imp.ADVAPI32.dll_OpenServiceA]
mov esi, eax
test esi, esi
je 0x40702e
mov edi, dword [sym.imp.ADVAPI32.dll_QueryServiceConfigA]
lea eax, [esp + 0x18]
push eax
push 0
push 0
push esi
call edi
test eax, eax
jne 0x40700b
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x7a
jne 0x40700b
mov ecx, dword [esp + 0x18]
push ecx
call fcn.0047cc97
mov ebx, eax
add esp, 4
test ebx, ebx
je 0x407007
mov eax, dword [esp + 0x18]
lea edx, [esp + 0x18]
push edx
push eax
push ebx
push esi
call edi
test eax, eax
je 0x406ffe
mov ecx, dword [ebx + 0xc]
push ecx
lea ecx, [esp + 0x58]
call fcn.00407080
lea edi, [esp + 0x54]
mov byte [esp + 0x80], 1
call fcn.00406ce0
cmp dword [esp + 0x50], 0x10
mov edx, dword [esp + 0x3c]
jae 0x406fb9
lea edx, [esp + 0x3c]
lea eax, [esp + 0x54]
push eax
call fcn.004070f0
cmp eax, 0xffffffff
je 0x406fed
mov ecx, dword [esp + 0x1c]
mov edx, dword [ecx]
mov edi, dword [esp + 0x34]
push 0x100
push edx
push edi
mov byte [esp + 0x23], 1
call fcn.0047ce10
add esp, 0xc
mov byte [edi + 0xff], 0
lea ecx, [esp + 0x54]
mov byte [esp + 0x80], 0
call fcn.004070c0
push ebx
call fcn.0047d0a1
add esp, 4
mov ebx, dword [esp + 0x24]
push esi
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
mov eax, dword [esp + 0x2c]
add dword [esp + 0x1c], 0x24
mov edi, dword [esp + 0x28]
inc eax
mov dword [esp + 0x2c], eax
cmp eax, dword [esp + 0x20]
jb 0x406f12
push edi
call fcn.0047d0a1
add esp, 4
push ebx
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
mov dword [esp + 0x80], 0xffffffff
cmp dword [esp + 0x50], 0x10
jb 0x40705d
mov eax, dword [esp + 0x3c]
push eax
call fcn.0047c43d
add esp, 4
mov al, byte [esp + 0x17]
mov ecx, dword [esp + 0x78]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x60]
xor ecx, esp
call fcn.0047c3ff
mov esp, ebp
pop ebp
ret