Function at 0x1400014d0
Capabilities:
Acquire debug privileges

Disassembly:
push rbp
push rbx
push rsi
push rdi
push r12
push r14
push r15
lea rbp, [rsp - 0x27]
sub rsp, 0xa0
mov rax, qword [0x140006008]
xor rax, rsp
mov qword [rbp + 0x17], rax
mov r12, rcx
mov rbx, rdx
mov ecx, 0x1000
xor r14d, r14d
mov edx, 0x108
mov qword [rbp - 0x31], rcx
mov esi, 1
mov qword [rbp - 0x11], r14
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_calloc]
mov dword [r12], r14d
mov rdi, rax
mov qword [rbp - 0x39], rax
mov dword [rbp - 9], r14d
mov qword [rbx], r14
mov qword [rbx + 8], r14
mov qword [rbx + 0x10], r14
mov qword [rbx + 0x18], r14
mov qword [rbx + 0x20], r14
mov qword [rbp - 0x19], r14
call qword [sym.imp.KERNEL32.dll_GetCurrentProcess]
lea r8, [rbp - 0x19]
mov edx, 0x2000000
mov rcx, rax
call qword [sym.imp.ADVAPI32.dll_OpenProcessToken]
test eax, eax
je 0x14000159f
lea r8, [rbp + 3]
xor ecx, ecx
lea rdx, str.SeDebugPrivilege
call qword [sym.imp.ADVAPI32.dll_LookupPrivilegeValueW]
test eax, eax
je 0x14000159f
mov rcx, qword [rbp - 0x19]
lea r8, [rbp - 1]
mov qword [rsp + 0x28], r14
xor r9d, r9d
xor edx, edx
mov qword [rsp + 0x20], r14
mov dword [rbp + 0xb], 2
mov dword [rbp - 1], esi
call qword [sym.imp.ADVAPI32.dll_AdjustTokenPrivileges]
test eax, eax
jne 0x1400015a5
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov rcx, qword [rbp - 0x19]
test rcx, rcx
je 0x1400015b4
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov qword [rbp - 0x19], r14
call qword [sym.imp.KERNEL32.dll_GetCurrentProcess]
lea r8, [rbp - 0x19]
mov edx, 0x2000000
mov rcx, rax
call qword [sym.imp.ADVAPI32.dll_OpenProcessToken]
test eax, eax
je 0x140001616
lea r8, [rbp + 3]
xor ecx, ecx
lea rdx, str.SeAssignPrimaryTokenPrivilege
call qword [sym.imp.ADVAPI32.dll_LookupPrivilegeValueW]
test eax, eax
je 0x140001616
mov rcx, qword [rbp - 0x19]
lea r8, [rbp - 1]
mov qword [rsp + 0x28], r14
xor r9d, r9d
xor edx, edx
mov qword [rsp + 0x20], r14
mov dword [rbp + 0xb], 2
mov dword [rbp - 1], esi
call qword [sym.imp.ADVAPI32.dll_AdjustTokenPrivileges]
test eax, eax
jne 0x14000161c
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov rcx, qword [rbp - 0x19]
test rcx, rcx
je 0x14000162b
call qword [sym.imp.KERNEL32.dll_CloseHandle]
call qword [sym.imp.KERNEL32.dll_GetCurrentProcess]
lea r8, [rbp - 0x29]
mov edx, 0x10000000
mov rcx, rax
call qword [sym.imp.ADVAPI32.dll_OpenProcessToken]
mov rcx, qword [rbp - 0x29]
call fcn.140002570
lea rcx, str.NTDLL.DLL
call qword [sym.imp.KERNEL32.dll_GetModuleHandleW]
mov rcx, rax
lea rdx, str.NtQuerySystemInformation
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
lea rcx, str.NTDLL.DLL
mov qword [0x140006638], rax
call qword [sym.imp.KERNEL32.dll_GetModuleHandleW]
mov rcx, rax
lea rdx, str.NtQueryObject
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov ecx, 0x3e800
mov dword [rbp - 0x21], 0x3e800
mov qword [0x140006640], rax
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_malloc]
mov r8d, dword [rbp - 0x21]
lea r9, [rbp - 0x21]
mov rdx, rax
mov ecx, 5
mov r15, rax
call qword [0x140006638]
cmp eax, 0xc0000004
jne 0x1400016f8
mov rcx, r15
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov ecx, dword [rbp - 0x21]
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_malloc]
mov r8d, dword [rbp - 0x21]
lea r9, [rbp - 0x21]
mov rdx, rax
mov ecx, 5
mov r15, rax
call qword [0x140006638]
cmp eax, 0xc0000004
je 0x1400016c6
mov rcx, r15
mov qword [rbp - 1], rcx
test eax, eax
jne 0x140001a7b
mov qword [rsp + 0xf0], r13
nop
mov r8d, dword [r15 + 0x50]
xor eax, eax
cmp dword [r15], eax
mov ecx, 0x2000000
cmovne eax, esi
xor edx, edx
mov esi, eax
mov dword [rbp - 0x19], eax
call qword [sym.imp.KERNEL32.dll_OpenProcess]
movsxd rcx, dword [0x140006034]
mov r13, rax
cmp ecx, 0xffffffff
je 0x140001747
cmp qword [r15 + 0x50], rcx
jne 0x140001a5f
xor r14d, r14d
cmp dword [r15 + 0x60], r14d
jbe 0x140001993
cmp r13, 0xffffffffffffffff
je 0x140001983
mov qword [rbp - 0x29], 0
call qword [sym.imp.KERNEL32.dll_GetCurrentProcess]
mov dword [rsp + 0x30], 2
lea edx, [r14*8 + 8]
mov r8, rax
mov dword [rsp + 0x28], 0
lea r9, [rbp - 0x29]
mov dword [rsp + 0x20], 0x2000000
mov rcx, r13
call qword [sym.imp.KERNEL32.dll_DuplicateHandle]
test eax, eax
je 0x140001983
mov rsi, qword [rbp - 0x29]
xor edi, edi
mov dword [rbp - 0x1d], 0x10
lea ecx, [rdi + 0x10]
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_malloc]
mov r9d, dword [rbp - 0x1d]
lea edx, [rdi + 2]
mov rbx, rax
mov rcx, rsi
lea rax, [rbp - 0x1d]
mov r8, rbx
mov qword [rsp + 0x20], rax
call qword [0x140006640]
cmp eax, 0x80000005
je 0x1400017e7
cmp eax, 0xc0000004
jne 0x140001814
mov edx, dword [rbp - 0x1d]
mov rcx, rbx
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_realloc]
mov r9d, dword [rbp - 0x1d]
mov edx, 2
mov rbx, rax
mov rcx, rsi
lea rax, [rbp - 0x1d]
mov r8, rbx
mov qword [rsp + 0x20], rax
call qword [0x140006640]
test eax, eax
js 0x14000183f
cmp qword [rbx + 8], rdi
je 0x14000183f
movzx ecx, word [rbx]
mov edx, 2
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_calloc]
movzx r8d, word [rbx]
mov rcx, rax
mov rdx, qword [rbx + 8]
mov rdi, rax
call sub.VCRUNTIME140.dll_memcpy
mov rcx, rbx
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
test rdi, rdi
je 0x140001975
xor ecx, ecx
lea rdx, str.Token
nop word [rax + rax]
movzx eax, word [rdi + rcx*2]
inc rcx
cmp ax, word [rdx + rcx*2 - 2]
jne 0x140001975
cmp rcx, 6
jne 0x140001860
mov rcx, qword [rbp - 0x29]
call qword [sym.imp.ADVAPI32.dll_ImpersonateLoggedOnUser]
test eax, eax
je 0x140001975
call qword [sym.imp.KERNEL32.dll_GetCurrentThread]
lea r9, [rbp - 0x11]
mov edx, 0x2000000
mov rcx, rax
mov r8d, 1
call qword [sym.imp.ADVAPI32.dll_OpenThreadToken]
call qword [sym.imp.ADVAPI32.dll_RevertToSelf]
mov rcx, qword [rbp - 0x11]
call fcn.1400024c0
test eax, eax
je 0x140001965
mov rbx, qword [rbp - 0x31]
cmp dword [r12], ebx
jb 0x140001901
add ebx, ebx
mov rcx, 0xffffffffffffffff
mov eax, 0x108
mov qword [rbp - 0x31], rbx
mul rbx
cmovo rax, rcx
mov rcx, qword [rbp - 0x39]
mov rdx, rax
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_realloc]
mov qword [rbp - 0x39], rax
mov rdi, rax
test rax, rax
je 0x140001a6f
jmp 0x140001905
mov rdi, qword [rbp - 0x39]
mov eax, dword [r12]
imul rcx, rax, 0x108
mov rax, qword [rbp - 0x29]
mov qword [rcx + rdi + 0x100], rax
mov eax, dword [r12]
mov rcx, qword [rbp - 0x29]
imul rdx, rax, 0x108
add rdx, rdi
call fcn.140002330
mov rcx, qword [rbp - 0x29]
lea rax, [rbp - 9]
mov r9d, 4
mov qword [rsp + 0x20], rax
lea r8, [rbp + 0xf]
lea edx, [r9 + 4]
call qword [sym.imp.ADVAPI32.dll_GetTokenInformation]
mov rcx, qword [rbp - 0x11]
add dword [r12], 2
call qword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x140001983
mov rcx, qword [rbp - 0x11]
mov rdi, qword [rbp - 0x39]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x140001983
mov rcx, qword [rbp - 0x29]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov rdi, qword [rbp - 0x39]
inc r14d
cmp r14d, dword [r15 + 0x60]
jb 0x140001754
mov esi, dword [rbp - 0x19]
mov r8d, dword [r15 + 0x50]
xor edx, edx
mov ecx, 0x2000000
call qword [sym.imp.KERNEL32.dll_OpenProcess]
lea r8, [rbp - 0x29]
mov edx, 0x2000000
mov rcx, rax
call qword [sym.imp.ADVAPI32.dll_OpenProcessToken]
test eax, eax
je 0x140001a5f
mov rcx, qword [rbp - 0x29]
call qword [sym.imp.ADVAPI32.dll_ImpersonateLoggedOnUser]
test eax, eax
je 0x140001a5f
call qword [sym.imp.KERNEL32.dll_GetCurrentThread]
lea r9, [rbp - 0x11]
mov edx, 0x2000000
mov rcx, rax
mov r8d, 1
call qword [sym.imp.ADVAPI32.dll_OpenThreadToken]
call qword [sym.imp.ADVAPI32.dll_RevertToSelf]
mov rcx, qword [rbp - 0x11]
call fcn.1400024c0
test eax, eax
je 0x140001a55
mov eax, dword [r12]
imul rcx, rax, 0x108
mov rax, qword [rbp - 0x29]
mov qword [rcx + rdi + 0x100], rax
mov eax, dword [r12]
mov rcx, qword [rbp - 0x29]
imul rdx, rax, 0x108
add rdx, rdi
call fcn.140002330
mov rcx, qword [rbp - 0x29]
lea rax, [rbp - 9]
mov r9d, 4
mov qword [rsp + 0x20], rax
lea r8, [rbp + 0xf]
lea edx, [r9 + 4]
call qword [sym.imp.ADVAPI32.dll_GetTokenInformation]
add dword [r12], 2
mov rcx, qword [rbp - 0x11]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov rax, r15
mov eax, dword [rax]
add r15, rax
test esi, esi
jne 0x140001710
mov rcx, qword [rbp - 1]
mov r13, qword [rsp + 0xf0]
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov rax, rdi
mov rcx, qword [rbp + 0x17]
xor rcx, rsp
call fcn.140002680
add rsp, 0xa0
pop r15
pop r14
pop r12
pop rdi
pop rsi
pop rbx
pop rbp
ret