Function at 0x4063b0
Capabilities:
Enumerate services
Query service status
Stop service

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x264
mov eax, dword [0x429004]
xor eax, esp
mov dword [esp + 0x260], eax
push ebx
push esi
mov ebx, ecx
mov dword [esp + 0x14], 0
push edi
mov dword [esp + 0x10], ebx
mov dword [esp + 0x1c], 0
call dword [sym.imp.KERNEL32.dll_GetTickCount64]
push 0xf003f
push 0
push 0
mov dword [esp + 0x20], eax
call dword [sym.imp.ADVAPI32.dll_OpenSCManagerW]
test eax, eax
jne 0x40645b
cmp byte [0x42a33b], al
je 0x4064a9
call dword [sym.imp.KERNEL32.dll_GetLastError]
push 0
push pe_nt_image_headers32
lea ecx, [esp + 0x70]
push ecx
push 0x409
push eax
push 0
push 0x1200
call dword [sym.imp.KERNEL32.dll_FormatMessageW]
lea eax, [esp + 0x68]
push eax
push ebx
push str.____Failed_to_open_service_manager_for__s:__s
call fcn.004012f0
add esp, 0xc
xor eax, eax
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x260]
xor ecx, esp
call fcn.00409a70
mov esp, ebp
pop ebp
ret
push 0x2c
push ebx
push eax
call dword [sym.imp.ADVAPI32.dll_OpenServiceW]
mov esi, eax
test esi, esi
jne 0x4064c0
cmp byte [0x42a33b], al
je 0x4064a9
call dword [sym.imp.KERNEL32.dll_GetLastError]
push esi
push pe_nt_image_headers32
lea ecx, [esp + 0x70]
push ecx
push 0x409
push eax
push esi
push 0x1200
call dword [sym.imp.KERNEL32.dll_FormatMessageW]
lea eax, [esp + 0x68]
push eax
push ebx
push str.____Failed_to_open_service_handle_for__s:__s
call fcn.004012f0
add esp, 0xc
xor eax, eax
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x260]
xor ecx, esp
call fcn.00409a70
mov esp, ebp
pop ebp
ret
lea eax, [esp + 0x18]
push eax
push 0x24
lea eax, [esp + 0x4c]
push eax
push 0
push esi
call dword [sym.imp.ADVAPI32.dll_QueryServiceStatusEx]
test eax, eax
jne 0x406517
cmp byte [0x42a33b], al
je 0x406594
call dword [sym.imp.KERNEL32.dll_GetLastError]
push 0
push pe_nt_image_headers32
lea ecx, [esp + 0x70]
push ecx
push 0x409
push eax
push 0
push 0x1200
call dword [sym.imp.KERNEL32.dll_FormatMessageW]
lea eax, [esp + 0x68]
push eax
push ebx
push str.____Failed_to_get_service_information_for__s:__s
jmp 0x40658c
mov eax, dword [esp + 0x48]
cmp eax, 1
je 0x40670c
cmp eax, 3
je 0x40670c
lea eax, [esp + 0x1c]
push eax
lea eax, [esp + 0x1c]
push eax
push 0
push 0
push 1
push esi
call dword [sym.imp.ADVAPI32.dll_EnumDependentServicesW]
mov edi, dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jne 0x4065b2
call edi
cmp eax, 0xea
je 0x4065b2
cmp byte [0x42a33b], 0
je 0x406594
call edi
push 0
push pe_nt_image_headers32
lea ecx, [esp + 0x70]
push ecx
push 0x409
push eax
push 0
push 0x1200
call dword [sym.imp.KERNEL32.dll_FormatMessageW]
lea eax, [esp + 0x68]
push eax
push ebx
push str.____Failed_to_enum_dependent_services_for__s:__s
call fcn.004012f0
add esp, 0xc
push esi
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
xor eax, eax
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x260]
xor ecx, esp
call fcn.00409a70
mov esp, ebp
pop ebp
ret
mov eax, dword [esp + 0x18]
lea eax, [eax + eax*8]
shl eax, 2
push eax
push 0
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov edi, eax
lea eax, [esp + 0x1c]
push eax
lea eax, [esp + 0x1c]
mov dword [esp + 0x10], edi
push eax
push dword [esp + 0x20]
push edi
push 1
push esi
call dword [sym.imp.ADVAPI32.dll_EnumDependentServicesW]
test eax, eax
jne 0x40665e
cmp byte [0x42a33b], al
je 0x40662f
mov eax, dword [sym.imp.KERNEL32.dll_GetLastError]
call eax
push 0
push pe_nt_image_headers32
lea ecx, [esp + 0x70]
push ecx
push 0x409
push eax
push 0
push 0x1200
call dword [sym.imp.KERNEL32.dll_FormatMessageW]
lea eax, [esp + 0x68]
push eax
push ebx
push str.____Failed_to_enum_dependent_services_for__s:__s
call fcn.004012f0
add esp, 0xc
push esi
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
push edi
mov eax, dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push 0
call eax
push eax
call dword [sym.imp.KERNEL32.dll_HeapFree]
xor eax, eax
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x260]
xor ecx, esp
call fcn.00409a70
mov esp, ebp
pop ebp
ret
mov eax, dword [esp + 0x1c]
test eax, eax
je 0x40668d
xor edi, edi
test eax, eax
je 0x406689
mov ebx, dword [esp + 0xc]
mov ecx, dword [ebx]
call fcn.004063b0
test eax, eax
jne 0x40672d
inc edi
add ebx, 0x24
cmp edi, dword [esp + 0x1c]
jb 0x406670
mov edi, dword [esp + 0xc]
lea eax, [esp + 0x20]
push eax
push 1
push esi
call dword [sym.imp.ADVAPI32.dll_ControlService]
test eax, eax
je 0x40662f
cmp dword [esp + 0x24], 1
je 0x4066fb
mov ebx, dword [sym.imp.KERNEL32.dll_Sleep]
nop dword [eax]
push dword [esp + 0x38]
call ebx
lea eax, [esp + 0x18]
push eax
push 0x24
lea eax, [esp + 0x28]
push eax
push 0
push esi
call dword [sym.imp.ADVAPI32.dll_QueryServiceStatusEx]
test eax, eax
je 0x40662f
cmp dword [esp + 0x24], 1
je 0x4066fb
call dword [sym.imp.KERNEL32.dll_GetTickCount64]
sub eax, dword [esp + 0x14]
sbb edx, 0
test edx, edx
ja 0x4066fb
jb 0x4066f4
cmp eax, 0x7530
ja 0x4066fb
cmp dword [esp + 0x24], 1
jne 0x4066b0
mov eax, dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push edi
push 0
call eax
push eax
call dword [sym.imp.KERNEL32.dll_HeapFree]
push esi
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
mov ecx, dword [esp + 0x26c]
mov eax, 1
pop edi
pop esi
pop ebx
xor ecx, esp
call fcn.00409a70
mov esp, ebp
pop ebp
ret
cmp byte [0x42a33b], 0
je 0x406772
mov eax, dword [sym.imp.KERNEL32.dll_GetLastError]
call eax
push 0
push pe_nt_image_headers32
lea ecx, [esp + 0x70]
push ecx
push 0x409
push eax
push 0
push 0x1200
call dword [sym.imp.KERNEL32.dll_FormatMessageW]
lea eax, [esp + 0x68]
push eax
push dword [esp + 0x14]
push str.____Failed_to_kill_dependent_services_for__s:__s
call fcn.004012f0
add esp, 0xc
push esi
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
push dword [esp + 0xc]
jmp 0x406637