Function at 0x484160
Capabilities:
Check for time delay via gettickcount
Link many functions at runtime

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x3c
mov eax, dword [0x6319d0]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 8]
push esi
push edi
mov dword [ebp - 0x38], eax
call fcn.0046d4f0
test eax, eax
je 0x4841f8
push 0
push str.CService_::_StopAService_n
push 0x6ab0d0
call fcn.00599ee3
mov ecx, dword [str.ENTRY:]
mov edx, dword [0x5ccf7c]
mov eax, 0x6ab0d0
mov dword [0x6aafd0], ecx
add esp, 0xc
mov dword [0x6aafd4], edx
mov ecx, eax
mov dl, byte [eax]
inc eax
test dl, dl
jne 0x4841b4
mov edi, 0x6aafd0
sub eax, ecx
mov esi, ecx
dec edi
mov cl, byte [edi + 1]
inc edi
test cl, cl
jne 0x4841c5
mov ecx, eax
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
call fcn.0046d6a0
mov ecx, eax
call fcn.0046d500
push 0x6aafd0
call fcn.0046d6a0
mov ecx, eax
call fcn.0046d9d0
call fcn.0046d4f0
test eax, eax
je 0x48422c
mov eax, dword [ebp + 0xc]
mov ecx, dword [ebp - 0x38]
push eax
push ecx
push str.lpszServiceName___s__bDoDeleteService___d_n
push 0x6aaed0
call fcn.00599ee3
add esp, 0x10
push 0x6aaed0
call fcn.0046d6a0
mov ecx, eax
call fcn.0046d9d0
push ebx
xor esi, esi
push str.Advapi32.dll
mov dword [ebp - 0x24], esi
call dword [sym.imp.KERNEL32.dll_LoadLibraryA]
mov ebx, eax
test ebx, ebx
je 0x4843a1
mov esi, dword [sym.imp.KERNEL32.dll_GetProcAddress]
push 0x5dbe2c
push ebx
call esi
mov dword [ebp - 0x28], eax
test eax, eax
je 0x484365
push 0x5dbe1c
push ebx
call esi
mov edi, eax
test edi, edi
je 0x484342
push 0x5dbe08
push ebx
call esi
mov dword [ebp - 0x34], eax
test eax, eax
je 0x48431f
push 0x5dbdf8
push ebx
call esi
mov dword [ebp - 0x2c], eax
test eax, eax
je 0x4842fc
push 0x5dbde8
push ebx
call esi
mov dword [ebp - 0x3c], eax
test eax, eax
je 0x4842d9
push 0x5dbdd4
push ebx
call esi
mov dword [ebp - 0x30], eax
test eax, eax
jne 0x4843c4
call fcn.0046d4f0
test eax, eax
je 0x4844d4
push str.Failed_to_load_export_CloseServiceHandle_n
call fcn.0046d6a0
mov ecx, eax
call fcn.0046d9d0
jmp 0x4844d4
call fcn.0046d4f0
test eax, eax
je 0x4844d4
push str.Failed_to_load_export_DeleteService_n
call fcn.0046d6a0
mov ecx, eax
call fcn.0046d9d0
jmp 0x4844d4
call fcn.0046d4f0
test eax, eax
je 0x4844d4
push str.Failed_to_load_export_ControlService_n
call fcn.0046d6a0
mov ecx, eax
call fcn.0046d9d0
jmp 0x4844d4
call fcn.0046d4f0
test eax, eax
je 0x4844d4
push str.Failed_to_load_export_QueryServiceStatus_n
call fcn.0046d6a0
mov ecx, eax
call fcn.0046d9d0
jmp 0x4844d4
call fcn.0046d4f0
test eax, eax
je 0x4844d4
push str.Failed_to_load_export_OpenServiceA_n
call fcn.0046d6a0
mov ecx, eax
call fcn.0046d9d0
jmp 0x4844d4
call fcn.0046d4f0
test eax, eax
je 0x4844d4
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.Failed_to_load_export_OpenSCManagerA_:_GetLastError_____d_n
push 0x6aadd0
call fcn.00599ee3
add esp, 0xc
push 0x6aadd0
call fcn.0046d6a0
mov ecx, eax
call fcn.0046d9d0
jmp 0x4844d4
call fcn.0046d4f0
test eax, eax
je 0x4844de
push str.Failed_to_load_Advapi32.dll_file_n
call fcn.0046d6a0
mov ecx, eax
call fcn.0046d9d0
jmp 0x4844de
push 0xf003f
push str.ServicesActive
push 0
call dword [ebp - 0x28]
mov dword [ebp - 0x28], eax
test eax, eax
je 0x4844d4
mov edx, dword [ebp - 0x38]
push 0xf01ff
push edx
push eax
call edi
mov esi, eax
test esi, esi
je 0x4844cd
lea eax, [ebp - 0x20]
push eax
push esi
call dword [ebp - 0x34]
test eax, eax
je 0x4844c9
cmp dword [ebp - 0x1c], 4
jne 0x4845b6
lea ecx, [ebp - 0x20]
push ecx
push 1
push esi
call dword [ebp - 0x2c]
test eax, eax
je 0x4845a6
call dword [sym.imp.KERNEL32.dll_GetTickCount]
cmp dword [ebp - 0x1c], 1
mov dword [ebp - 0x2c], eax
je 0x4845d0
mov edi, dword [sym.imp.KERNEL32.dll_Sleep]
lea esp, [esp]
push 0x3e8
call edi
lea edx, [ebp - 0x20]
push edx
push esi
call dword [ebp - 0x34]
test eax, eax
je 0x48447c
cmp dword [ebp - 0x1c], 1
je 0x4845d0
call dword [sym.imp.KERNEL32.dll_GetTickCount]
sub eax, dword [ebp - 0x2c]
cmp eax, 0x1388
ja 0x484579
cmp dword [ebp - 0x1c], 1
jne 0x484440
jmp 0x4845d0
call fcn.0046d4f0
test eax, eax
je 0x4844af
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.ERROR:_QueryServiceStatus_:_GetLastError_____d_n
push 0x6aacd0
call fcn.00599ee3
add esp, 0xc
push 0x6aacd0
call fcn.0046d6a0
mov ecx, eax
call fcn.0046d9d0
call fcn.0046d4f0
test eax, eax
je 0x4844c9
push str.ERROR:_Failed_to_completely_stop_service_n
call fcn.0046d6a0
mov ecx, eax
call fcn.0046d9d0
push esi
call dword [ebp - 0x30]
mov ecx, dword [ebp - 0x28]
push ecx
call dword [ebp - 0x30]
push ebx
call dword [sym.imp.KERNEL32.dll_FreeLibrary]
mov esi, dword [ebp - 0x24]
call fcn.0046d4f0
pop ebx
test eax, eax
je 0x484601
push esi
push str.CService_::_StopAService_:_bRetVal___d_n
push 0x6aabd0
call fcn.00599ee3
mov eax, dword [0x5ccefc]
mov edx, dword [str.EXIT:]
mov dword [0x6aaad4], eax
mov eax, 0x6aabd0
add esp, 0xc
mov dword [0x6aaad0], edx
mov ecx, eax
lea esp, [esp]
mov dl, byte [eax]
inc eax
test dl, dl
jne 0x484520
mov edi, 0x6aaad0
sub eax, ecx
mov esi, ecx
dec edi
mov cl, byte [edi + 1]
inc edi
test cl, cl
jne 0x484531
mov ecx, eax
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
push 0x6aaad0
rep movsb byte es:[edi], byte [esi]
call fcn.0046d6a0
mov ecx, eax
call fcn.0046d9d0
call fcn.0046d6a0
mov ecx, eax
call fcn.0046d510
mov eax, dword [ebp - 0x24]
pop edi
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00599ed4
mov esp, ebp
pop ebp
ret 8
call fcn.0046d4f0
test eax, eax
je 0x4844af
mov eax, dword [ebp - 0x1c]
push eax
push str.ERROR:_TimeOut_:_dwCurrentState_d_n
push 0x6aa9d0
call fcn.00599ee3
add esp, 0xc
push 0x6aa9d0
jmp 0x4844a3
call fcn.0046d4f0
test eax, eax
je 0x4845d0
push str.FAILED_to_stop_service____Setting_for_Reboot_n
jmp 0x4845c4
call fcn.0046d4f0
test eax, eax
je 0x4845d0
push str.FAILED_ControlService_:_Service_Not_Running_n
call fcn.0046d6a0
mov ecx, eax
call fcn.0046d9d0
cmp dword [ebp + 0xc], 0
je 0x4845de
push esi
call dword [ebp - 0x3c]
test eax, eax
je 0x4845ea
mov dword [ebp - 0x24], 1
jmp 0x4844c9
call fcn.0046d4f0
test eax, eax
je 0x4844c9
push str.FAILED_to_stop_service____Setting_for_Reboot_n
jmp 0x4844bd
mov ecx, dword [ebp - 4]
pop edi
mov eax, esi
xor ecx, ebp
pop esi
call fcn.00599ed4
mov esp, ebp
pop ebp
ret 8