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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x38
mov eax, dword [0x45e070]
xor eax, ebp
mov dword [ebp - 4], eax
push esi
push edi
mov edi, dword [ebp + 8]
xor esi, esi
test edi, edi
jne 0x406f2e
lea eax, [edi + 0x57]
pop edi
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0040fcd6
mov esp, ebp
pop ebp
ret
push ebx
push 0xf003f
push 0
push 0
call dword [sym.imp.ADVAPI32.dll_OpenSCManagerW]
mov ebx, eax
mov dword [ebp - 0x30], ebx
test ebx, ebx
jne 0x406f5e
call dword [sym.imp.KERNEL32.dll_GetLastError]
pop ebx
pop edi
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0040fcd6
mov esp, ebp
pop ebp
ret
push 0xf01ff
push edi
push ebx
call dword [sym.imp.ADVAPI32.dll_OpenServiceW]
mov dword [ebp - 0x38], eax
test eax, eax
jne 0x406f85
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edi, dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
mov esi, eax
jmp 0x407143
lea ecx, [ebp - 8]
mov dword [ebp - 8], 0x24
push ecx
push 0x24
lea ecx, [ebp - 0x2c]
push ecx
push 0
push eax
call dword [sym.imp.ADVAPI32.dll_QueryServiceStatusEx]
test eax, eax
jne 0x406fb0
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
jmp 0x407138
mov eax, dword [ebp - 0x28]
cmp eax, 1
je 0x406fc4
cmp eax, 3
je 0x406fc4
xor esi, esi
jmp 0x407138
mov edi, dword [sym.imp.KERNEL32.dll_GetTickCount]
call edi
cmp dword [ebp - 0x28], 3
mov ecx, 0x2710
mov ebx, dword [ebp - 0x18]
mov dword [ebp - 0x34], eax
jne 0x407064
mov eax, 0xcccccccd
mul dword [ebp - 0x14]
shr edx, 3
cmp edx, 0x3e8
jae 0x406ffb
mov edx, 0x3e8
jmp 0x407004
cmp edx, 0x2710
cmova edx, ecx
push edx
call dword [sym.imp.KERNEL32.dll_Sleep]
lea eax, [ebp - 8]
push eax
push 0x24
lea eax, [ebp - 0x2c]
push eax
push 0
push dword [ebp - 0x38]
call dword [sym.imp.ADVAPI32.dll_QueryServiceStatusEx]
test eax, eax
je 0x407054
cmp dword [ebp - 0x18], ebx
jbe 0x407033
call edi
mov ebx, dword [ebp - 0x18]
mov dword [ebp - 0x34], eax
jmp 0x40703d
call edi
sub eax, dword [ebp - 0x34]
cmp eax, dword [ebp - 0x14]
ja 0x40704a
cmp dword [ebp - 0x28], 3
mov ecx, 0x2710
je 0x406fe1
jmp 0x407064
mov esi, 0x5b4
jmp 0x407135
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
test esi, esi
jne 0x407135
mov ebx, dword [ebp - 0x38]
push 0
push 0
push ebx
call dword [sym.imp.ADVAPI32.dll_StartServiceW]
test eax, eax
jne 0x407083
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
jmp 0x407135
lea eax, [ebp - 8]
push eax
push 0x24
lea eax, [ebp - 0x2c]
push eax
push 0
push ebx
call dword [sym.imp.ADVAPI32.dll_QueryServiceStatusEx]
test eax, eax
je 0x407076
call edi
cmp dword [ebp - 0x28], 2
mov ebx, dword [ebp - 0x18]
mov dword [ebp - 0x34], eax
jne 0x407129
nop dword [eax]
mov eax, 0xcccccccd
mul dword [ebp - 0x14]
shr edx, 3
cmp edx, 0x3e8
jae 0x4070ca
mov edx, 0x3e8
jmp 0x4070d8
cmp edx, 0x2710
mov eax, 0x2710
cmova edx, eax
push edx
call dword [sym.imp.KERNEL32.dll_Sleep]
lea eax, [ebp - 8]
push eax
push 0x24
lea eax, [ebp - 0x2c]
push eax
push 0
push dword [ebp - 0x38]
call dword [sym.imp.ADVAPI32.dll_QueryServiceStatusEx]
test eax, eax
je 0x40711d
cmp dword [ebp - 0x18], ebx
jbe 0x407107
call edi
mov ebx, dword [ebp - 0x18]
mov dword [ebp - 0x34], eax
jmp 0x407111
call edi
sub eax, dword [ebp - 0x34]
cmp eax, dword [ebp - 0x14]
ja 0x407119
cmp dword [ebp - 0x28], 2
je 0x4070b0
jmp 0x407129
xor esi, esi
jmp 0x407129
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
test esi, esi
jne 0x407135
cmp dword [ebp - 0x28], 4
mov eax, 0x65b
cmovne esi, eax
mov ebx, dword [ebp - 0x30]
push dword [ebp - 0x38]
mov edi, dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
call edi
push ebx
call edi
mov ecx, dword [ebp - 4]
mov eax, esi
pop ebx
pop edi
xor ecx, ebp
pop esi
call fcn.0040fcd6
mov esp, ebp
pop ebp
ret