Function at 0x404190
Capabilities:
Check for time delay via gettickcount
Query service status
Stop service

Disassembly:
push ebp
mov ebp, esp
lea eax, [ebp - 0x18]
push edi
xor edi, edi
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], 0x40cf08
mov dword [ebp - 0x58], 0x404340
mov dword [ebp - 0x54], esp
call fcn.0040b970
mov dword [ebp - 0x84], edi
mov eax, dword [ebp + 8]
xor ecx, ecx
mov dword [ebp - 0x90], ecx
mov edi, 0x5c
mov dword [ebp - 0x88], esi
mov dword [ebp - 0x8c], ebx
mov dword [ebp - 0x40], 0
mov dword [esp], eax
mov dword [ebp - 0x78], 0xffffffff
call sub.cygwin1.dll_strdup
mov dword [ebp - 0x94], 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 - 0x98], eax
mov eax, dword [ebp - 0x94]
mov dword [esp + 4], edi
mov dword [esp], eax
call sub.cygwin1.dll_strrchr
cmp eax, dword [ebp - 0x98]
jae 0x404243
mov eax, dword [ebp - 0x98]
mov dword [ebp - 0x44], eax
test eax, eax
je 0x404388
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 0x4043e1
mov dword [ebp - 0x78], 1
mov eax, dword [ebp - 0x44]
mov edx, 0x24
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 0x404487
mov dword [ebp - 0x78], 1
lea eax, [ebp - 0x38]
mov dword [esp + 8], eax
mov eax, 1
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x84]
mov dword [esp], eax
call sub.ADVAPI32.DLL_ControlService
sub esp, 0xc
test eax, eax
jne 0x4044f4
call sub.KERNEL32.dll_GetLastError
mov dword [ebp - 0x90], eax
cmp eax, 0x425
jne 0x4044f4
inc dword [ebp - 0x88]
cmp dword [ebp - 0x88], 0x1d
jg 0x4044f4
mov dword [esp], 1
mov dword [ebp - 0x78], 1
call sub.cygwin1.dll_sleep
jmp 0x4042cc
mov dword [ebp - 0x48], 0
mov eax, dword [ebp - 0x94]
mov dword [ebp - 0x44], eax
jmp 0x40426a
mov ecx, str.OpenSCManager
mov dword [ebp - 0x8c], ecx
call sub.KERNEL32.dll_GetLastError
mov dword [ebp - 0x90], eax
mov eax, dword [ebp - 0x84]
test eax, eax
je 0x404419
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 0x404435
mov dword [ebp - 0x78], 1
mov eax, dword [ebp - 0x80]
mov dword [esp], eax
call sub.ADVAPI32.DLL_CloseServiceHandle
sub esp, 4
mov edi, dword [ebp - 0x90]
xor eax, eax
mov dword [ebp - 0xa4], eax
test edi, edi
jne 0x404497
mov eax, dword [ebp - 0x48]
test eax, eax
jne 0x4044c6
mov eax, dword [ebp - 0x44]
test eax, eax
jne 0x4044e7
mov ecx, dword [ebp - 0x40]
test ecx, ecx
setne dl
cmp ecx, 0x80000002
setne al
test al, dl
jne 0x4044d3
lea eax, [ebp - 0x7c]
mov dword [esp], eax
call fcn.0040ba10
mov eax, dword [ebp - 0xa4]
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
mov eax, str.OpenService
mov dword [ebp - 0x8c], eax
jmp 0x4043ec
mov dword [esp], 0x30
mov eax, dword [ebp - 0x90]
mov dword [ebp - 0x78], 1
mov dword [esp + 8], eax
mov eax, dword [ebp - 0x8c]
mov dword [esp + 4], eax
call fcn.00407e00
mov dword [ebp - 0xa4], eax
jmp 0x404447
mov dword [esp], eax
call sub.cygwin1.dll_free
jmp 0x40444e
mov dword [esp], ecx
mov dword [ebp - 0x78], 0xffffffff
call sub.ADVAPI32.DLL_RegCloseKey
sub esp, 4
jmp 0x40446e
mov dword [esp], eax
call sub.cygwin1.dll_free
jmp 0x404459
mov eax, dword [ebp - 0x90]
test eax, eax
setne dl
cmp dword [ebp - 0x90], 0x426
setne al
test al, dl
jne 0x404554
mov edi, dword [ebp - 0x90]
test edi, edi
je 0x404521
xor eax, eax
jmp 0x4043f1
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 0x40456b
mov esi, str.QueryServiceStatus
mov dword [ebp - 0x8c], esi
jmp 0x4043ec
mov dword [ebp - 0x78], 1
mov eax, str.ControlService
mov dword [ebp - 0x8c], eax
jmp 0x4043ec
mov eax, dword [ebp - 0x24]
mov dword [ebp - 0x9c], eax
mov dword [ebp - 0x78], 1
call sub.KERNEL32.dll_GetTickCount
mov dword [ebp - 0xa0], eax
cmp dword [ebp - 0x34], 3
jne 0x40451a
mov eax, 0xcccccccd
mul dword [ebp - 0x20]
shr edx, 3
cmp edx, 0x3e7
ja 0x40463a
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 0x404544
cmp dword [ebp - 0x34], 3
jne 0x40451a
mov eax, dword [ebp - 0x24]
cmp eax, dword [ebp - 0x9c]
ja 0x40456e
mov dword [ebp - 0x78], 1
call sub.KERNEL32.dll_GetTickCount
mov edx, dword [ebp - 0xa0]
sub eax, edx
cmp eax, dword [ebp - 0x20]
jbe 0x404586
mov dword [esp], 0x41d
mov ebx, str.QueryServiceStatus
mov ecx, 0x41d
mov dword [ebp - 0x8c], ebx
mov dword [ebp - 0x90], ecx
call sub.KERNEL32.dll_SetLastError
sub esp, 4
jmp 0x4043f7
cmp edx, 0x2710
jbe 0x4045a8
mov edx, 0x2710
jmp 0x4045a8