Function at 0x140012460
Capabilities:
Enumerate services

Disassembly:
push rbx
push rbp
push rsi
push rdi
sub rsp, 0x288
mov rax, qword [0x14002dda0]
xor rax, rsp
mov qword [rsp + 0x270], rax
mov rdi, r9
mov qword [rsp + 0x60], r9
mov dword [rsp + 0x40], r8d
mov rsi, rdx
mov rbp, rcx
mov qword [rsp + 0x58], rcx
call qword [sym.imp.ADVAPI32.dll_OpenServiceW]
mov rbx, rax
test rax, rax
je 0x1400124f7
test rdi, rdi
je 0x1400124ef
cmp rdi, rsi
je 0x1400124ef
lea r9, [rsp + 0x40]
lea r8, [rsp + 0x70]
mov rdx, rsi
mov rcx, rbp
mov dword [rsp + 0x40], 0x100
call qword [sym.imp.ADVAPI32.dll_GetServiceDisplayNameW]
mov r11d, dword [rsp + 0x2d0]
lea r9, [rsp + 0x44]
lea rdx, [rsp + 0x70]
mov r8, rdi
mov rcx, rbp
mov dword [rsp + 0x44], r11d
call qword [sym.imp.ADVAPI32.dll_GetServiceKeyNameW]
mov rax, rbx
jmp 0x140012747
call qword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x424
je 0x140012531
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, eax
call fcn.140006fd0
mov rbx, rax
call fcn.140019be0
mov r8, rbx
lea rcx, [rax + 0x60]
mov edx, 0x4000021f
call fcn.140007250
xor eax, eax
jmp 0x140012747
test rdi, rdi
je 0x140012504
xor ecx, ecx
lea rax, [rsp + 0x50]
xor r9d, r9d
mov qword [rsp + 0x38], rax
lea rax, [rsp + 0x48]
lea edx, [rcx + 0x3b]
mov qword [rsp + 0x30], rax
lea rax, [rsp + 0x4c]
lea r8d, [rcx + 3]
mov qword [rsp + 0x28], rax
mov dword [rsp + 0x50], ecx
mov dword [rsp + 0x20], ecx
mov rcx, rbp
mov rdi, rbp
call qword [sym.imp.ADVAPI32.dll_EnumServicesStatusW]
call qword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0xea
jne 0x140012688
mov ebx, dword [rsp + 0x4c]
call qword [sym.imp.KERNEL32.dll_GetProcessHeap]
mov r8, rbx
mov rcx, rax
xor edx, edx
call qword [sym.imp.KERNEL32.dll_HeapAlloc]
mov rbp, rax
test rax, rax
jne 0x1400125cd
call fcn.140019be0
lea r8, str.ENUM_SERVICE_STATUS
lea r9, str.open_service__
lea rcx, [rax + 0x60]
mov edx, 0xc00001fa
call fcn.140007250
xor eax, eax
jmp 0x140012747
mov eax, dword [rsp + 0x4c]
mov dword [rsp + 0x54], eax
nop word [rax + rax]
lea rcx, [rsp + 0x50]
mov edx, 0x3b
mov r9, rbp
mov qword [rsp + 0x38], rcx
lea rcx, [rsp + 0x48]
lea r8d, [rdx - 0x38]
mov qword [rsp + 0x30], rcx
lea rcx, [rsp + 0x4c]
mov qword [rsp + 0x28], rcx
mov rcx, rdi
mov dword [rsp + 0x20], eax
call qword [sym.imp.ADVAPI32.dll_EnumServicesStatusW]
mov dword [rsp + 0x44], eax
test eax, eax
jne 0x14001262c
call qword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0xea
jne 0x140012674
xor ebx, ebx
cmp dword [rsp + 0x48], ebx
jbe 0x140012660
lea rdi, [rbp + 8]
nop dword [rax + rax]
mov rcx, qword [rdi]
mov rdx, rsi
call fcn.14000e140
test eax, eax
jne 0x1400126b5
inc ebx
add rdi, 0x30
cmp ebx, dword [rsp + 0x48]
jb 0x140012640
mov rdi, qword [rsp + 0x58]
cmp dword [rsp + 0x44], 0
jne 0x14001272c
mov eax, dword [rsp + 0x54]
jmp 0x1400125e0
call qword [sym.imp.KERNEL32.dll_GetProcessHeap]
mov r8, rbp
xor edx, edx
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_HeapFree]
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, eax
call fcn.140006fd0
mov rbx, rax
call fcn.140019be0
mov r8, rbx
lea rcx, [rax + 0x60]
mov edx, 0x40000220
call fcn.140007250
xor eax, eax
jmp 0x140012747
mov edx, dword [rsp + 0x2d0]
lea rax, [rbx + rbx*2]
mov rbx, qword [rsp + 0x60]
add rax, rax
lea r9, [0x140025890]
or r8, 0xffffffffffffffff
mov rax, qword [rbp + rax*8]
mov rcx, rbx
mov qword [rsp + 0x20], rax
call fcn.140019e88
test eax, eax
jns 0x14001270e
call qword [sym.imp.KERNEL32.dll_GetProcessHeap]
mov r8, rbp
xor edx, edx
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_HeapFree]
call fcn.140019be0
lea r8, str.canonical_name
jmp 0x1400125b1
call qword [sym.imp.KERNEL32.dll_GetProcessHeap]
mov r8, rbp
xor edx, edx
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_HeapFree]
mov rcx, qword [rsp + 0x58]
mov rdx, rbx
jmp 0x140012732
mov rdx, rsi
mov rcx, rdi
mov r8d, dword [rsp + 0x40]
xor r9d, r9d
mov dword [rsp + 0x20], 0
call fcn.140012460
mov rcx, qword [rsp + 0x270]
xor rcx, rsp
call fcn.14001a490
add rsp, 0x288
pop rdi
pop rsi
pop rbp
pop rbx
ret