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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x30
mov eax, dword [ebp + 8]
cmp dword [eax], 0x3000000
mov dword [ebp - 0xc], 0
je 0x40581e
xor eax, eax
mov esp, ebp
pop ebp
ret
cmp dword [eax + 0x58], 0
push esi
lea esi, [eax + 0x58]
mov dword [ebp - 8], esi
jne 0x405a72
mov ecx, dword [esi + 4]
test ecx, ecx
je 0x405a72
cmp ecx, 0xffffffff
je 0x405a72
push ebx
mov ebx, dword [ebp + 0xc]
push edi
mov eax, ebx
mov edi, 1
sub eax, edi
je case.0x40589a.160
sub eax, edi
je case.0x40589a.192
sub eax, edi
jne 0x40587b
mov dword [ebp - 4], 2
mov dword [ebp + 8], 4
jmp 0x4058ab
mov dword [ebp - 4], 6
mov dword [ebp + 8], 7
jmp 0x4058ab
lea eax, [ebx - 0x80]
cmp eax, 0x5f
ja case.0x40589a.129
mov edx, ebx
and edx, 0xe0
lea eax, [edx - 0x80]
cmp eax, 0x50
ja case.0x40589a.129
movzx eax, byte [eax + 0x405a8c]
jmp dword [eax*4 + 0x405a7c]
mov dword [ebp - 4], 3
mov dword [ebp + 8], edi
lea edx, [ebp - 0x30]
push edx
push ecx
call dword [sym.imp.ADVAPI32.dll_QueryServiceStatus]
test eax, eax
jne 0x4058da
push eax
push 0x19e
push str......_src_service.c
push edi
push 3
push eax
call fcn.00403610
add esp, 0x18
pop edi
pop ebx
xor eax, eax
pop esi
mov esp, ebp
pop ebp
ret
mov edi, dword [ebp + 0x14]
test edi, edi
je 0x4058f4
mov eax, dword [ebp + 8]
mov ecx, dword [ebp + 0x10]
mov edx, dword [ebp + 0x18]
push eax
push 1
push ecx
push edx
call edi
add esp, 0x10
cmp ebx, 3
jne 0x40590f
cmp dword [ebp - 0x2c], 7
je 0x405926
mov eax, dword [esi + 4]
push 0
push 0
push eax
call dword [sym.imp.ADVAPI32.dll_StartServiceW]
jmp 0x405935
cmp ebx, 1
jne 0x405926
push esi
call fcn.004055a0
mov esi, eax
add esp, 4
test esi, esi
je 0x405937
mov esi, dword [ebp - 8]
mov edx, dword [esi + 4]
lea ecx, [ebp - 0x30]
push ecx
push ebx
push edx
call dword [sym.imp.ADVAPI32.dll_ControlService]
mov esi, eax
mov ebx, dword [sym.imp.KERNEL32.dll_GetTickCount]
call ebx
mov dword [ebp - 0x14], eax
mov eax, dword [ebp - 0x1c]
mov dword [ebp - 0x10], eax
test esi, esi
je 0x405a0a
push 0x64
call dword [sym.imp.KERNEL32.dll_Sleep]
mov edx, dword [ebp - 8]
mov eax, dword [edx + 4]
lea ecx, [ebp - 0x30]
push ecx
push eax
call dword [sym.imp.ADVAPI32.dll_QueryServiceStatus]
test eax, eax
je 0x405a0a
mov ecx, dword [ebp - 4]
cmp dword [ebp - 0x2c], ecx
jne 0x405a0a
mov eax, 0xcccccccd
mul dword [ebp - 0x18]
mov esi, edx
shr esi, 3
cmp esi, 0x3e8
jae 0x405999
mov esi, 0x3e8
jmp 0x4059a6
cmp esi, 0x2710
jbe 0x4059a6
mov esi, 0x2710
test edi, edi
je 0x4059cb
mov ebx, dword [ebp - 0xc]
mov edx, dword [ebp + 0x10]
mov eax, dword [ebp + 0x18]
push ebx
push 2
push edx
push eax
call edi
inc ebx
add esp, 0x10
mov dword [ebp - 0xc], ebx
test eax, eax
je 0x405a0a
mov ebx, dword [sym.imp.KERNEL32.dll_GetTickCount]
push esi
call dword [sym.imp.KERNEL32.dll_Sleep]
mov ecx, dword [ebp - 0x10]
cmp dword [ebp - 0x1c], ecx
jbe 0x4059e7
call ebx
mov edx, dword [ebp - 0x1c]
mov dword [ebp - 0x14], eax
mov dword [ebp - 0x10], edx
jmp 0x4059f1
call ebx
sub eax, dword [ebp - 0x14]
cmp eax, dword [ebp - 0x18]
ja 0x405a0a
mov ecx, dword [ebp - 8]
mov edx, dword [ecx + 4]
lea eax, [ebp - 0x30]
push eax
push edx
call dword [sym.imp.ADVAPI32.dll_QueryServiceStatus]
test eax, eax
jne 0x405971
test edi, edi
je 0x405a1f
mov eax, dword [ebp + 0x10]
mov ecx, dword [ebp + 0x18]
push 0
push 3
push eax
push ecx
call edi
add esp, 0x10
push 0x3e8
call dword [sym.imp.KERNEL32.dll_Sleep]
mov eax, dword [ebp - 8]
mov ecx, dword [eax + 4]
lea edx, [ebp - 0x30]
push edx
push ecx
call dword [sym.imp.ADVAPI32.dll_QueryServiceStatus]
test eax, eax
je case.0x40589a.129
test edi, edi
je 0x405a5a
mov eax, dword [ebp + 0x10]
mov ecx, dword [ebp + 0x18]
lea edx, [ebp - 0x30]
push edx
push 4
push eax
push ecx
call edi
add esp, 0x10
mov edx, dword [ebp + 8]
cmp dword [ebp - 0x2c], edx
jne case.0x40589a.129
pop edi
pop ebx
mov eax, 1
pop esi
mov esp, ebp
pop ebp
ret
xor eax, eax
pop esi
mov esp, ebp
pop ebp
ret