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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x38
mov eax, dword [0x41e004]
xor eax, ebp
mov dword [ebp - 4], eax
push esi
push edi
xor edi, edi
push str.startService_n
inc edi
call fcn.004010fe
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 0x401fa5
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.OpenSCManager_failed___d__n
call fcn.004010fe
pop ecx
pop ecx
xor eax, eax
jmp 0x4021e1
push ebx
push 0xf01ff
push str.WifiAutoInstallSrv
push eax
call dword [sym.imp.ADVAPI32.dll_OpenServiceW]
mov ebx, eax
test ebx, ebx
jne 0x401fd5
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.OpenService_failed___d__n
call fcn.004010fe
pop ecx
pop ecx
jmp 0x4021d5
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 0x402005
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.QueryServiceStatusEx_failed___d__n
call fcn.004010fe
pop ecx
pop ecx
mov edi, esi
jmp 0x4021cc
cmp dword [ebp - 0x24], edi
je 0x402095
cmp dword [ebp - 0x24], 3
je 0x402020
push str.Cannot_start_the_service_because_it_is_already_running_n
call fcn.004010fe
jmp 0x401ffd
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 0x402046
mov eax, ecx
jmp 0x402050
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 0x401feb
mov eax, dword [ebp - 0x30]
cmp dword [ebp - 0x14], eax
jbe 0x402081
call dword [sym.imp.KERNEL32.dll_GetTickCount]
jmp 0x40208f
call dword [sym.imp.KERNEL32.dll_GetTickCount]
sub eax, dword [ebp - 0x2c]
cmp eax, dword [ebp - 0x10]
ja 0x4020b3
cmp dword [ebp - 0x24], 3
je 0x402020
push esi
push esi
push ebx
call dword [sym.imp.ADVAPI32.dll_StartServiceW]
test eax, eax
jne 0x4020c2
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.StartService_failed___d__n
jmp 0x401ff7
push str.Timeout_waiting_for_service_to_stop_n
call fcn.00401029
jmp 0x401ffd
push str.Service_start_pending..._n
call fcn.004010fe
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 0x401feb
call dword [sym.imp.KERNEL32.dll_GetTickCount]
mov ecx, dword [ebp - 0x14]
mov dword [ebp - 0x30], eax
mov dword [ebp - 0x2c], ecx
jmp 0x40215d
mov eax, dword [ebp - 0x10]
xor edx, edx
push 0xa
pop ecx
div ecx
mov ecx, 0x3e8
cmp eax, ecx
jae 0x40210f
mov eax, ecx
jmp 0x402119
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 0x402165
mov eax, dword [ebp - 0x2c]
cmp dword [ebp - 0x14], eax
jbe 0x40214f
call dword [sym.imp.KERNEL32.dll_GetTickCount]
mov dword [ebp - 0x30], eax
mov eax, dword [ebp - 0x14]
mov dword [ebp - 0x2c], eax
jmp 0x40215d
call dword [sym.imp.KERNEL32.dll_GetTickCount]
sub eax, dword [ebp - 0x30]
cmp eax, dword [ebp - 0x10]
ja 0x402178
cmp dword [ebp - 0x24], 2
je 0x4020f8
jmp 0x402178
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.QueryServiceStatusEx_failed___d__n
call fcn.004010fe
pop ecx
pop ecx
cmp dword [ebp - 0x24], 4
jne 0x40218b
push str.Service_started_successfully._n
call fcn.004010fe
pop ecx
jmp 0x4021cc
push str.__Service_not_started.__n
call fcn.004010fe
push dword [ebp - 0x24]
push str.__Current_State:__d_n
call fcn.004010fe
push dword [ebp - 0x1c]
push str.__Exit_Code:__d_n
call fcn.004010fe
push dword [ebp - 0x14]
push str.__Check_Point:__d_n
call fcn.004010fe
push dword [ebp - 0x10]
push str.__Wait_Hint:__d_n
call fcn.004010fe
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.0040251a
mov esp, ebp
pop ebp
ret