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

Disassembly:
push 0xffffffffffffffff
push 0x4465f8
mov eax, dword fs:[0]
push eax
sub esp, 0x54
push ebx
push ebp
push esi
push edi
mov eax, dword [0x4630d0]
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 0x4102ff
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.00403080
lea ecx, [esp + 0x1c]
mov byte [esp + 0x70], bl
call fcn.0040ed90
lea ecx, [esp + 0x24]
mov byte [esp + 0x70], 0
call fcn.0040ed90
lea ecx, [esp + 0x78]
mov dword [esp + 0x70], 0xffffffff
call fcn.0040ed90
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 0x410321
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 0x41038a
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.00403080
lea ecx, [esp + 0x24]
mov byte [esp + 0x70], 3
call fcn.0040ed90
lea ecx, [esp + 0x1c]
mov byte [esp + 0x70], 0
call fcn.0040ed90
push edi
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
jmp 0x4102d5
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 0x4103fe
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.00403080
lea ecx, [esp + 0x24]
mov byte [esp + 0x70], bl
call fcn.0040ed90
lea ecx, [esp + 0x1c]
mov byte [esp + 0x70], 0
call fcn.0040ed90
push esi
mov esi, dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
call esi
push edi
call esi
jmp 0x4102d5
mov eax, dword [esp + 0x48]
cmp eax, ebx
mov ebp, dword [sym.imp.KERNEL32.dll_GetTickCount]
je 0x4104a3
cmp eax, 3
je 0x410430
push str.Cannot_start_the_service_because_it_is_already_running
lea ecx, [esp + 0x28]
call fcn.004010e0
lea ecx, [esp + 0x24]
jmp 0x4103e3
call ebp
mov ebx, dword [esp + 0x58]
mov edi, eax
mov eax, 0xcccccccd
mul dword [esp + 0x5c]
shr edx, 3
cmp edx, 0x3e8
jae 0x410453
mov edx, 0x3e8
jmp 0x410460
cmp edx, 0x2710
jbe 0x410460
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 0x4104fb
cmp dword [esp + 0x58], ebx
jbe 0x41048a
call ebp
jmp 0x410498
call ebp
sub eax, edi
cmp eax, dword [esp + 0x5c]
ja 0x41055a
cmp dword [esp + 0x48], 3
je 0x410430
mov edi, dword [esp + 0x14]
push 0
push 0
push esi
call dword [sym.imp.ADVAPI32.dll_StartServiceW]
test eax, eax
jne 0x41058b
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.00403080
lea ecx, [esp + 0x2c]
mov byte [esp + 0x70], bl
call fcn.0040ed90
lea ecx, [esp + 0x24]
jmp 0x4103e3
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.00403080
lea ecx, [esp + 0x24]
mov byte [esp + 0x70], bl
call fcn.0040ed90
lea ecx, [esp + 0x2c]
mov byte [esp + 0x70], 0
call fcn.0040ed90
push esi
mov esi, dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
call esi
mov eax, dword [esp + 0x14]
push eax
call esi
jmp 0x4102d5
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.0040ed90
push esi
mov esi, dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
call esi
mov ecx, dword [esp + 0x14]
push ecx
call esi
jmp 0x4102d5
cmp dword [esp + 0x80], 0
je 0x410693
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 0x4105f7
call dword [sym.imp.KERNEL32.dll_GetLastError]
push 0x44b778
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.00403080
lea ecx, [esp + 0x34]
mov byte [esp + 0x70], bl
call fcn.0040ed90
lea ecx, [esp + 0x3c]
jmp 0x4103e3
call ebp
cmp dword [esp + 0x48], 2
mov ebx, dword [esp + 0x58]
mov edi, eax
jne 0x41068f
lea ebx, [ebx]
mov eax, 0xcccccccd
mul dword [esp + 0x5c]
shr edx, 3
cmp edx, 0x3e8
jae 0x41062b
mov edx, 0x3e8
jmp 0x410638
cmp edx, 0x2710
jbe 0x410638
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 0x41067b
cmp dword [esp + 0x58], ebx
jbe 0x410668
call ebp
mov ebx, dword [esp + 0x58]
mov edi, eax
jmp 0x410672
call ebp
sub eax, edi
cmp eax, dword [esp + 0x5c]
ja 0x41068f
cmp dword [esp + 0x48], 2
je 0x410610
jmp 0x41068f
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.QueryServiceStatusEx_failed___d__n
call fcn.00431702
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.0040ed90
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