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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x34
mov eax, dword [0x46706c]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
push esi
push edi
push 0xf003f
push 0
push 0
call dword [sym.imp.ADVAPI32.dll_OpenSCManagerW]
mov edi, eax
test edi, edi
jne 0x40e2ad
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.OpenSCManager_failed___d__n
call fcn.00401250
add esp, 8
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00414dec
mov esp, ebp
pop ebp
ret
push 0xf01ff
push str.CMigrationService
push edi
call dword [sym.imp.ADVAPI32.dll_OpenServiceW]
mov esi, eax
test esi, esi
jne 0x40e2f0
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.OpenService_failed___d__n
call fcn.00401250
add esp, 8
push edi
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00414dec
mov esp, ebp
pop ebp
ret
lea eax, [ebp - 0x34]
push eax
push 0x24
lea eax, [ebp - 0x28]
push eax
push 0
push esi
call dword [sym.imp.ADVAPI32.dll_QueryServiceStatusEx]
test eax, eax
jne 0x40e320
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.QueryServiceStatusEx_failed___d__n
call fcn.00401250
add esp, 8
jmp 0x40e52a
mov eax, dword [ebp - 0x24]
cmp eax, 1
je 0x40e33f
cmp eax, 3
je 0x40e33f
push str.Cannot_start_the_service_because_it_is_already_running_n
call fcn.00401250
add esp, 4
jmp 0x40e52a
mov ebx, dword [sym.imp.KERNEL32.dll_GetTickCount]
call ebx
cmp dword [ebp - 0x24], 3
mov ecx, 0x2710
mov dword [ebp - 0x30], eax
mov eax, dword [ebp - 0x14]
mov dword [ebp - 0x2c], eax
jne 0x40e3cf
nop dword [eax + eax]
mov eax, 0xcccccccd
mul dword [ebp - 0x10]
shr edx, 3
cmp edx, 0x3e8
jae 0x40e37a
mov edx, 0x3e8
jmp 0x40e383
cmp edx, 0x2710
cmova edx, ecx
push edx
call dword [sym.imp.KERNEL32.dll_Sleep]
lea eax, [ebp - 0x34]
push eax
push 0x24
lea eax, [ebp - 0x28]
push eax
push 0
push esi
call dword [sym.imp.ADVAPI32.dll_QueryServiceStatusEx]
test eax, eax
je 0x40e307
mov eax, dword [ebp - 0x2c]
cmp dword [ebp - 0x14], eax
jbe 0x40e3ba
call ebx
mov ecx, dword [ebp - 0x14]
mov dword [ebp - 0x30], eax
mov dword [ebp - 0x2c], ecx
jmp 0x40e3c4
call ebx
sub eax, dword [ebp - 0x30]
cmp eax, dword [ebp - 0x10]
ja 0x40e3f7
cmp dword [ebp - 0x24], 3
mov ecx, 0x2710
je 0x40e360
push 0
push 0
push esi
call dword [sym.imp.ADVAPI32.dll_StartServiceW]
test eax, eax
jne 0x40e409
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.StartService_failed___d__n
call fcn.00401250
add esp, 8
jmp 0x40e52a
push str.Timeout_waiting_for_service_to_stop_n
call fcn.00401250
add esp, 4
jmp 0x40e52a
push str.Service_start_pending..._n
call fcn.00401250
add esp, 4
lea eax, [ebp - 0x34]
push eax
push 0x24
lea eax, [ebp - 0x28]
push eax
push 0
push esi
call dword [sym.imp.ADVAPI32.dll_QueryServiceStatusEx]
test eax, eax
je 0x40e307
call ebx
cmp dword [ebp - 0x24], 2
mov dword [ebp - 0x2c], eax
mov eax, dword [ebp - 0x14]
mov dword [ebp - 0x30], eax
jne 0x40e4d1
nop word [eax + eax]
mov eax, 0xcccccccd
mul dword [ebp - 0x10]
shr edx, 3
cmp edx, 0x3e8
jae 0x40e46a
mov edx, 0x3e8
jmp 0x40e478
cmp edx, 0x2710
mov eax, 0x2710
cmova edx, eax
push edx
call dword [sym.imp.KERNEL32.dll_Sleep]
lea eax, [ebp - 0x34]
push eax
push 0x24
lea eax, [ebp - 0x28]
push eax
push 0
push esi
call dword [sym.imp.ADVAPI32.dll_QueryServiceStatusEx]
test eax, eax
je 0x40e4bd
mov eax, dword [ebp - 0x30]
cmp dword [ebp - 0x14], eax
jbe 0x40e4ab
call ebx
mov ecx, dword [ebp - 0x14]
mov dword [ebp - 0x2c], eax
mov dword [ebp - 0x30], ecx
jmp 0x40e4b5
call ebx
sub eax, dword [ebp - 0x2c]
cmp eax, dword [ebp - 0x10]
ja 0x40e4d1
cmp dword [ebp - 0x24], 2
je 0x40e450
jmp 0x40e4d1
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.QueryServiceStatusEx_failed___d__n
call fcn.00401250
add esp, 8
cmp dword [ebp - 0x24], 4
jne 0x40e4e6
push str.Service_started_successfully._n
call fcn.00401250
add esp, 4
jmp 0x40e52a
push str.Service_not_started.__n
call fcn.00401250
add esp, 4
push dword [ebp - 0x24]
push str.__Current_State:__d_n
call fcn.00401250
push dword [ebp - 0x1c]
push str.__Exit_Code:__d_n
call fcn.00401250
push dword [ebp - 0x14]
push str.__Check_Point:__d_n
call fcn.00401250
push dword [ebp - 0x10]
push str.__Wait_Hint:__d_n
call fcn.00401250
add esp, 0x20
push esi
mov esi, dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
call esi
push edi
call esi
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.00414dec
mov esp, ebp
pop ebp
ret