Function at 0x478d00
Capabilities:
Check for time delay via gettickcount
Delete service
Query service status
Start service
Stop service

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x2c
mov eax, dword [0x780784]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
push esi
push edi
mov edi, dword [ebp + 8]
call dword [sym.imp.KERNEL32.dll_GetTickCount]
push 0xf003f
push 0
push 0
mov esi, eax
xor bl, bl
call dword [sym.imp.ADVAPI32.dll_OpenSCManagerW]
mov dword [0x785d78], eax
test eax, eax
jne 0x478d6f
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.OpenSCManager_failed___d_
push 0
push 4
push dword [0x74abe8]
push dword [0x785d74]
call fcn.0054e4f0
add esp, 0x18
xor al, al
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0060cdfa
mov esp, ebp
pop ebp
ret
push 0x1002c
push edi
push eax
call dword [sym.imp.ADVAPI32.dll_OpenServiceW]
mov dword [0x785d7c], eax
test eax, eax
jne 0x478dd4
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.OpenSCManager_failed___d_
push 0
push 4
push dword [0x74abe8]
push dword [0x785d74]
call fcn.0054e4f0
add esp, 0x18
push dword [0x785d78]
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
call dword [sym.imp.KERNEL32.dll_GetLastError]
pop edi
cmp eax, 0x424
pop esi
sete al
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0060cdfa
mov esp, ebp
pop ebp
ret
lea ecx, [ebp - 8]
push ecx
push 0x24
lea ecx, [ebp - 0x2c]
push ecx
push 0
push eax
call dword [sym.imp.ADVAPI32.dll_QueryServiceStatusEx]
test eax, eax
jne 0x478e14
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.QueryServiceStatusEx_failed___d_
push 0
push 4
push dword [0x74abe8]
push dword [0x785d74]
call fcn.0054e4f0
add esp, 0x18
jmp 0x478ff8
mov eax, dword [ebp - 0x28]
cmp eax, 1
jne 0x478e26
push str.Service_is_already_stopped
jmp 0x478f59
cmp eax, 3
jne 0x478eb2
mov edi, 0x2710
push str.Service_stop_pending...
push 0
push 4
push dword [0x74abe8]
push dword [0x785d74]
call fcn.0054e4f0
mov eax, 0xcccccccd
add esp, 0x14
mul dword [ebp - 0x14]
shr edx, 3
cmp edx, 0x3e8
jae 0x478e6b
mov edx, 0x3e8
jmp 0x478e70
cmp edx, edi
cmova edx, edi
push edx
call dword [sym.imp.KERNEL32.dll_Sleep]
lea eax, [ebp - 8]
push eax
push 0x24
lea eax, [ebp - 0x2c]
push eax
push 0
push dword [0x785d7c]
call dword [sym.imp.ADVAPI32.dll_QueryServiceStatusEx]
test eax, eax
je 0x478deb
cmp dword [ebp - 0x28], 1
je 0x478efd
call dword [sym.imp.KERNEL32.dll_GetTickCount]
sub eax, esi
cmp eax, 0x7530
ja 0x478ede
cmp dword [ebp - 0x28], 3
je 0x478e34
call fcn.00479100
lea eax, [ebp - 0x2c]
push eax
push 1
push dword [0x785d7c]
call dword [sym.imp.ADVAPI32.dll_ControlService]
test eax, eax
jne 0x478f07
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.ControlService_failed___d__n
jmp 0x478df7
push str.Service_stop_timed_out.
push 0
push 4
push dword [0x74abe8]
push dword [0x785d74]
call fcn.0054e4f0
jmp 0x478ff5
push str.Service_stopped_successfully
jmp 0x478fde
cmp dword [ebp - 0x28], 1
je 0x478f54
nop dword [eax]
push dword [ebp - 0x14]
call dword [sym.imp.KERNEL32.dll_Sleep]
lea eax, [ebp - 8]
push eax
push 0x24
lea eax, [ebp - 0x2c]
push eax
push 0
push dword [0x785d7c]
call dword [sym.imp.ADVAPI32.dll_QueryServiceStatusEx]
test eax, eax
je 0x478fc8
cmp dword [ebp - 0x28], 1
je 0x478f54
call dword [sym.imp.KERNEL32.dll_GetTickCount]
sub eax, esi
cmp eax, 0x7530
ja 0x478fbe
cmp dword [ebp - 0x28], 1
jne 0x478f10
push str.Service_stopped_successfully_n
push 0
push 4
push dword [0x74abe8]
push dword [0x785d74]
call fcn.0054e4f0
add esp, 0x14
push dword [0x785d7c]
call dword [sym.imp.ADVAPI32.dll_DeleteService]
test eax, eax
jne 0x478fd9
xor bl, bl
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.DeleteService_failed_w_err_0x_08lx_n
push 0
push 4
push dword [0x74abe8]
push dword [0x785d74]
call fcn.0054e4f0
add esp, 0x18
cmp byte [ebp + 0xc], bl
jne 0x478ff8
push 0
push 0
push dword [0x785d7c]
call dword [sym.imp.ADVAPI32.dll_StartServiceW]
jmp 0x478ff8
push str.Wait_timed_out_n
jmp 0x478ee3
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.QueryServiceStatusEx_failed___d__n
jmp 0x478df7
push str.DeleteService_Success_n
push 0
push 4
push dword [0x74abe8]
push dword [0x785d74]
call fcn.0054e4f0
mov bl, 1
add esp, 0x14
push dword [0x785d7c]
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
push dword [0x785d78]
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
push 0x1388
mov dword [0x785d7c], 0
mov dword [0x785d78], 0
call dword [sym.imp.KERNEL32.dll_Sleep]
mov ecx, dword [ebp - 4]
mov al, bl
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.0060cdfa
mov esp, ebp
pop ebp
ret