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

Disassembly:
sub esp, 0x2c
push edi
push 0xf003f
push 0
push 0
call dword [sym.imp.ADVAPI32.dll_OpenSCManagerW]
mov edi, eax
mov dword [esp + 4], edi
test edi, edi
jne 0x407442
pop edi
add esp, 0x2c
ret
push esi
push 0xf01ff
push 0x518488
push edi
call dword [sym.imp.ADVAPI32.dll_OpenServiceW]
mov esi, eax
test esi, esi
jne 0x407469
push edi
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
pop esi
xor eax, eax
pop edi
add esp, 0x2c
ret
lea eax, [esp + 0xc]
push eax
push 0x24
lea ecx, [esp + 0x18]
push ecx
push 0
push esi
call dword [sym.imp.ADVAPI32.dll_QueryServiceStatusEx]
test eax, eax
jne 0x407496
push esi
mov esi, dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
call esi
push edi
call esi
pop esi
xor eax, eax
pop edi
add esp, 0x2c
ret
mov eax, dword [esp + 0x14]
cmp eax, 1
je 0x4074bb
cmp eax, 3
je 0x4074bb
push esi
mov esi, dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
call esi
push edi
call esi
pop esi
mov eax, 1
pop edi
add esp, 0x2c
ret
push ebx
mov ebx, dword [sym.imp.KERNEL32.dll_GetTickCount]
push ebp
call ebx
cmp dword [esp + 0x1c], 3
mov ebp, dword [esp + 0x2c]
mov edi, eax
jne 0x40753b
mov eax, 0xcccccccd
mul dword [esp + 0x30]
shr edx, 3
cmp edx, 0x3e8
jae 0x4074ed
mov edx, 0x3e8
jmp 0x4074fa
cmp edx, 0x2710
jbe 0x4074fa
mov edx, 0x2710
push edx
call dword [sym.imp.KERNEL32.dll_Sleep]
lea edx, [esp + 0x14]
push edx
push 0x24
lea eax, [esp + 0x20]
push eax
push 0
push esi
call dword [sym.imp.ADVAPI32.dll_QueryServiceStatusEx]
test eax, eax
je 0x40757d
cmp dword [esp + 0x2c], ebp
jbe 0x40752a
call ebx
mov ebp, dword [esp + 0x2c]
mov edi, eax
jmp 0x407534
call ebx
sub eax, edi
cmp eax, dword [esp + 0x30]
ja 0x407597
cmp dword [esp + 0x1c], 3
je 0x4074d2
push 0
push 0
push esi
call dword [sym.imp.ADVAPI32.dll_StartServiceW]
test eax, eax
je 0x407563
lea ecx, [esp + 0x14]
push ecx
push 0x24
lea edx, [esp + 0x20]
push edx
push 0
push esi
call dword [sym.imp.ADVAPI32.dll_QueryServiceStatusEx]
test eax, eax
jne 0x4075b1
push esi
mov esi, dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
call esi
mov eax, dword [esp + 0x10]
push eax
call esi
pop ebp
pop ebx
pop esi
xor eax, eax
pop edi
add esp, 0x2c
ret
push esi
mov esi, dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
call esi
mov ecx, dword [esp + 0x10]
push ecx
call esi
pop ebp
pop ebx
pop esi
xor eax, eax
pop edi
add esp, 0x2c
ret
push esi
mov esi, dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
call esi
mov edx, dword [esp + 0x10]
push edx
call esi
pop ebp
pop ebx
pop esi
xor eax, eax
pop edi
add esp, 0x2c
ret
call ebx
cmp dword [esp + 0x1c], 2
mov ebp, dword [esp + 0x2c]
mov edi, eax
jne 0x407629
mov eax, 0xcccccccd
mul dword [esp + 0x30]
shr edx, 3
cmp edx, 0x3e8
jae 0x4075db
mov edx, 0x3e8
jmp 0x4075e8
cmp edx, 0x2710
jbe 0x4075e8
mov edx, 0x2710
push edx
call dword [sym.imp.KERNEL32.dll_Sleep]
lea ecx, [esp + 0x14]
push ecx
push 0x24
lea edx, [esp + 0x20]
push edx
push 0
push esi
call dword [sym.imp.ADVAPI32.dll_QueryServiceStatusEx]
test eax, eax
je 0x407629
cmp dword [esp + 0x2c], ebp
jbe 0x407618
call ebx
mov ebp, dword [esp + 0x2c]
mov edi, eax
jmp 0x407622
call ebx
sub eax, edi
cmp eax, dword [esp + 0x30]
ja 0x407629
cmp dword [esp + 0x1c], 2
je 0x4075c0
push esi
mov esi, dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
call esi
mov eax, dword [esp + 0x10]
push eax
call esi
pop ebp
pop ebx
pop esi
mov eax, 1
pop edi
add esp, 0x2c
ret