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

Disassembly:
sub esp, 0x2c
push ebx
push edi
push 0xf003f
xor ebx, ebx
push ebx
push ebx
call dword [sym.imp.ADVAPI32.dll_OpenSCManagerW]
mov edi, eax
cmp edi, ebx
mov dword [esp + 8], edi
je 0x40836f
push esi
push 0xf01ff
push str.2345Safe
push edi
call dword [sym.imp.ADVAPI32.dll_OpenServiceW]
mov esi, eax
cmp esi, ebx
jne 0x408188
push edi
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
pop esi
pop edi
pop ebx
add esp, 0x2c
ret
xor eax, eax
mov dword [esp + 0x18], eax
mov dword [esp + 0x1c], eax
mov dword [esp + 0x20], eax
mov dword [esp + 0x24], eax
mov dword [esp + 0x28], eax
mov dword [esp + 0x2c], eax
mov dword [esp + 0x30], eax
mov dword [esp + 0x34], eax
lea eax, [esp + 0x10]
push eax
push 0x24
lea ecx, [esp + 0x1c]
push ecx
push ebx
push esi
mov dword [esp + 0x24], ebx
mov dword [esp + 0x28], ebx
call dword [sym.imp.ADVAPI32.dll_QueryServiceStatusEx]
test eax, eax
je 0x4081d8
mov eax, dword [esp + 0x18]
cmp eax, 1
je 0x4081eb
cmp eax, 3
je 0x4081eb
push esi
mov esi, dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
call esi
push edi
call esi
pop esi
pop edi
pop ebx
add esp, 0x2c
ret
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 0x408272
mov eax, 0xcccccccd
mul dword [esp + 0x30]
shr edx, 3
cmp edx, 0x3e8
jae 0x40821c
mov edx, 0x3e8
jmp 0x408229
cmp edx, 0x2710
jbe 0x408229
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 0x4082db
cmp dword [esp + 0x2c], ebp
jbe 0x40825d
call ebx
mov ebp, dword [esp + 0x2c]
mov edi, eax
jmp 0x40826b
call ebx
sub eax, edi
cmp eax, dword [esp + 0x30]
ja 0x4082f3
cmp dword [esp + 0x1c], 3
je 0x408201
push 0
push 0
push esi
call dword [sym.imp.ADVAPI32.dll_StartServiceW]
test eax, eax
je 0x40835d
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 0x40835d
call ebx
cmp dword [esp + 0x1c], 2
mov ebp, dword [esp + 0x2c]
mov edi, eax
jne 0x40835d
jmp 0x4082c0
mov eax, 0xcccccccd
mul dword [esp + 0x30]
shr edx, 3
cmp edx, 0x3e8
jae 0x40830b
mov edx, 0x3e8
jmp 0x408318
push esi
mov esi, dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
call esi
mov ecx, dword [esp + 0x10]
push ecx
call esi
pop ebp
pop esi
pop edi
pop ebx
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 esi
pop edi
pop ebx
add esp, 0x2c
ret
cmp edx, 0x2710
jbe 0x408318
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 0x40835d
cmp dword [esp + 0x2c], ebp
jbe 0x408348
call ebx
mov ebp, dword [esp + 0x2c]
mov edi, eax
jmp 0x408352
call ebx
sub eax, edi
cmp eax, dword [esp + 0x30]
ja 0x40835d
cmp dword [esp + 0x1c], 2
je 0x4082c0
push esi
mov esi, dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
call esi
mov eax, dword [esp + 0x10]
push eax
call esi
pop ebp
pop esi
pop edi
pop ebx
add esp, 0x2c
ret