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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x38
mov eax, dword [0x41f004]
xor eax, ebp
mov dword [ebp - 4], eax
push esi
push edi
xor edi, edi
push str.startService_n
inc edi
call fcn.004010f8
mov dword [esp], 0xf003f
xor esi, esi
push esi
push esi
call dword [sym.imp.ADVAPI32.dll_OpenSCManagerW]
mov dword [ebp - 0x38], eax
test eax, eax
jne 0x4020cc
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.OpenSCManager_failed___d__n
call fcn.004010f8
pop ecx
pop ecx
xor eax, eax
jmp 0x402308
push ebx
push 0xf01ff
push str.WifiAutoInstallSrv
push eax
call dword [sym.imp.ADVAPI32.dll_OpenServiceW]
mov ebx, eax
test ebx, ebx
jne 0x4020fc
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.OpenService_failed___d__n
call fcn.004010f8
pop ecx
pop ecx
jmp 0x4022fc
lea eax, [ebp - 0x34]
push eax
push 0x24
lea eax, [ebp - 0x28]
push eax
push esi
push ebx
call dword [sym.imp.ADVAPI32.dll_QueryServiceStatusEx]
test eax, eax
jne 0x40212c
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.QueryServiceStatusEx_failed___d__n
call fcn.004010f8
pop ecx
pop ecx
mov edi, esi
jmp 0x4022f3
cmp dword [ebp - 0x24], edi
je 0x4021bc
cmp dword [ebp - 0x24], 3
je 0x402147
push str.Cannot_start_the_service_because_it_is_already_running_n
call fcn.004010f8
jmp 0x402124
call dword [sym.imp.KERNEL32.dll_GetTickCount]
mov dword [ebp - 0x2c], eax
xor edx, edx
mov eax, dword [ebp - 0x14]
mov dword [ebp - 0x30], eax
mov eax, dword [ebp - 0x10]
push 0xa
pop ecx
div ecx
mov ecx, 0x3e8
cmp eax, ecx
jae 0x40216d
mov eax, ecx
jmp 0x402177
mov ecx, 0x2710
cmp eax, ecx
cmova eax, ecx
push eax
call dword [sym.imp.KERNEL32.dll_Sleep]
lea eax, [ebp - 0x34]
push eax
push 0x24
lea eax, [ebp - 0x28]
push eax
push esi
push ebx
call dword [sym.imp.ADVAPI32.dll_QueryServiceStatusEx]
test eax, eax
je 0x402112
mov eax, dword [ebp - 0x30]
cmp dword [ebp - 0x14], eax
jbe 0x4021a8
call dword [sym.imp.KERNEL32.dll_GetTickCount]
jmp 0x4021b6
call dword [sym.imp.KERNEL32.dll_GetTickCount]
sub eax, dword [ebp - 0x2c]
cmp eax, dword [ebp - 0x10]
ja 0x4021da
cmp dword [ebp - 0x24], 3
je 0x402147
push esi
push esi
push ebx
call dword [sym.imp.ADVAPI32.dll_StartServiceW]
test eax, eax
jne 0x4021e9
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.StartService_failed___d__n
jmp 0x40211e
push str.Timeout_waiting_for_service_to_stop_n
call fcn.00401029
jmp 0x402124
push str.Service_start_pending..._n
call fcn.004010f8
pop ecx
lea eax, [ebp - 0x34]
push eax
push 0x24
lea eax, [ebp - 0x28]
push eax
push esi
push ebx
call dword [sym.imp.ADVAPI32.dll_QueryServiceStatusEx]
test eax, eax
je 0x402112
call dword [sym.imp.KERNEL32.dll_GetTickCount]
mov ecx, dword [ebp - 0x14]
mov dword [ebp - 0x30], eax
mov dword [ebp - 0x2c], ecx
jmp 0x402284
mov eax, dword [ebp - 0x10]
xor edx, edx
push 0xa
pop ecx
div ecx
mov ecx, 0x3e8
cmp eax, ecx
jae 0x402236
mov eax, ecx
jmp 0x402240
mov ecx, 0x2710
cmp eax, ecx
cmova eax, ecx
push eax
call dword [sym.imp.KERNEL32.dll_Sleep]
lea eax, [ebp - 0x34]
push eax
push 0x24
lea eax, [ebp - 0x28]
push eax
push esi
push ebx
call dword [sym.imp.ADVAPI32.dll_QueryServiceStatusEx]
test eax, eax
je 0x40228c
mov eax, dword [ebp - 0x2c]
cmp dword [ebp - 0x14], eax
jbe 0x402276
call dword [sym.imp.KERNEL32.dll_GetTickCount]
mov dword [ebp - 0x30], eax
mov eax, dword [ebp - 0x14]
mov dword [ebp - 0x2c], eax
jmp 0x402284
call dword [sym.imp.KERNEL32.dll_GetTickCount]
sub eax, dword [ebp - 0x30]
cmp eax, dword [ebp - 0x10]
ja 0x40229f
cmp dword [ebp - 0x24], 2
je 0x40221f
jmp 0x40229f
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.QueryServiceStatusEx_failed___d__n
call fcn.004010f8
pop ecx
pop ecx
cmp dword [ebp - 0x24], 4
jne 0x4022b2
push str.Service_started_successfully._n
call fcn.004010f8
pop ecx
jmp 0x4022f3
push str.__Service_not_started.__n
call fcn.004010f8
push dword [ebp - 0x24]
push str.__Current_State:__d_n
call fcn.004010f8
push dword [ebp - 0x1c]
push str.__Exit_Code:__d_n
call fcn.004010f8
push dword [ebp - 0x14]
push str.__Check_Point:__d_n
call fcn.004010f8
push dword [ebp - 0x10]
push str.__Wait_Hint:__d_n
call fcn.004010f8
add esp, 0x24
push ebx
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
mov esi, edi
push dword [ebp - 0x38]
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
mov eax, esi
pop ebx
mov ecx, dword [ebp - 4]
pop edi
xor ecx, ebp
pop esi
call fcn.004025eb
leave
ret