Function at 0x401250
Capabilities:
Query service status
Start service

Disassembly:
push ebp
mov ebp, esp
sub esp, 0xc54
xor eax, eax
mov dword [ebp - 0xc54], eax
mov dword [ebp - 0xc50], eax
mov dword [ebp - 0xc4c], eax
mov dword [ebp - 0xc48], eax
mov eax, 4
call fcn.00411630
and esp, 0xfffffff0
mov eax, esp
mov dword [ebp - 0xc50], eax
mov eax, 4
call fcn.00411630
and esp, 0xfffffff0
mov eax, esp
mov dword [ebp - 0xc4c], eax
mov eax, 4
call fcn.00411630
and esp, 0xfffffff0
mov eax, esp
mov dword [ebp - 0xc48], eax
mov eax, dword [ebp - 0xc50]
test eax, eax
je 0x4012d0
mov eax, dword [ebp - 0xc4c]
test eax, eax
je 0x4012d0
mov eax, dword [ebp - 0xc48]
test eax, eax
jne 0x4012e5
push edi
mov dword [esp], str.failed_to_allocate_resource_for_command
call fcn.004011c8
pop ecx
mov eax, 3
leave
ret
add esp, 0xfffffff4
mov eax, dword [ebp - 0xc4c]
mov dword [esp], eax
mov dword [esp + 4], 0
mov dword [esp + 8], 4
call sub.MSVCR71.dll_memset
add esp, 0xc
add esp, 0xfffffff4
mov eax, dword [ebp - 0xc48]
mov dword [esp], eax
mov dword [esp + 4], 0
mov dword [esp + 8], 4
call sub.MSVCR71.dll_memset
add esp, 0xc
xor eax, eax
mov dword [ebp - 0xc50], eax
mov edx, dword [sym.imp.ADVAPI32.dll_OpenSCManagerA]
add esp, 0xfffffff4
mov dword [esp], eax
mov dword [esp + 4], str.ServicesActive
mov dword [esp + 8], 0xf003f
call edx
mov dword [ebp - 0x1c], eax
mov eax, dword [ebp - 0x1c]
mov dword [ebp - 0xc4c], eax
mov eax, dword [ebp - 0xc4c]
test eax, eax
jne 0x40137e
push edi
mov dword [esp], str.OpenSCManager_failed
call fcn.004011c8
pop ecx
mov eax, 3
leave
ret
mov dword [ebp - 0xc44], 0
mov eax, dword [ebp - 0xc44]
cmp eax, 3
jb 0x4013ad
jmp 0x40162a
inc dword [ebp - 0xc44]
mov eax, dword [ebp - 0xc44]
cmp eax, 3
jae 0x40162a
mov eax, dword [ebp - 0xc48]
test eax, eax
je 0x4013d2
mov eax, dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
push edi
mov edx, dword [ebp - 0xc48]
mov dword [esp], edx
call eax
mov dword [ebp - 0xc48], 0
mov eax, dword [sym.imp.ADVAPI32.dll_OpenServiceA]
add esp, 0xfffffff4
mov edx, dword [ebp - 0xc4c]
mov dword [esp], edx
mov edx, dword [ebp - 0xc44]
mov edx, dword [edx*4 + 0x45d040]
mov dword [esp + 4], edx
mov dword [esp + 8], 0xf01ff
call eax
mov dword [ebp - 0x18], eax
mov eax, dword [ebp - 0x18]
mov dword [ebp - 0xc48], eax
mov eax, dword [ebp - 0xc48]
test eax, eax
jne 0x401446
add esp, 0xfffffff8
mov dword [esp], str.Failed_to_locate_service__s
mov eax, dword [ebp - 0xc44]
mov eax, dword [eax*4 + 0x45d040]
mov dword [esp + 4], eax
call fcn.004011c8
add esp, 8
mov dword [ebp - 0xc50], 3
jmp 0x401398
mov eax, dword [sym.imp.ADVAPI32.dll_StartServiceA]
add esp, 0xfffffff4
mov edx, dword [ebp - 0xc48]
mov dword [esp], edx
xor edx, edx
mov dword [esp + 4], edx
mov dword [esp + 8], edx
call eax
mov dword [ebp - 0x14], eax
mov eax, dword [ebp - 0x14]
test eax, eax
jne 0x4014c8
add esp, 0xfffffff8
mov dword [esp], str._Failed_to_startup_service__s
mov eax, dword [ebp - 0xc44]
mov eax, dword [eax*4 + 0x45d040]
mov dword [esp + 4], eax
call fcn.004011c8
add esp, 8
mov dword [ebp - 0xc50], 3
mov eax, dword [ebp - 0xc48]
test eax, eax
je 0x401398
mov eax, dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
push edi
mov edx, dword [ebp - 0xc48]
mov dword [esp], edx
call eax
mov dword [ebp - 0xc48], 0
jmp 0x401398
mov eax, dword [sym.imp.KERNEL32.dll_GetTickCount]
call eax
mov dword [ebp - 0x10], eax
mov eax, dword [0x45d04c]
add eax, dword [ebp - 0x10]
mov dword [ebp - 0xc40], eax
mov eax, dword [ebp - 0xc50]
test eax, eax
je 0x4014f1
mov eax, 3
leave
ret
mov eax, 1
test eax, eax
je 0x4015c1
add esp, 0xfffffff4
lea eax, [ebp - 0xc3c]
mov dword [esp], eax
mov dword [esp + 4], 0
mov dword [esp + 8], 0x1c
call sub.MSVCR71.dll_memset
add esp, 0xc
mov eax, dword [sym.imp.ADVAPI32.dll_QueryServiceStatus]
add esp, 0xfffffff8
mov edx, dword [ebp - 0xc48]
mov dword [esp], edx
lea edx, [ebp - 0xc3c]
mov dword [esp + 4], edx
call eax
mov dword [ebp - 0xc], eax
mov eax, dword [ebp - 0xc]
test eax, eax
jne 0x401578
add esp, 0xfffffff8
mov dword [esp], str._failed_to_determine_status_for_service__s
mov eax, dword [ebp - 0xc44]
mov eax, dword [eax*4 + 0x45d040]
mov dword [esp + 4], eax
call fcn.004011c8
add esp, 8
mov dword [ebp - 0xc50], 0xa
jmp 0x4015c1
mov eax, dword [ebp - 0xc38]
cmp eax, 4
je 0x4015c1
mov eax, dword [ebp - 0xc38]
cmp eax, 2
jne 0x4015c1
mov eax, dword [sym.imp.KERNEL32.dll_GetTickCount]
call eax
mov dword [ebp - 8], eax
mov eax, dword [ebp - 0xc40]
mov edx, dword [ebp - 8]
cmp edx, eax
jae 0x4015c1
mov eax, dword [sym.imp.orauts.dll_Sleep]
push edi
mov dword [esp], 0x64
call eax
mov eax, 1
test eax, eax
jne 0x4014fe
mov eax, dword [ebp - 0xc38]
cmp eax, 4
je 0x401398
add esp, 0xfffffff8
mov eax, dword [ebp - 0xc38]
mov dword [esp], eax
lea eax, [ebp - 0xc20]
mov dword [esp + 4], eax
call fcn.00401030
add esp, 8
mov dword [ebp - 4], eax
add esp, 0xfffffff4
mov dword [esp], str._service__s_in_improper__s_state
mov eax, dword [ebp - 0xc44]
mov eax, dword [eax*4 + 0x45d040]
mov dword [esp + 4], eax
mov eax, dword [ebp - 4]
mov dword [esp + 8], eax
call fcn.004011c8
add esp, 0xc
mov dword [ebp - 0xc50], 0xa
jmp 0x401398
mov eax, dword [ebp - 0xc4c]
test eax, eax
je 0x40164f
mov eax, dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
push edi
mov edx, dword [ebp - 0xc4c]
mov dword [esp], edx
call eax
mov dword [ebp - 0xc4c], 0
mov eax, dword [ebp - 0xc48]
test eax, eax
je 0x401674
mov eax, dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
push edi
mov edx, dword [ebp - 0xc48]
mov dword [esp], edx
call eax
mov dword [ebp - 0xc48], 0
mov eax, dword [ebp - 0xc54]
test eax, eax
je 0x401686
mov eax, dword [ebp - 0xc54]
leave
ret
mov eax, dword [ebp - 0xc50]
test eax, eax
je 0x401698
mov eax, dword [ebp - 0xc50]
leave
ret
xor eax, eax
leave
ret