Function at 0x405330
Capabilities:
Enumerate services
Query service configuration
Query service status

Disassembly:
push ebp
mov ebp, esp
lea edx, [ebp - 0x18]
push edi
xor edi, edi
push esi
xor esi, esi
push ebx
sub esp, 0x1ec
mov dword [ebp - 0x16c], edx
xor ebx, ebx
movzx eax, byte [ebp + 0xc]
mov dword [ebp - 0x164], esp
mov byte [ebp - 0x19d], al
mov eax, 0x409210
mov dword [ebp - 0x174], eax
mov eax, 0x40cf14
mov dword [ebp - 0x170], eax
mov eax, 0x405765
mov dword [ebp - 0x168], eax
lea eax, [ebp - 0x18c]
mov dword [esp], eax
call fcn.0040b970
mov dword [ebp - 0x1ac], edi
xor eax, eax
mov edx, dword [ebp + 8]
mov dword [ebp - 0x1a4], eax
xor eax, eax
xor ecx, ecx
mov dword [ebp - 0x19c], eax
xor eax, eax
mov dword [ebp - 0x1a8], eax
xor eax, eax
test edx, edx
mov dword [ebp - 0x190], esi
mov dword [ebp - 0x1b0], ebx
mov dword [ebp - 0x150], ecx
je 0x4053db
mov ecx, dword [ebp + 8]
mov eax, 0xffffffff
mov dword [ebp - 0x188], eax
mov dword [esp], ecx
call sub.cygwin1.dll_strdup
mov dword [ebp - 0x158], eax
xor eax, eax
test eax, eax
je 0x4053fe
mov dword [esp], 0
mov eax, 0xffffffff
mov dword [ebp - 0x188], eax
call sub.cygwin1.dll_strdup
mov dword [ebp - 0x154], eax
mov eax, 0x104
mov dword [esp + 8], eax
lea eax, [ebp - 0x128]
mov dword [esp + 4], eax
mov eax, 1
mov dword [esp], 0
mov dword [ebp - 0x188], eax
call sub.KERNEL32.dll_GetModuleFileNameA
sub esp, 0xc
test eax, eax
jne 0x405520
mov edi, str.GetModuleFileName
mov dword [ebp - 0x1b0], edi
call sub.KERNEL32.dll_GetLastError
mov dword [ebp - 0x1b4], eax
mov esi, dword [ebp - 0x1ac]
test esi, esi
je 0x405467
mov ebx, dword [ebp - 0x1ac]
mov dword [esp], ebx
call sub.cygwin1.dll_free
mov ebx, dword [ebp - 0x1a8]
test ebx, ebx
je 0x40547f
mov eax, dword [ebp - 0x1a8]
mov dword [esp], eax
call sub.cygwin1.dll_free
mov eax, dword [ebp - 0x19c]
test eax, eax
jne 0x40582a
mov edx, dword [ebp - 0x1a4]
test edx, edx
je 0x4054b3
mov edx, dword [ebp - 0x1a4]
mov eax, 1
mov dword [ebp - 0x188], eax
mov dword [esp], edx
call sub.ADVAPI32.DLL_CloseServiceHandle
sub esp, 4
xor eax, eax
mov dword [ebp - 0x1cc], eax
mov eax, dword [ebp - 0x1b4]
test eax, eax
jne 0x405845
mov eax, dword [ebp - 0x158]
test eax, eax
jne 0x4058cd
mov eax, dword [ebp - 0x154]
test eax, eax
jne 0x4058c0
mov ecx, dword [ebp - 0x150]
test ecx, ecx
setne dl
cmp ecx, 0x80000002
setne al
test al, dl
jne 0x4058a5
lea eax, [ebp - 0x18c]
mov dword [esp], eax
call fcn.0040ba10
mov eax, dword [ebp - 0x1cc]
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
mov dword [esp], 0x2000
mov esi, 1
mov dword [ebp - 0x188], esi
call sub.cygwin1.dll_malloc
mov dword [ebp - 0x1ac], eax
test eax, eax
je 0x40587b
mov eax, dword [ebp - 0x158]
mov ebx, 5
xor ecx, ecx
mov dword [esp + 8], ebx
mov edx, 1
mov dword [esp + 4], ecx
mov dword [esp], eax
mov dword [ebp - 0x188], edx
call sub.ADVAPI32.DLL_OpenSCManagerA
mov dword [ebp - 0x1a4], eax
sub esp, 0xc
test eax, eax
je 0x405815
lea eax, [ebp - 0x194]
mov ecx, dword [ebp - 0x1a4]
lea ebx, [ebp - 0x190]
mov dword [esp + 0x18], eax
xor eax, eax
lea edx, [ebp - 0x198]
mov dword [esp + 0x10], eax
xor eax, eax
mov dword [esp + 0xc], eax
mov eax, 3
mov dword [esp + 8], eax
mov eax, 0x30
mov dword [esp + 4], eax
mov eax, 1
mov dword [esp + 0x1c], ebx
mov dword [esp + 0x14], edx
mov dword [esp], ecx
mov dword [ebp - 0x188], eax
call sub.ADVAPI32.DLL_EnumServicesStatusA
sub esp, 0x20
test eax, eax
jne 0x4058da
mov eax, dword [ebp - 0x198]
mov edi, 1
mov dword [ebp - 0x188], edi
mov dword [esp], eax
call sub.cygwin1.dll_malloc
mov dword [ebp - 0x1a8], eax
test eax, eax
je 0x40587b
lea eax, [ebp - 0x194]
mov ecx, dword [ebp - 0x1a8]
lea ebx, [ebp - 0x190]
mov dword [esp + 0x18], eax
mov eax, dword [ebp - 0x198]
lea edx, [ebp - 0x198]
mov dword [esp + 0x1c], ebx
mov ebx, dword [ebp - 0x1a4]
mov dword [esp + 0x14], edx
mov edx, 0x30
mov dword [esp + 0x10], eax
mov eax, 1
mov dword [esp + 0xc], ecx
mov ecx, 3
mov dword [esp + 8], ecx
mov dword [esp + 4], edx
mov dword [esp], ebx
mov dword [ebp - 0x188], eax
call sub.ADVAPI32.DLL_EnumServicesStatusA
sub esp, 0x20
test eax, eax
je 0x4058da
xor eax, eax
mov dword [ebp - 0x1b8], eax
xor eax, eax
cmp eax, dword [ebp - 0x194]
jae 0x405758
xor eax, eax
mov dword [ebp - 0x1d4], eax
mov edx, dword [ebp - 0x1d4]
mov eax, 0x80000000
mov edi, 1
mov dword [esp + 8], eax
mov ecx, dword [ebp - 0x1a8]
mov ebx, dword [ebp - 0x1a4]
mov eax, dword [edx + ecx]
mov dword [esp], ebx
mov dword [ebp - 0x188], edi
mov dword [esp + 4], eax
call sub.ADVAPI32.DLL_OpenServiceA
mov dword [ebp - 0x19c], eax
sub esp, 0xc
test eax, eax
jne 0x4058e4
call sub.KERNEL32.dll_GetLastError
mov dword [esp], eax
call fcn.00407da0
mov dword [ebp - 0x1bc], eax
call sub.KERNEL32.dll_GetLastError
mov dword [ebp - 0x1c0], eax
call sub.cygwin1.dll___getreent
mov ecx, dword [ebp - 0x1c0]
mov esi, str._s:_warning:_OpenService_failed_for__s:_Win32_error__lu_n_s
mov edx, dword [ebp - 0x1bc]
mov ebx, dword [ebp - 0x1d4]
mov dword [esp + 0x10], ecx
mov ecx, dword [ebp - 0x1a8]
mov dword [esp + 0x14], edx
mov edx, dword [ebx + ecx]
mov dword [esp + 4], esi
mov dword [esp + 0xc], edx
mov edx, dword [0x41205c]
mov dword [esp + 8], edx
mov eax, dword [eax + 0xc]
mov dword [esp], eax
call sub.cygwin1.dll_fprintf
inc dword [ebp - 0x1b8]
add dword [ebp - 0x1d4], 0x24
mov ecx, dword [ebp - 0x1b8]
cmp ecx, dword [ebp - 0x194]
jb 0x40568b
xor edi, edi
mov dword [ebp - 0x1b4], edi
jmp 0x40544f
mov eax, str.OpenSCManager
mov dword [ebp - 0x1b0], eax
call sub.KERNEL32.dll_GetLastError
jmp 0x405449
mov dword [esp], eax
mov ecx, 1
mov dword [ebp - 0x188], ecx
call sub.ADVAPI32.DLL_CloseServiceHandle
sub esp, 4
jmp 0x40548d
mov dword [esp], 0x32
mov ecx, dword [ebp - 0x1b4]
mov eax, 1
mov dword [ebp - 0x188], eax
mov ebx, dword [ebp - 0x1b0]
mov dword [esp + 8], ecx
mov dword [esp + 4], ebx
call fcn.00407e00
mov dword [ebp - 0x1cc], eax
jmp 0x4054c9
mov dword [esp], 0xe
mov esi, str.malloc
mov ebx, 0xe
mov dword [ebp - 0x1b0], esi
mov dword [ebp - 0x1b4], ebx
call sub.KERNEL32.dll_SetLastError
sub esp, 4
jmp 0x40544f
mov dword [esp], ecx
mov eax, 0xffffffff
mov dword [ebp - 0x188], eax
call sub.ADVAPI32.DLL_RegCloseKey
sub esp, 4
jmp 0x405501
mov dword [esp], eax
call sub.cygwin1.dll_free
jmp 0x4054e5
mov dword [esp], eax
call sub.cygwin1.dll_free
jmp 0x4054d7
mov eax, str.EnumServiceStatus
jmp 0x40581a
lea eax, [ebp - 0x198]
mov ebx, 0x2000
mov ecx, 1
mov dword [esp + 0xc], eax
mov eax, dword [ebp - 0x19c]
mov dword [esp + 8], ebx
mov ebx, dword [ebp - 0x1ac]
mov dword [esp], eax
mov dword [ebp - 0x188], ecx
mov dword [esp + 4], ebx
call sub.ADVAPI32.DLL_QueryServiceConfigA
sub esp, 0x10
test eax, eax
jne 0x4059b6
call sub.KERNEL32.dll_GetLastError
mov dword [esp], eax
call fcn.00407da0
mov dword [ebp - 0x1c4], eax
call sub.KERNEL32.dll_GetLastError
mov dword [ebp - 0x1c8], eax
call sub.cygwin1.dll___getreent
mov ecx, dword [ebp - 0x1c8]
mov edx, dword [ebp - 0x1c4]
mov ebx, dword [ebp - 0x1d4]
mov dword [esp + 0x10], ecx
mov ecx, dword [ebp - 0x1a8]
mov dword [esp + 0x14], edx
mov edx, dword [ebx + ecx]
mov dword [esp + 0xc], edx
mov edx, dword [0x41205c]
mov dword [esp + 8], edx
mov edx, str._s:_warning:_QueryServiceConfig_failed_for__s:_Win32_error__lu_n_s
mov dword [esp + 4], edx
mov eax, dword [eax + 0xc]
mov dword [esp], eax
call sub.cygwin1.dll_fprintf
mov eax, dword [ebp - 0x19c]
mov dword [esp], eax
mov eax, 1
mov dword [ebp - 0x188], eax
call sub.ADVAPI32.DLL_CloseServiceHandle
xor eax, eax
sub esp, 4
mov dword [ebp - 0x19c], eax
jmp 0x405739
mov ebx, dword [ebp - 0x1ac]
lea eax, [ebp - 0x128]
mov dword [esp + 4], eax
mov eax, dword [ebx + 0xc]
mov dword [esp], eax
mov eax, 1
mov dword [ebp - 0x188], eax
call fcn.004052c0
test al, al
je 0x40598d
cmp byte [ebp - 0x19d], 0
jne 0x405a02
mov edx, dword [ebp - 0x1d4]
mov ecx, dword [ebp - 0x1a8]
mov eax, dword [edx + ecx]
mov dword [esp], eax
call sub.cygwin1.dll_puts
jmp 0x40598d
mov eax, dword [ebp - 0x19c]
lea ebx, [ebp - 0x148]
mov dword [esp + 4], ebx
mov dword [esp], eax
mov eax, 1
mov dword [ebp - 0x188], eax
call sub.ADVAPI32.DLL_QueryServiceStatus
sub esp, 8
test eax, eax
je 0x405a88
lea eax, [ebp - 0x158]
mov dword [esp], eax
mov eax, 1
mov dword [ebp - 0x188], eax
call fcn.0040ce60
movzx edx, byte [ebp - 0x19d]
mov dword [esp + 0xc], ebx
mov ebx, dword [ebp - 0x1d4]
mov dword [esp + 4], eax
mov dword [esp + 0x14], edx
mov edx, dword [ebp - 0x1ac]
mov dword [esp + 0x10], edx
lea edx, [ebp - 0x19c]
mov dword [esp + 8], edx
mov edx, dword [ebp - 0x1a8]
mov eax, dword [ebx + edx]
mov dword [esp], eax
call fcn.004047f0
jmp 0x40598d
mov eax, str.QueryServiceStatus
jmp 0x40581a