Function at 0x403ce0
Capabilities:
Check for time delay via gettickcount
Query service status
Start service

Disassembly:
push ebp
mov ebp, esp
lea eax, [ebp - 0x18]
push edi
mov edi, 0x5c
push esi
xor esi, esi
push ebx
sub esp, 0xac
mov dword [ebp - 0x5c], eax
lea eax, [ebp - 0x7c]
mov dword [ebp - 0x64], 0x409210
xor ebx, ebx
mov dword [esp], eax
mov dword [ebp - 0x60], 0x40cf02
mov dword [ebp - 0x58], 0x403f07
mov dword [ebp - 0x54], esp
call fcn.0040b970
mov dword [ebp - 0x84], esi
mov eax, dword [ebp + 8]
xor ecx, ecx
mov dword [ebp - 0x94], ecx
mov dword [ebp - 0x90], ebx
mov dword [ebp - 0x40], 0
mov dword [esp], eax
mov dword [ebp - 0x78], 0xffffffff
call sub.cygwin1.dll_strdup
mov dword [ebp - 0x98], eax
mov edx, 0x2f
mov dword [esp + 4], edx
mov dword [ebp - 0x48], eax
mov dword [esp], eax
call sub.cygwin1.dll_strrchr
mov dword [ebp - 0x9c], eax
mov eax, dword [ebp - 0x98]
mov dword [esp + 4], edi
mov dword [esp], eax
call sub.cygwin1.dll_strrchr
cmp eax, dword [ebp - 0x9c]
jae 0x403d8b
mov eax, dword [ebp - 0x9c]
mov dword [ebp - 0x44], eax
test eax, eax
je 0x403f50
mov byte [eax], 0
mov eax, dword [ebp - 0x44]
mov dword [ebp - 0x78], 0xffffffff
inc eax
mov dword [ebp - 0x44], eax
mov dword [esp], eax
call sub.cygwin1.dll_strdup
mov dword [ebp - 0x44], eax
mov dword [ebp - 0x78], 1
mov eax, dword [ebp - 0x48]
mov esi, 1
mov dword [esp + 8], esi
xor ebx, ebx
mov dword [esp + 4], ebx
mov dword [esp], eax
call sub.ADVAPI32.DLL_OpenSCManagerA
mov dword [ebp - 0x80], eax
sub esp, 0xc
test eax, eax
je 0x403fb1
mov dword [ebp - 0x78], 1
mov eax, dword [ebp - 0x44]
mov edx, 0x14
mov dword [esp + 8], edx
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x80]
mov dword [esp], eax
call sub.ADVAPI32.DLL_OpenServiceA
mov dword [ebp - 0x84], eax
sub esp, 0xc
test eax, eax
je 0x403ff4
mov dword [ebp - 0x78], 1
xor eax, eax
mov dword [esp + 8], eax
xor eax, eax
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x84]
mov dword [esp], eax
call sub.ADVAPI32.DLL_StartServiceA
sub esp, 0xc
test eax, eax
jne 0x403fc1
call sub.KERNEL32.dll_GetLastError
cmp eax, 0x420
je 0x403fc1
mov edi, str.StartService
mov dword [ebp - 0x90], edi
nop
lea esi, [esi]
call sub.KERNEL32.dll_GetLastError
mov dword [ebp - 0x94], eax
mov eax, dword [ebp - 0x84]
test eax, eax
je 0x403e8d
mov dword [ebp - 0x78], 1
mov eax, dword [ebp - 0x84]
mov dword [esp], eax
call sub.ADVAPI32.DLL_CloseServiceHandle
sub esp, 4
mov eax, dword [ebp - 0x80]
test eax, eax
je 0x403ea9
mov dword [ebp - 0x78], 1
mov eax, dword [ebp - 0x80]
mov dword [esp], eax
call sub.ADVAPI32.DLL_CloseServiceHandle
sub esp, 4
xor eax, eax
mov dword [ebp - 0xa0], eax
mov eax, dword [ebp - 0x94]
test eax, eax
jne 0x404064
mov eax, dword [ebp - 0x48]
test eax, eax
jne 0x404096
mov eax, dword [ebp - 0x44]
test eax, eax
jne 0x4040ba
mov ecx, dword [ebp - 0x40]
test ecx, ecx
setne dl
cmp ecx, 0x80000002
setne al
test al, dl
jne 0x4040a3
lea eax, [ebp - 0x7c]
mov dword [esp], eax
call fcn.0040ba10
mov eax, dword [ebp - 0xa0]
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
mov dword [ebp - 0x48], 0
mov eax, dword [ebp - 0x98]
mov dword [ebp - 0x44], eax
jmp 0x403db2
mov ecx, str.OpenSCManager
mov dword [ebp - 0x90], ecx
jmp 0x403e60
mov dword [ebp - 0x78], 1
lea eax, [ebp - 0x38]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x84]
mov dword [esp], eax
call sub.ADVAPI32.DLL_QueryServiceStatus
sub esp, 8
test eax, eax
jne 0x404004
mov esi, str.QueryServiceStatus
mov dword [ebp - 0x90], esi
jmp 0x403e60
mov eax, str.OpenService
mov dword [ebp - 0x90], eax
jmp 0x403e60
mov eax, dword [ebp - 0x24]
mov dword [ebp - 0x88], eax
mov dword [ebp - 0x78], 1
call sub.KERNEL32.dll_GetTickCount
mov dword [ebp - 0x8c], eax
cmp dword [ebp - 0x34], 2
je 0x4040c7
cmp dword [ebp - 0x34], 4
je 0x403e6b
mov dword [esp], 0x426
mov eax, str.QueryServiceStatus
mov dword [ebp - 0x90], eax
mov eax, 0x426
mov dword [ebp - 0x94], eax
mov dword [ebp - 0x78], 1
call sub.KERNEL32.dll_SetLastError
sub esp, 4
jmp 0x403e6b
mov dword [esp], 0x2f
mov eax, dword [ebp - 0x94]
mov dword [ebp - 0x78], 1
mov dword [esp + 8], eax
mov eax, dword [ebp - 0x90]
mov dword [esp + 4], eax
call fcn.00407e00
mov dword [ebp - 0xa0], eax
jmp 0x403ebf
mov dword [esp], eax
call sub.cygwin1.dll_free
jmp 0x403eca
mov dword [esp], ecx
mov dword [ebp - 0x78], 0xffffffff
call sub.ADVAPI32.DLL_RegCloseKey
sub esp, 4
jmp 0x403eee
mov dword [esp], eax
call sub.cygwin1.dll_free
jmp 0x403ed5
mov eax, 0xcccccccd
mul dword [ebp - 0x20]
shr edx, 3
cmp edx, 0x3e7
ja 0x404170
mov edx, 0x3e8
mov dword [esp], edx
mov dword [ebp - 0x78], 1
call sub.KERNEL32.dll_Sleep
sub esp, 4
lea eax, [ebp - 0x38]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x84]
mov dword [esp], eax
call sub.ADVAPI32.DLL_QueryServiceStatus
sub esp, 8
test eax, eax
je 0x403fe4
cmp dword [ebp - 0x34], 2
jne 0x404029
mov eax, dword [ebp - 0x24]
cmp eax, dword [ebp - 0x88]
ja 0x404007
mov dword [ebp - 0x78], 1
call sub.KERNEL32.dll_GetTickCount
mov edx, dword [ebp - 0x8c]
sub eax, edx
cmp eax, dword [ebp - 0x20]
jbe 0x40401f
mov dword [esp], 0x41d
mov ebx, str.QueryServiceStatus
mov ecx, 0x41d
mov dword [ebp - 0x90], ebx
mov dword [ebp - 0x94], ecx
jmp 0x404057
cmp edx, 0x2710
jbe 0x4040e3
mov edx, 0x2710
jmp 0x4040e3