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

Disassembly:
sub esp, 0x23c
push ebx
push esi
push edi
call fcn.0044bde0
test eax, eax
je 0x459759
mov eax, dword [esp + 0x24c]
lea ecx, [esp + 0x48]
push eax
push str.CService_::_StartAService_:_csServiceName___s_n
push ecx
call fcn.00471c30
mov edi, str.ENTRY:
or ecx, 0xffffffff
xor eax, eax
add esp, 0xc
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
lea edx, [esp + 0x148]
mov eax, ecx
mov esi, edi
mov edi, edx
lea edx, [esp + 0x148]
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
xor eax, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
lea edi, [esp + 0x48]
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov esi, edi
mov ebx, ecx
mov edi, edx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov ecx, ebx
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, ebx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
call fcn.0044bd70
mov ecx, eax
call fcn.0044be10
lea eax, [esp + 0x148]
push eax
call fcn.0044bd70
mov ecx, eax
call fcn.0044c180
xor esi, esi
push str.Advapi32.dll
mov dword [esp + 0x10], esi
call dword [sym.imp.KERNEL32.dll_LoadLibraryA]
mov ebx, eax
test ebx, ebx
mov dword [esp + 0x10], ebx
je 0x459888
mov esi, dword [sym.imp.KERNEL32.dll_GetProcAddress]
push ebp
push str.OpenSCManagerA
push ebx
call esi
mov ebp, eax
test ebp, ebp
je 0x459865
push str.OpenServiceA
push ebx
call esi
mov edi, eax
test edi, edi
je 0x459842
push str.QueryServiceStatusEx
push ebx
call esi
test eax, eax
mov dword [esp + 0x20], eax
je 0x45981f
push str.StartServiceA
push ebx
call esi
mov ebx, eax
test ebx, ebx
je 0x4597fc
mov ecx, dword [esp + 0x14]
push str.CloseServiceHandle
push ecx
call esi
test eax, eax
mov dword [esp + 0x18], eax
jne 0x4598ab
call fcn.0044bde0
test eax, eax
je 0x459ad7
push str.Failed_to_load_export_CloseServiceHandle_n
call fcn.0044bd70
mov ecx, eax
call fcn.0044c180
jmp 0x459ad7
call fcn.0044bde0
test eax, eax
je 0x459ad7
push str.Failed_to_load_export_StartService_n
call fcn.0044bd70
mov ecx, eax
call fcn.0044c180
jmp 0x459ad7
call fcn.0044bde0
test eax, eax
je 0x459adb
push str.Failed_to_load_export_pfnQueryServiceStatusEx_n
call fcn.0044bd70
mov ecx, eax
call fcn.0044c180
jmp 0x459adb
call fcn.0044bde0
test eax, eax
je 0x459adb
push str.Failed_to_load_export_OpenServiceA_n
call fcn.0044bd70
mov ecx, eax
call fcn.0044c180
jmp 0x459adb
call fcn.0044bde0
test eax, eax
je 0x459adb
push str.Failed_to_load_export_OpenSCManagerA_n
call fcn.0044bd70
mov ecx, eax
call fcn.0044c180
jmp 0x459adb
call fcn.0044bde0
test eax, eax
je 0x459ae7
push str.Failed_to_load_Advapi32.dll_file_n
call fcn.0044bd70
mov ecx, eax
call fcn.0044c180
jmp 0x459ae7
push 1
push str.ServicesActive
push 0
call ebp
test eax, eax
mov dword [esp + 0x24], eax
je 0x4599f5
mov edx, dword [esp + 0x250]
push 0xf01ff
push edx
push eax
call edi
mov esi, eax
test esi, esi
je 0x459a31
push 0
push 0
push esi
call ebx
test eax, eax
je 0x459a5a
mov ebp, dword [esp + 0x20]
lea eax, [esp + 0x1c]
push eax
lea ecx, [esp + 0x2c]
push 0x24
push ecx
push 0
push esi
call ebp
test eax, eax
je 0x459a83
mov ebx, dword [sym.imp.KERNEL32.dll_GetTickCount]
call ebx
mov edx, dword [esp + 0x3c]
mov edi, eax
mov eax, dword [esp + 0x2c]
mov dword [esp + 0x10], edx
cmp eax, 2
jne 0x4599e8
mov eax, 0xcccccccd
mul dword [esp + 0x40]
shr edx, 3
cmp edx, 0x3e8
jae 0x459942
mov edx, 0x3e8
jmp 0x45994f
cmp edx, 0x2710
jbe 0x45994f
mov edx, 0x2710
push edx
call dword [sym.imp.KERNEL32.dll_Sleep]
lea eax, [esp + 0x1c]
lea ecx, [esp + 0x28]
push eax
push 0x24
push ecx
push 0
push esi
call ebp
test eax, eax
je 0x4599a5
mov edx, dword [esp + 0x10]
mov eax, dword [esp + 0x3c]
cmp eax, edx
jbe 0x459985
call ebx
mov edi, eax
mov eax, dword [esp + 0x3c]
mov dword [esp + 0x10], eax
jmp 0x459991
call ebx
mov ecx, dword [esp + 0x40]
sub eax, edi
cmp eax, ecx
ja 0x4599ce
cmp dword [esp + 0x2c], 2
je 0x459927
mov dword [esp + 0x10], 1
jmp 0x459ab6
call fcn.0044bde0
test eax, eax
je 0x4599e8
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
lea ecx, [esp + 0x50]
push str.ERROR:_QueryServiceStatusEx___2_:_GetLastError_____d_n
push ecx
call fcn.00471c30
add esp, 0xc
lea edx, [esp + 0x4c]
push edx
jmp 0x4599dc
call fcn.0044bde0
test eax, eax
je 0x4599e8
push str.ERROR:_Time_Out_n
call fcn.0044bd70
mov ecx, eax
call fcn.0044c180
mov dword [esp + 0x10], 1
jmp 0x459ab6
call fcn.0044bde0
test eax, eax
je 0x459ac8
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
lea eax, [esp + 0x50]
push str.ERROR:_OpenSCManager___:_GetLastError_____d_n
push eax
call fcn.00471c30
add esp, 0xc
lea ecx, [esp + 0x4c]
push ecx
call fcn.0044bd70
mov ecx, eax
call fcn.0044c180
jmp 0x459ac8
call fcn.0044bde0
test eax, eax
je 0x459ab6
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
lea edx, [esp + 0x50]
push str.ERROR:_OpenService___:_GetLastError_____d_n
push edx
call fcn.00471c30
add esp, 0xc
lea eax, [esp + 0x4c]
push eax
jmp 0x459aaa
call fcn.0044bde0
test eax, eax
je 0x459ab6
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
lea ecx, [esp + 0x50]
push str.ERROR:_StartService___:_GetLastError_____d_n
push ecx
call fcn.00471c30
add esp, 0xc
lea edx, [esp + 0x4c]
push edx
jmp 0x459aaa
call fcn.0044bde0
test eax, eax
je 0x459ab6
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
lea eax, [esp + 0x50]
push str.ERROR:_QueryServiceStatusEx___:_GetLastError_____d_n
push eax
call fcn.00471c30
add esp, 0xc
lea ecx, [esp + 0x4c]
push ecx
call fcn.0044bd70
mov ecx, eax
call fcn.0044c180
test esi, esi
je 0x459abf
push esi
call dword [esp + 0x1c]
mov edx, dword [esp + 0x24]
push edx
call dword [esp + 0x1c]
cmp dword [esp + 0x2c], 4
je 0x459ad7
mov dword [esp + 0x10], 0
mov ebx, dword [esp + 0x14]
push ebx
call dword [sym.imp.KERNEL32.dll_FreeLibrary]
mov esi, dword [esp + 0x10]
pop ebp
call fcn.0044bde0
test eax, eax
je 0x459b90
push esi
lea eax, [esp + 0x4c]
push str.CService_::_StartAService_:_bRetVal___d_n
push eax
call fcn.00471c30
mov edi, str.EXIT:
or ecx, 0xffffffff
xor eax, eax
add esp, 0xc
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
lea edx, [esp + 0x148]
mov eax, ecx
mov esi, edi
mov edi, edx
lea edx, [esp + 0x148]
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
xor eax, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
lea edi, [esp + 0x48]
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov esi, edi
mov ebx, ecx
mov edi, edx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov ecx, ebx
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, ebx
lea eax, [esp + 0x148]
and ecx, 3
push eax
rep movsb byte es:[edi], byte [esi]
call fcn.0044bd70
mov ecx, eax
call fcn.0044c180
call fcn.0044bd70
mov ecx, eax
call fcn.0044be20
mov eax, dword [esp + 0xc]
pop edi
pop esi
pop ebx
add esp, 0x23c
ret 4
mov eax, esi
pop edi
pop esi
pop ebx
add esp, 0x23c
ret 4