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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x3c
mov eax, dword [0x45563c]
xor eax, ebp
mov dword [ebp - 4], eax
mov dword [ebp - 0x30], ecx
push 0xf003f
push 0
push 0
call dword [sym.imp.ADVAPI32.dll_OpenSCManagerA]
mov ecx, dword [ebp - 0x30]
mov dword [ecx + 0x45c], eax
mov edx, dword [ebp - 0x30]
cmp dword [edx + 0x45c], 0
jne 0x410066
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push 0x44de64
call fcn.004034b0
push eax
call fcn.004038b0
add esp, 0xc
jmp 0x4104a7
push 0x14
mov eax, dword [ebp - 0x30]
push eax
mov ecx, dword [ebp - 0x30]
mov edx, dword [ecx + 0x45c]
push edx
call dword [sym.imp.ADVAPI32.dll_OpenServiceA]
mov ecx, dword [ebp - 0x30]
mov dword [ecx + 0x460], eax
mov edx, dword [ebp - 0x30]
cmp dword [edx + 0x460], 0
jne 0x4100c0
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push 0x44de80
call fcn.004034b0
push eax
call fcn.004038b0
add esp, 0xc
mov eax, dword [ebp - 0x30]
mov ecx, dword [eax + 0x45c]
push ecx
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
jmp 0x4104a7
lea edx, [ebp - 8]
push edx
push 0x24
lea eax, [ebp - 0x2c]
push eax
push 0
mov ecx, dword [ebp - 0x30]
mov edx, dword [ecx + 0x460]
push edx
call dword [sym.imp.ADVAPI32.dll_QueryServiceStatusEx]
test eax, eax
jne 0x41011f
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push 0x44de9c
call fcn.004034b0
push eax
call fcn.004038b0
add esp, 0xc
mov eax, dword [ebp - 0x30]
mov ecx, dword [eax + 0x460]
push ecx
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
mov edx, dword [ebp - 0x30]
mov eax, dword [edx + 0x45c]
push eax
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
jmp 0x4104a7
cmp dword [ebp - 0x28], 1
je 0x410163
cmp dword [ebp - 0x28], 3
je 0x410163
push str.Cannot_start_the_service_because_it_is_already_running_n
call fcn.004034b0
push eax
call fcn.004038b0
add esp, 8
mov ecx, dword [ebp - 0x30]
mov edx, dword [ecx + 0x460]
push edx
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
mov eax, dword [ebp - 0x30]
mov ecx, dword [eax + 0x45c]
push ecx
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
jmp 0x4104a7
call dword [sym.imp.KERNEL32.dll_GetTickCount]
mov dword [ebp - 0x3c], eax
mov edx, dword [ebp - 0x18]
mov dword [ebp - 0x38], edx
cmp dword [ebp - 0x28], 3
jne 0x410274
mov eax, dword [ebp - 0x14]
xor edx, edx
mov ecx, 0xa
div ecx
mov dword [ebp - 0x34], eax
cmp dword [ebp - 0x34], 0x3e8
jae 0x41019d
mov dword [ebp - 0x34], 0x3e8
jmp 0x4101ad
cmp dword [ebp - 0x34], 0x2710
jbe 0x4101ad
mov dword [ebp - 0x34], 0x2710
mov edx, dword [ebp - 0x34]
push edx
call dword [sym.imp.KERNEL32.dll_Sleep]
lea eax, [ebp - 8]
push eax
push 0x24
lea ecx, [ebp - 0x2c]
push ecx
push 0
mov edx, dword [ebp - 0x30]
mov eax, dword [edx + 0x460]
push eax
call dword [sym.imp.ADVAPI32.dll_QueryServiceStatusEx]
test eax, eax
jne 0x410216
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push 0x44def8
call fcn.004034b0
push eax
call fcn.004038b0
add esp, 0xc
mov ecx, dword [ebp - 0x30]
mov edx, dword [ecx + 0x460]
push edx
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
mov eax, dword [ebp - 0x30]
mov ecx, dword [eax + 0x45c]
push ecx
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
jmp 0x4104a7
mov edx, dword [ebp - 0x18]
cmp edx, dword [ebp - 0x38]
jbe 0x41022f
call dword [sym.imp.KERNEL32.dll_GetTickCount]
mov dword [ebp - 0x3c], eax
mov eax, dword [ebp - 0x18]
mov dword [ebp - 0x38], eax
jmp 0x41026f
call dword [sym.imp.KERNEL32.dll_GetTickCount]
sub eax, dword [ebp - 0x3c]
cmp eax, dword [ebp - 0x14]
jbe 0x41026f
push str.Timeout_waiting_for_service_to_stop_n
call fcn.00412a3e
add esp, 4
mov ecx, dword [ebp - 0x30]
mov edx, dword [ecx + 0x460]
push edx
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
mov eax, dword [ebp - 0x30]
mov ecx, dword [eax + 0x45c]
push ecx
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
jmp 0x4104a7
jmp 0x410172
push 0
push 0
mov edx, dword [ebp - 0x30]
mov eax, dword [edx + 0x460]
push eax
call dword [sym.imp.ADVAPI32.dll_StartServiceA]
test eax, eax
jne 0x4102cd
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.StartService_failed___d__n
call fcn.004034b0
push eax
call fcn.004038b0
add esp, 0xc
mov ecx, dword [ebp - 0x30]
mov edx, dword [ecx + 0x460]
push edx
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
mov eax, dword [ebp - 0x30]
mov ecx, dword [eax + 0x45c]
push ecx
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
jmp 0x4104a7
push str.Service_start_pending..._n
call fcn.004034b0
push eax
call fcn.004038b0
add esp, 8
lea edx, [ebp - 8]
push edx
push 0x24
lea eax, [ebp - 0x2c]
push eax
push 0
mov ecx, dword [ebp - 0x30]
mov edx, dword [ecx + 0x460]
push edx
call dword [sym.imp.ADVAPI32.dll_QueryServiceStatusEx]
test eax, eax
jne 0x41033f
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push 0x44df7c
call fcn.004034b0
push eax
call fcn.004038b0
add esp, 0xc
mov eax, dword [ebp - 0x30]
mov ecx, dword [eax + 0x460]
push ecx
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
mov edx, dword [ebp - 0x30]
mov eax, dword [edx + 0x45c]
push eax
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
jmp 0x4104a7
call dword [sym.imp.KERNEL32.dll_GetTickCount]
mov dword [ebp - 0x3c], eax
mov ecx, dword [ebp - 0x18]
mov dword [ebp - 0x38], ecx
cmp dword [ebp - 0x28], 2
jne 0x4103fd
mov eax, dword [ebp - 0x14]
xor edx, edx
mov ecx, 0xa
div ecx
mov dword [ebp - 0x34], eax
cmp dword [ebp - 0x34], 0x3e8
jae 0x410379
mov dword [ebp - 0x34], 0x3e8
jmp 0x410389
cmp dword [ebp - 0x34], 0x2710
jbe 0x410389
mov dword [ebp - 0x34], 0x2710
mov edx, dword [ebp - 0x34]
push edx
call dword [sym.imp.KERNEL32.dll_Sleep]
lea eax, [ebp - 8]
push eax
push 0x24
lea ecx, [ebp - 0x2c]
push ecx
push 0
mov edx, dword [ebp - 0x30]
mov eax, dword [edx + 0x460]
push eax
call dword [sym.imp.ADVAPI32.dll_QueryServiceStatusEx]
test eax, eax
jne 0x4103cf
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.QueryServiceStatusEx_failed___d__n
call fcn.004034b0
push eax
call fcn.004038b0
add esp, 0xc
jmp 0x4103fd
mov ecx, dword [ebp - 0x18]
cmp ecx, dword [ebp - 0x38]
jbe 0x4103e8
call dword [sym.imp.KERNEL32.dll_GetTickCount]
mov dword [ebp - 0x3c], eax
mov edx, dword [ebp - 0x18]
mov dword [ebp - 0x38], edx
jmp 0x4103f8
call dword [sym.imp.KERNEL32.dll_GetTickCount]
sub eax, dword [ebp - 0x3c]
cmp eax, dword [ebp - 0x14]
jbe 0x4103f8
jmp 0x4103fd
jmp 0x41034e
cmp dword [ebp - 0x28], 4
jne 0x410418
push str.Service_started_successfully._n
call fcn.004034b0
push eax
call fcn.004038b0
add esp, 8
jmp 0x410487
push str.Service_not_started.__n
call fcn.004034b0
push eax
call fcn.004038b0
add esp, 8
mov eax, dword [ebp - 0x28]
push eax
push str.__Current_State:__d_n
call fcn.004034b0
push eax
call fcn.004038b0
add esp, 0xc
mov ecx, dword [ebp - 0x20]
push ecx
push str.__Exit_Code:__d_n
call fcn.004034b0
push eax
call fcn.004038b0
add esp, 0xc
mov edx, dword [ebp - 0x18]
push edx
push str.__Check_Point:__d_n
call fcn.004034b0
push eax
call fcn.004038b0
add esp, 0xc
mov eax, dword [ebp - 0x14]
push eax
push str.__Wait_Hint:__d_n
call fcn.004034b0
push eax
call fcn.004038b0
add esp, 0xc
mov ecx, dword [ebp - 0x30]
mov edx, dword [ecx + 0x460]
push edx
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
mov eax, dword [ebp - 0x30]
mov ecx, dword [eax + 0x45c]
push ecx
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00411455
mov esp, ebp
pop ebp
ret