Function at 0x410ec0
Capabilities:
Check for time delay via gettickcount
Query service status
Resolve function by parsing pe exports
Start service

Disassembly:
push 0xffffffffffffffff
push 0x447ed8
mov eax, dword fs:[0]
push eax
sub esp, 0x54
push ebx
push ebp
push esi
push edi
mov eax, dword [0x4650f0]
xor eax, esp
push eax
lea eax, [esp + 0x68]
mov dword fs:[0], eax
push 0xf003f
push 0
push 0
mov dword [esp + 0x7c], 0
call dword [sym.imp.ADVAPI32.dll_OpenSCManagerW]
mov edi, eax
test edi, edi
mov dword [esp + 0x14], edi
jne 0x410f7f
call dword [sym.imp.KERNEL32.dll_GetLastError]
push str.OpenSCManager_failed_with_error
lea ecx, [esp + 0x28]
mov dword [esp + 0x18], eax
call fcn.004010e0
lea ecx, [esp + 0x14]
push ecx
lea edx, [esp + 0x20]
mov ebx, 1
push edx
mov ecx, eax
mov byte [esp + 0x78], bl
call fcn.00403240
lea ecx, [esp + 0x1c]
mov byte [esp + 0x70], bl
call fcn.00411520
lea ecx, [esp + 0x24]
mov byte [esp + 0x70], 0
call fcn.00411520
lea ecx, [esp + 0x78]
mov dword [esp + 0x70], 0xffffffff
call fcn.00411520
mov eax, 0x64
mov ecx, dword [esp + 0x68]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x60
ret
mov eax, dword [esp + 0x7c]
mov ebx, 1
cmp dword [eax - 4], ebx
jle 0x410fa1
mov eax, dword [eax - 0xc]
push eax
lea ecx, [esp + 0x80]
call fcn.00401df0
mov eax, dword [esp + 0x7c]
push 0xf01ff
push eax
push edi
call dword [sym.imp.ADVAPI32.dll_OpenServiceW]
mov esi, eax
test esi, esi
jne 0x41100a
call dword [sym.imp.KERNEL32.dll_GetLastError]
push str.OpenService_failed_with_error
lea ecx, [esp + 0x20]
mov dword [esp + 0x18], eax
call fcn.004010e0
lea ecx, [esp + 0x14]
push ecx
lea edx, [esp + 0x28]
push edx
mov ecx, eax
mov byte [esp + 0x78], 3
call fcn.00403240
lea ecx, [esp + 0x24]
mov byte [esp + 0x70], 3
call fcn.00411520
lea ecx, [esp + 0x1c]
mov byte [esp + 0x70], 0
call fcn.00411520
push edi
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
jmp 0x410f55
lea eax, [esp + 0x18]
push eax
push 0x24
lea ecx, [esp + 0x4c]
push ecx
push 0
push esi
call dword [sym.imp.ADVAPI32.dll_QueryServiceStatusEx]
test eax, eax
jne 0x41107e
call dword [sym.imp.KERNEL32.dll_GetLastError]
push str.QueryServiceStatusEx_failed_with_error
lea ecx, [esp + 0x20]
mov dword [esp + 0x18], eax
call fcn.004010e0
lea edx, [esp + 0x14]
push edx
lea ecx, [esp + 0x28]
push ecx
mov bl, 5
mov ecx, eax
mov byte [esp + 0x78], bl
call fcn.00403240
lea ecx, [esp + 0x24]
mov byte [esp + 0x70], bl
call fcn.00411520
lea ecx, [esp + 0x1c]
mov byte [esp + 0x70], 0
call fcn.00411520
push esi
mov esi, dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
call esi
push edi
call esi
jmp 0x410f55
mov eax, dword [esp + 0x48]
cmp eax, ebx
mov ebp, dword [sym.imp.KERNEL32.dll_GetTickCount]
je 0x411123
cmp eax, 3
je 0x4110b0
push str.Cannot_start_the_service_because_it_is_already_running
lea ecx, [esp + 0x28]
call fcn.004010e0
lea ecx, [esp + 0x24]
jmp 0x411063
call ebp
mov ebx, dword [esp + 0x58]
mov edi, eax
mov eax, 0xcccccccd
mul dword [esp + 0x5c]
shr edx, 3
cmp edx, 0x3e8
jae 0x4110d3
mov edx, 0x3e8
jmp 0x4110e0
cmp edx, 0x2710
jbe 0x4110e0
mov edx, 0x2710
push edx
call dword [sym.imp.KERNEL32.dll_Sleep]
lea edx, [esp + 0x18]
push edx
push 0x24
lea eax, [esp + 0x4c]
push eax
push 0
push esi
call dword [sym.imp.ADVAPI32.dll_QueryServiceStatusEx]
test eax, eax
je 0x41117b
cmp dword [esp + 0x58], ebx
jbe 0x41110a
call ebp
jmp 0x411118
call ebp
sub eax, edi
cmp eax, dword [esp + 0x5c]
ja 0x4111da
cmp dword [esp + 0x48], 3
je 0x4110b0
mov edi, dword [esp + 0x14]
push 0
push 0
push esi
call dword [sym.imp.ADVAPI32.dll_StartServiceW]
test eax, eax
jne 0x41120b
call dword [sym.imp.KERNEL32.dll_GetLastError]
push str.StartService_failed_with_error
lea ecx, [esp + 0x28]
mov dword [esp + 0x20], eax
call fcn.004010e0
lea edx, [esp + 0x1c]
push edx
lea ecx, [esp + 0x30]
push ecx
mov bl, 0xb
mov ecx, eax
mov byte [esp + 0x78], bl
call fcn.00403240
lea ecx, [esp + 0x2c]
mov byte [esp + 0x70], bl
call fcn.00411520
lea ecx, [esp + 0x24]
jmp 0x411063
call dword [sym.imp.KERNEL32.dll_GetLastError]
push str.QueryServiceStatusEx_failed_with_error
lea ecx, [esp + 0x30]
mov dword [esp + 0x20], eax
call fcn.004010e0
lea ecx, [esp + 0x1c]
push ecx
lea edx, [esp + 0x28]
mov bl, 8
push edx
mov ecx, eax
mov byte [esp + 0x78], bl
call fcn.00403240
lea ecx, [esp + 0x24]
mov byte [esp + 0x70], bl
call fcn.00411520
lea ecx, [esp + 0x2c]
mov byte [esp + 0x70], 0
call fcn.00411520
push esi
mov esi, dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
call esi
mov eax, dword [esp + 0x14]
push eax
call esi
jmp 0x410f55
push str.Timeout_waiting_for_service_to_stop
lea ecx, [esp + 0x30]
call fcn.004010e0
lea ecx, [esp + 0x2c]
mov byte [esp + 0x70], 0
call fcn.00411520
push esi
mov esi, dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
call esi
mov ecx, dword [esp + 0x14]
push ecx
call esi
jmp 0x410f55
cmp dword [esp + 0x80], 0
je 0x411313
lea edx, [esp + 0x18]
push edx
push 0x24
lea eax, [esp + 0x4c]
push eax
push 0
push esi
call dword [sym.imp.ADVAPI32.dll_QueryServiceStatusEx]
test eax, eax
jne 0x411277
call dword [sym.imp.KERNEL32.dll_GetLastError]
push 0x44d7c0
lea ecx, [esp + 0x40]
mov dword [esp + 0x20], eax
call fcn.004010e0
lea ecx, [esp + 0x1c]
push ecx
lea edx, [esp + 0x38]
mov bl, 0xd
push edx
mov ecx, eax
mov byte [esp + 0x78], bl
call fcn.00403240
lea ecx, [esp + 0x34]
mov byte [esp + 0x70], bl
call fcn.00411520
lea ecx, [esp + 0x3c]
jmp 0x411063
call ebp
cmp dword [esp + 0x48], 2
mov ebx, dword [esp + 0x58]
mov edi, eax
jne 0x41130f
lea ebx, [ebx]
mov eax, 0xcccccccd
mul dword [esp + 0x5c]
shr edx, 3
cmp edx, 0x3e8
jae 0x4112ab
mov edx, 0x3e8
jmp 0x4112b8
cmp edx, 0x2710
jbe 0x4112b8
mov edx, 0x2710
push edx
call dword [sym.imp.KERNEL32.dll_Sleep]
lea eax, [esp + 0x18]
push eax
push 0x24
lea ecx, [esp + 0x4c]
push ecx
push 0
push esi
call dword [sym.imp.ADVAPI32.dll_QueryServiceStatusEx]
test eax, eax
je 0x4112fb
cmp dword [esp + 0x58], ebx
jbe 0x4112e8
call ebp
mov ebx, dword [esp + 0x58]
mov edi, eax
jmp 0x4112f2
call ebp
sub eax, edi
cmp eax, dword [esp + 0x5c]
ja 0x41130f
cmp dword [esp + 0x48], 2
je 0x411290
jmp 0x41130f
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.QueryServiceStatusEx_failed___d__n
call fcn.004331ac
add esp, 8
mov edi, dword [esp + 0x14]
push esi
mov esi, dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
call esi
push edi
call esi
lea ecx, [esp + 0x78]
mov dword [esp + 0x70], 0xffffffff
call fcn.00411520
xor eax, eax
mov ecx, dword [esp + 0x68]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x60
ret