Function at 0x409080
Capabilities:
Enumerate services
Query service configuration

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x4c6af8
mov eax, dword fs:[0]
push eax
sub esp, 0x60
mov eax, dword [0x4ea5e0]
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
mov eax, dword [ebp + 8]
mov dword [ebp - 0x6c], ecx
xor ebx, ebx
mov ecx, eax
mov dword [ebp - 0x18], 0xf
mov dword [ebp - 0x1c], ebx
mov byte [ebp - 0x2c], bl
lea esi, [ecx + 1]
mov dl, byte [ecx]
inc ecx
test dl, dl
jne 0x4090c5
sub ecx, esi
mov edi, ecx
lea esi, [ebp - 0x2c]
call fcn.00402590
mov dword [ebp - 4], ebx
mov eax, dword [ebp - 0x18]
mov edx, dword [ebp - 0x2c]
mov esi, edx
cmp eax, 0x10
jae 0x40913b
lea esi, [ebp - 0x2c]
mov ecx, esi
add ecx, dword [ebp - 0x1c]
cmp eax, 0x10
mov eax, edx
jae 0x4090fa
lea eax, [ebp - 0x2c]
cmp eax, ecx
je 0x40910f
lea edx, [ebp - 0x5c]
push esi
push edx
mov ebx, ecx
call fcn.004094b0
add esp, 8
xor ebx, ebx
push 4
push ebx
push ebx
call dword [sym.imp.ADVAPI32.dll_OpenSCManagerA]
mov esi, eax
mov dword [ebp - 0x64], esi
cmp esi, ebx
jne 0x40913f
cmp dword [ebp - 0x18], 0x10
jb 0x409134
mov eax, dword [ebp - 0x2c]
push eax
call fcn.004a9046
add esp, 4
xor al, al
jmp 0x4092ea
mov ecx, edx
jmp 0x4090ed
lea ecx, [ebp - 0x68]
push ecx
lea edx, [ebp - 0x54]
push edx
lea eax, [ebp - 0x50]
push eax
push ebx
push ebx
push 3
push 0x30
mov dword [ebp - 0x50], ebx
mov dword [ebp - 0x54], ebx
mov dword [ebp - 0x68], ebx
mov ebx, dword [sym.imp.ADVAPI32.dll_EnumServicesStatusA]
push esi
mov byte [ebp - 0x49], 0
call ebx
test eax, eax
jne 0x4092ce
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0xea
jne 0x4092ce
mov ecx, dword [ebp - 0x50]
push ecx
call fcn.004a8a24
mov edi, eax
add esp, 4
mov dword [ebp - 0x60], edi
test edi, edi
je 0x4092ce
lea edx, [ebp - 0x68]
push edx
mov edx, dword [ebp - 0x50]
lea eax, [ebp - 0x54]
push eax
lea ecx, [ebp - 0x50]
push ecx
push edx
push edi
push 3
push 0x30
push esi
call ebx
test eax, eax
je 0x4092c5
cmp dword [ebp - 0x54], 0
mov dword [ebp - 0x58], 0
jbe 0x4092c5
mov ebx, edi
jmp 0x4091d3
mov edi, dword [ebp - 0x60]
cmp byte [ebp - 0x49], 0
jne 0x4092c5
mov eax, dword [ebx]
push accept
push eax
push esi
call dword [sym.imp.ADVAPI32.dll_OpenServiceA]
mov edi, eax
test edi, edi
je 0x4092c2
lea ecx, [ebp - 0x50]
push ecx
push 0
push 0
push edi
call dword [sym.imp.ADVAPI32.dll_QueryServiceConfigA]
test eax, eax
jne 0x4092a8
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x7a
jne 0x4092a8
mov edx, dword [ebp - 0x50]
push edx
call fcn.004a8a24
mov esi, eax
add esp, 4
mov dword [ebp - 0x5c], esi
test esi, esi
je 0x4092a5
mov ecx, dword [ebp - 0x50]
lea eax, [ebp - 0x50]
push eax
push ecx
push esi
push edi
call dword [sym.imp.ADVAPI32.dll_QueryServiceConfigA]
test eax, eax
je 0x40929c
mov eax, dword [esi + 0xc]
lea ecx, [ebp - 0x48]
call fcn.004093a0
lea eax, [ebp - 0x48]
call fcn.00409030
cmp dword [ebp - 0x18], 0x10
mov edx, dword [ebp - 0x2c]
jae 0x409264
lea edx, [ebp - 0x2c]
lea eax, [ebp - 0x48]
push eax
call fcn.004093e0
cmp eax, 0xffffffff
je 0x409291
mov ecx, dword [ebx]
mov esi, dword [ebp - 0x6c]
push pe_nt_image_headers32
push ecx
push esi
mov byte [ebp - 0x49], 1
call fcn.004a9c60
add esp, 0xc
mov byte [esi + 0xff], 0
lea esi, [ebp - 0x48]
call fcn.00402440
mov esi, dword [ebp - 0x5c]
push esi
call fcn.004a9011
add esp, 4
mov esi, dword [ebp - 0x64]
push edi
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
mov eax, dword [ebp - 0x58]
inc eax
add ebx, 0x24
mov dword [ebp - 0x58], eax
cmp eax, dword [ebp - 0x54]
jb 0x4091d0
mov edi, dword [ebp - 0x60]
push edi
call fcn.004a9011
add esp, 4
push esi
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
cmp dword [ebp - 0x18], 0x10
jb 0x4092e7
mov edx, dword [ebp - 0x2c]
push edx
call fcn.004a9046
add esp, 4
mov al, byte [ebp - 0x49]
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.004a8a2f
mov esp, ebp
pop ebp
ret