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

Disassembly:
push 0xffffffffffffffff
push 0x446728
mov eax, dword fs:[0]
push eax
sub esp, 0x54
push ebx
push ebp
push esi
push edi
mov eax, dword [0x4630c8]
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 0x41024f
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.00403090
lea ecx, [esp + 0x1c]
mov byte [esp + 0x70], bl
call fcn.0040ec70
lea ecx, [esp + 0x24]
mov byte [esp + 0x70], 0
call fcn.0040ec70
lea ecx, [esp + 0x78]
mov dword [esp + 0x70], 0xffffffff
call fcn.0040ec70
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 0x410271
mov eax, dword [eax - 0xc]
push eax
lea ecx, [esp + 0x80]
call fcn.00401bf0
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 0x4102da
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.00403090
lea ecx, [esp + 0x24]
mov byte [esp + 0x70], 3
call fcn.0040ec70
lea ecx, [esp + 0x1c]
mov byte [esp + 0x70], 0
call fcn.0040ec70
push edi
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
jmp 0x410225
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 0x41034e
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.00403090
lea ecx, [esp + 0x24]
mov byte [esp + 0x70], bl
call fcn.0040ec70
lea ecx, [esp + 0x1c]
mov byte [esp + 0x70], 0
call fcn.0040ec70
push esi
mov esi, dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
call esi
push edi
call esi
jmp 0x410225
mov eax, dword [esp + 0x48]
cmp eax, ebx
mov ebp, dword [sym.imp.KERNEL32.dll_GetTickCount]
je 0x4103f3
cmp eax, 3
je 0x410380
push str.Cannot_start_the_service_because_it_is_already_running
lea ecx, [esp + 0x28]
call fcn.004010e0
lea ecx, [esp + 0x24]
jmp 0x410333
call ebp
mov ebx, dword [esp + 0x58]
mov edi, eax
mov eax, 0xcccccccd
mul dword [esp + 0x5c]
shr edx, 3
cmp edx, 0x3e8
jae 0x4103a3
mov edx, 0x3e8
jmp 0x4103b0
cmp edx, 0x2710
jbe 0x4103b0
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 0x41044b
cmp dword [esp + 0x58], ebx
jbe 0x4103da
call ebp
jmp 0x4103e8
call ebp
sub eax, edi
cmp eax, dword [esp + 0x5c]
ja 0x4104aa
cmp dword [esp + 0x48], 3
je 0x410380
mov edi, dword [esp + 0x14]
push 0
push 0
push esi
call dword [sym.imp.ADVAPI32.dll_StartServiceW]
test eax, eax
jne 0x4104db
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.00403090
lea ecx, [esp + 0x2c]
mov byte [esp + 0x70], bl
call fcn.0040ec70
lea ecx, [esp + 0x24]
jmp 0x410333
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.00403090
lea ecx, [esp + 0x24]
mov byte [esp + 0x70], bl
call fcn.0040ec70
lea ecx, [esp + 0x2c]
mov byte [esp + 0x70], 0
call fcn.0040ec70
push esi
mov esi, dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
call esi
mov eax, dword [esp + 0x14]
push eax
call esi
jmp 0x410225
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.0040ec70
push esi
mov esi, dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
call esi
mov ecx, dword [esp + 0x14]
push ecx
call esi
jmp 0x410225
cmp dword [esp + 0x80], 0
je 0x4105e3
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 0x410547
call dword [sym.imp.KERNEL32.dll_GetLastError]
push 0x44b768
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.00403090
lea ecx, [esp + 0x34]
mov byte [esp + 0x70], bl
call fcn.0040ec70
lea ecx, [esp + 0x3c]
jmp 0x410333
call ebp
cmp dword [esp + 0x48], 2
mov ebx, dword [esp + 0x58]
mov edi, eax
jne 0x4105df
lea ebx, [ebx]
mov eax, 0xcccccccd
mul dword [esp + 0x5c]
shr edx, 3
cmp edx, 0x3e8
jae 0x41057b
mov edx, 0x3e8
jmp 0x410588
cmp edx, 0x2710
jbe 0x410588
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 0x4105cb
cmp dword [esp + 0x58], ebx
jbe 0x4105b8
call ebp
mov ebx, dword [esp + 0x58]
mov edi, eax
jmp 0x4105c2
call ebp
sub eax, edi
cmp eax, dword [esp + 0x5c]
ja 0x4105df
cmp dword [esp + 0x48], 2
je 0x410560
jmp 0x4105df
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.QueryServiceStatusEx_failed___d__n
call fcn.00431d95
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.0040ec70
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