Function at 0x40e350
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 0x40e39d
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.00414edc
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 0x40e3e0
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.00414edc
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 0x40e410
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.QueryServiceStatusEx_failed___d__n
call fcn.00401250
add esp, 8
jmp 0x40e61a
mov eax, dword [ebp - 0x24]
cmp eax, 1
je 0x40e42f
cmp eax, 3
je 0x40e42f
push str.Cannot_start_the_service_because_it_is_already_running_n
call fcn.00401250
add esp, 4
jmp 0x40e61a
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 0x40e4bf
nop dword [eax + eax]
mov eax, 0xcccccccd
mul dword [ebp - 0x10]
shr edx, 3
cmp edx, 0x3e8
jae 0x40e46a
mov edx, 0x3e8
jmp 0x40e473
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 0x40e3f7
mov eax, dword [ebp - 0x2c]
cmp dword [ebp - 0x14], eax
jbe 0x40e4aa
call ebx
mov ecx, dword [ebp - 0x14]
mov dword [ebp - 0x30], eax
mov dword [ebp - 0x2c], ecx
jmp 0x40e4b4
call ebx
sub eax, dword [ebp - 0x30]
cmp eax, dword [ebp - 0x10]
ja 0x40e4e7
cmp dword [ebp - 0x24], 3
mov ecx, 0x2710
je 0x40e450
push 0
push 0
push esi
call dword [sym.imp.ADVAPI32.dll_StartServiceW]
test eax, eax
jne 0x40e4f9
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.StartService_failed___d__n
call fcn.00401250
add esp, 8
jmp 0x40e61a
push str.Timeout_waiting_for_service_to_stop_n
call fcn.00401250
add esp, 4
jmp 0x40e61a
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 0x40e3f7
call ebx
cmp dword [ebp - 0x24], 2
mov dword [ebp - 0x2c], eax
mov eax, dword [ebp - 0x14]
mov dword [ebp - 0x30], eax
jne 0x40e5c1
nop word [eax + eax]
mov eax, 0xcccccccd
mul dword [ebp - 0x10]
shr edx, 3
cmp edx, 0x3e8
jae 0x40e55a
mov edx, 0x3e8
jmp 0x40e568
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 0x40e5ad
mov eax, dword [ebp - 0x30]
cmp dword [ebp - 0x14], eax
jbe 0x40e59b
call ebx
mov ecx, dword [ebp - 0x14]
mov dword [ebp - 0x2c], eax
mov dword [ebp - 0x30], ecx
jmp 0x40e5a5
call ebx
sub eax, dword [ebp - 0x2c]
cmp eax, dword [ebp - 0x10]
ja 0x40e5c1
cmp dword [ebp - 0x24], 2
je 0x40e540
jmp 0x40e5c1
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 0x40e5d6
push str.Service_started_successfully._n
call fcn.00401250
add esp, 4
jmp 0x40e61a
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.00414edc
mov esp, ebp
pop ebp
ret