Function at 0x18005be40
Capabilities:
Acquire debug privileges
Query service status

Disassembly:
push r15
sub rsp, 0xa0
mov rax, qword [0x1800f7080]
xor rax, rsp
mov qword [rsp + 0x88], rax
call qword [sym.imp.KERNEL32.dll_GetCurrentProcess]
lea r8, [rsp + 0x40]
mov edx, Ordinal_41
mov rcx, rax
call qword [sym.imp.ADVAPI32.dll_OpenProcessToken]
xor r15d, r15d
test eax, eax
je 0x18005bed8
lea r8, [rsp + 0x48]
xor ecx, ecx
lea rdx, str.SeDebugPrivilege
call qword [sym.imp.ADVAPI32.dll_LookupPrivilegeValueA]
mov rcx, qword [rsp + 0x40]
test eax, eax
je 0x18005bed2
mov rax, qword [rsp + 0x48]
lea r9d, [r15 + 0x10]
mov qword [rsp + 0x28], r15
lea r8, [rsp + 0x50]
xor edx, edx
mov qword [rsp + 0x54], rax
mov dword [rsp + 0x50], 1
mov dword [rsp + 0x5c], 2
mov qword [rsp + 0x20], r15
call qword [sym.imp.ADVAPI32.dll_AdjustTokenPrivileges]
mov rcx, qword [rsp + 0x40]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov rax, qword [0x1800f8608]
mov qword [rsp + 0xb0], rbx
mov qword [rsp + 0xb8], rbp
mov qword [rsp + 0xc0], rsi
mov rax, qword [rax]
mov qword [rsp + 0x98], rdi
mov qword [rsp + 0x40], rax
cmp byte [rax + 0x19], r15b
jne 0x18005bf84
nop dword [rax]
lea rbx, [rax + 0x20]
mov rcx, rbx
call fcn.18005bc00
mov esi, eax
test eax, eax
je 0x18005bf6f
mov r8d, eax
xor edx, edx
mov ecx, 0x1fffff
call qword [sym.imp.KERNEL32.dll_OpenProcess]
mov rdi, rax
test rax, rax
je 0x18005bf6f
mov rbp, qword [rbx + 0x28]
mov rbx, qword [rbx + 0x20]
cmp rbx, rbp
je 0x18005bf66
nop word [rax + rax]
mov r8, rdi
mov rdx, rbx
mov ecx, esi
call fcn.18005b7b0
add rbx, 0x20
cmp rbx, rbp
jne 0x18005bf50
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_CloseHandle]
lea rcx, [rsp + 0x40]
call fcn.18005ecc0
mov rax, qword [rsp + 0x40]
cmp byte [rax + 0x19], r15b
je 0x18005bf10
mov rax, qword [0x1800f85f8]
mov rax, qword [rax]
mov qword [rsp + 0x48], rax
cmp byte [rax + 0x19], r15b
jne 0x18005c122
mov qword [rsp + 0x90], r14
nop word [rax + rax]
xor edx, edx
lea rbx, [rax + 0x20]
xor ecx, ecx
lea r14, [rbx + 0x20]
lea r8d, [rdx + 4]
call qword [sym.imp.ADVAPI32.dll_OpenSCManagerA]
mov rdi, rax
test rax, rax
je 0x18005c101
cmp qword [rbx + 0x18], 7
mov r8, rbx
jbe 0x18005bfdf
mov r8, qword [rbx]
mov qword [rsp + 0x38], r15
xor edx, edx
mov qword [rsp + 0x30], r15
xor ecx, ecx
mov dword [rsp + 0x28], r15d
mov qword [rsp + 0x20], r15
lea r9d, [rdx - 1]
call qword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
movsxd rbp, eax
mov rcx, rbp
call fcn.1800c803c
cmp qword [rbx + 0x18], 7
mov rsi, rax
jbe 0x18005c019
mov rbx, qword [rbx]
mov qword [rsp + 0x38], r15
mov r9d, 0xffffffff
mov qword [rsp + 0x30], r15
mov r8, rbx
mov dword [rsp + 0x28], ebp
xor edx, edx
xor ecx, ecx
mov qword [rsp + 0x20], rsi
call qword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
mov r8d, 4
mov rdx, rsi
mov rcx, rdi
call qword [sym.imp.ADVAPI32.dll_OpenServiceA]
mov rcx, rsi
mov rbx, rax
call fcn.1800c7f5c
test rbx, rbx
jne 0x18005c06f
mov rcx, rdi
call qword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
jmp 0x18005c101
lea rax, [rsp + 0x40]
mov r9d, Ordinal_41
lea r8, [rsp + 0x60]
mov qword [rsp + 0x20], rax
xor edx, edx
mov rcx, rbx
call qword [sym.imp.ADVAPI32.dll_QueryServiceStatusEx]
mov rcx, rbx
test eax, eax
jne 0x18005c0a7
call qword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
mov rcx, rdi
call qword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
jmp 0x18005c101
call qword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
mov rcx, rdi
call qword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
mov esi, dword [rsp + 0x7c]
test esi, esi
je 0x18005c101
mov r8d, esi
xor edx, edx
mov ecx, 0x1fffff
call qword [sym.imp.KERNEL32.dll_OpenProcess]
mov rdi, rax
test rax, rax
je 0x18005c101
mov rbp, qword [r14 + 8]
mov rbx, qword [r14]
cmp rbx, rbp
je 0x18005c0f8
mov r8, rdi
mov rdx, rbx
mov ecx, esi
call fcn.18005b7b0
add rbx, 0x20
cmp rbx, rbp
jne 0x18005c0e2
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_CloseHandle]
lea rcx, [rsp + 0x48]
call fcn.18005ecc0
mov rax, qword [rsp + 0x48]
cmp byte [rax + 0x19], r15b
je 0x18005bfb0
mov r14, qword [rsp + 0x90]
mov rdi, qword [rsp + 0x98]
mov rsi, qword [rsp + 0xc0]
mov rbp, qword [rsp + 0xb8]
mov rbx, qword [rsp + 0xb0]
mov rcx, qword [rsp + 0x88]
xor rcx, rsp
call fcn.1800c7740
add rsp, 0xa0
pop r15
ret