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

Disassembly:
push 0xffffffffffffffff
push 0x446798
mov eax, dword fs:[0]
push eax
sub esp, 0x54
push ebx
push ebp
push esi
push edi
mov eax, dword [0x4630d8]
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 0x41035f
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.00403040
lea ecx, [esp + 0x1c]
mov byte [esp + 0x70], bl
call fcn.0040ed80
lea ecx, [esp + 0x24]
mov byte [esp + 0x70], 0
call fcn.0040ed80
lea ecx, [esp + 0x78]
mov dword [esp + 0x70], 0xffffffff
call fcn.0040ed80
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 0x410381
mov eax, dword [eax - 0xc]
push eax
lea ecx, [esp + 0x80]
call fcn.00401c20
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 0x4103ea
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.00403040
lea ecx, [esp + 0x24]
mov byte [esp + 0x70], 3
call fcn.0040ed80
lea ecx, [esp + 0x1c]
mov byte [esp + 0x70], 0
call fcn.0040ed80
push edi
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
jmp 0x410335
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 0x41045e
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.00403040
lea ecx, [esp + 0x24]
mov byte [esp + 0x70], bl
call fcn.0040ed80
lea ecx, [esp + 0x1c]
mov byte [esp + 0x70], 0
call fcn.0040ed80
push esi
mov esi, dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
call esi
push edi
call esi
jmp 0x410335
mov eax, dword [esp + 0x48]
cmp eax, ebx
mov ebp, dword [sym.imp.KERNEL32.dll_GetTickCount]
je 0x410503
cmp eax, 3
je 0x410490
push str.Cannot_start_the_service_because_it_is_already_running
lea ecx, [esp + 0x28]
call fcn.004010e0
lea ecx, [esp + 0x24]
jmp 0x410443
call ebp
mov ebx, dword [esp + 0x58]
mov edi, eax
mov eax, 0xcccccccd
mul dword [esp + 0x5c]
shr edx, 3
cmp edx, 0x3e8
jae 0x4104b3
mov edx, 0x3e8
jmp 0x4104c0
cmp edx, 0x2710
jbe 0x4104c0
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 0x41055b
cmp dword [esp + 0x58], ebx
jbe 0x4104ea
call ebp
jmp 0x4104f8
call ebp
sub eax, edi
cmp eax, dword [esp + 0x5c]
ja 0x4105ba
cmp dword [esp + 0x48], 3
je 0x410490
mov edi, dword [esp + 0x14]
push 0
push 0
push esi
call dword [sym.imp.ADVAPI32.dll_StartServiceW]
test eax, eax
jne 0x4105eb
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.00403040
lea ecx, [esp + 0x2c]
mov byte [esp + 0x70], bl
call fcn.0040ed80
lea ecx, [esp + 0x24]
jmp 0x410443
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.00403040
lea ecx, [esp + 0x24]
mov byte [esp + 0x70], bl
call fcn.0040ed80
lea ecx, [esp + 0x2c]
mov byte [esp + 0x70], 0
call fcn.0040ed80
push esi
mov esi, dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
call esi
mov eax, dword [esp + 0x14]
push eax
call esi
jmp 0x410335
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.0040ed80
push esi
mov esi, dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
call esi
mov ecx, dword [esp + 0x14]
push ecx
call esi
jmp 0x410335
cmp dword [esp + 0x80], 0
je 0x4106f3
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 0x410657
call dword [sym.imp.KERNEL32.dll_GetLastError]
push 0x44b7a0
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.00403040
lea ecx, [esp + 0x34]
mov byte [esp + 0x70], bl
call fcn.0040ed80
lea ecx, [esp + 0x3c]
jmp 0x410443
call ebp
cmp dword [esp + 0x48], 2
mov ebx, dword [esp + 0x58]
mov edi, eax
jne 0x4106ef
lea ebx, [ebx]
mov eax, 0xcccccccd
mul dword [esp + 0x5c]
shr edx, 3
cmp edx, 0x3e8
jae 0x41068b
mov edx, 0x3e8
jmp 0x410698
cmp edx, 0x2710
jbe 0x410698
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 0x4106db
cmp dword [esp + 0x58], ebx
jbe 0x4106c8
call ebp
mov ebx, dword [esp + 0x58]
mov edi, eax
jmp 0x4106d2
call ebp
sub eax, edi
cmp eax, dword [esp + 0x5c]
ja 0x4106ef
cmp dword [esp + 0x48], 2
je 0x410670
jmp 0x4106ef
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.QueryServiceStatusEx_failed___d__n
call fcn.0043184f
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.0040ed80
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