Function at 0x14000d530
Capabilities:
Get session information

Disassembly:
mov qword [rsp + 0x10], rbx
mov qword [rsp + 0x18], rsi
push rbp
push rdi
push r14
mov rbp, rsp
sub rsp, 0x70
mov rax, qword [0x140048010]
xor rax, rsp
mov qword [rbp - 0x10], rax
xor esi, esi
mov rdi, rcx
mov ebx, esi
mov qword [rbp - 0x40], rsi
call qword [sym.imp.KERNEL32.dll_WTSGetActiveConsoleSessionId]
mov dword [rbp - 0x18], eax
call qword [sym.imp.KERNEL32.dll_GetCurrentProcess]
mov rcx, rax
lea r8, [rbp - 0x40]
lea edx, [rsi + 0x28]
call qword [sym.imp.ADVAPI32.dll_OpenProcessToken]
test eax, eax
jne 0x14000d587
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, dword [rbp - 0x18]
lea rax, [rbp - 0x14]
lea r9, [rbp - 0x38]
mov qword [rsp + 0x20], rax
mov r8d, 8
xor ecx, ecx
call qword [sym.imp.WTSAPI32.dll_WTSQuerySessionInformationW]
test eax, eax
jne 0x14000d5af
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, dword [0x14004ab5c]
mov r14d, 1
test ecx, ecx
jne 0x14000d5dc
mov rax, qword [rbp - 0x38]
mov ecx, 4
cmp dword [rax], ebx
cmovne ecx, r14d
mov dword [0x14004ab5c], ecx
test ecx, ecx
je 0x14000d8f2
cmp ecx, 3
jbe 0x14000d779
cmp ecx, 6
ja 0x14000d8f2
mov qword [rbp - 0x30], rsi
call qword [sym.imp.KERNEL32.dll_GetCurrentProcess]
lea r8, [rbp - 0x40]
mov edx, 0x12f
mov rcx, rax
call qword [sym.imp.ADVAPI32.dll_OpenProcessToken]
test eax, eax
je 0x14000d758
lea r8, [rbp - 0x24]
xor ecx, ecx
lea rdx, str.SeTcbPrivilege
call qword [sym.imp.ADVAPI32.dll_LookupPrivilegeValueW]
test eax, eax
je 0x14000d758
mov rcx, qword [rbp - 0x40]
lea r8, [rbp - 0x28]
mov qword [rsp + 0x28], rsi
xor r9d, r9d
xor edx, edx
mov qword [rsp + 0x20], rsi
mov dword [rbp - 0x28], r14d
mov dword [rbp - 0x1c], 2
call qword [sym.imp.ADVAPI32.dll_AdjustTokenPrivileges]
test eax, eax
je 0x14000d758
mov rcx, qword [rbp - 0x40]
lea rax, [rbp - 0x30]
mov qword [rsp + 0x28], rax
mov r9d, 2
xor r8d, r8d
mov dword [rsp + 0x20], r14d
mov edx, 0x2000000
call qword [sym.imp.ADVAPI32.dll_DuplicateTokenEx]
test eax, eax
je 0x14000d758
lea r8, [rbp - 0x24]
xor ecx, ecx
lea rdx, str.SeTakeOwnershipPrivilege
call qword [sym.imp.ADVAPI32.dll_LookupPrivilegeValueW]
test eax, eax
je 0x14000d758
mov rcx, qword [rbp - 0x40]
lea r8, [rbp - 0x28]
mov qword [rsp + 0x28], rsi
xor r9d, r9d
xor edx, edx
mov qword [rsp + 0x20], rsi
mov dword [rbp - 0x28], r14d
mov dword [rbp - 0x1c], 2
call qword [sym.imp.ADVAPI32.dll_AdjustTokenPrivileges]
test eax, eax
je 0x14000d758
lea r8, [rbp - 0x24]
xor ecx, ecx
lea rdx, str.SeIncreaseQuotaPrivilege
call qword [sym.imp.ADVAPI32.dll_LookupPrivilegeValueW]
test eax, eax
je 0x14000d758
mov rcx, qword [rbp - 0x40]
lea r8, [rbp - 0x28]
mov qword [rsp + 0x28], rsi
xor r9d, r9d
xor edx, edx
mov qword [rsp + 0x20], rsi
mov dword [rbp - 0x28], r14d
mov dword [rbp - 0x1c], 2
call qword [sym.imp.ADVAPI32.dll_AdjustTokenPrivileges]
test eax, eax
je 0x14000d758
lea r8, [rbp - 0x24]
xor ecx, ecx
lea rdx, str.SeAssignPrimaryTokenPrivilege
call qword [sym.imp.ADVAPI32.dll_LookupPrivilegeValueW]
test eax, eax
je 0x14000d758
mov rcx, qword [rbp - 0x40]
lea r8, [rbp - 0x28]
mov qword [rsp + 0x28], rsi
xor r9d, r9d
xor edx, edx
mov qword [rsp + 0x20], rsi
mov dword [rbp - 0x28], r14d
mov dword [rbp - 0x1c], 2
call qword [sym.imp.ADVAPI32.dll_AdjustTokenPrivileges]
mov ecx, dword [rbp - 0x18]
mov rdx, rdi
call qword [sym.imp.WTSAPI32.dll_WTSQueryUserToken]
mov ebx, eax
test eax, eax
jne 0x14000d8f2
call qword [sym.imp.KERNEL32.dll_GetLastError]
jmp 0x14000d8f2
call qword [sym.imp.KERNEL32.dll_GetCurrentProcess]
lea r8, [rbp - 0x40]
mov edx, 0x12f
mov rcx, rax
call qword [sym.imp.ADVAPI32.dll_OpenProcessToken]
test eax, eax
je 0x14000d8db
lea r8, [rbp - 0x24]
xor ecx, ecx
lea rdx, str.SeTcbPrivilege
call qword [sym.imp.ADVAPI32.dll_LookupPrivilegeValueW]
test eax, eax
je 0x14000d8db
mov rcx, qword [rbp - 0x40]
lea r8, [rbp - 0x28]
mov qword [rsp + 0x28], rsi
xor r9d, r9d
xor edx, edx
mov qword [rsp + 0x20], rsi
mov dword [rbp - 0x28], r14d
mov dword [rbp - 0x1c], 2
call qword [sym.imp.ADVAPI32.dll_AdjustTokenPrivileges]
test eax, eax
je 0x14000d8db
mov rcx, qword [rbp - 0x40]
mov r9d, 2
mov qword [rsp + 0x28], rdi
xor r8d, r8d
mov edx, 0x2000000
mov dword [rsp + 0x20], r14d
call qword [sym.imp.ADVAPI32.dll_DuplicateTokenEx]
test eax, eax
je 0x14000d8db
lea r8, [rbp - 0x24]
xor ecx, ecx
lea rdx, str.SeTakeOwnershipPrivilege
call qword [sym.imp.ADVAPI32.dll_LookupPrivilegeValueW]
test eax, eax
je 0x14000d8db
mov rcx, qword [rbp - 0x40]
lea r8, [rbp - 0x28]
mov qword [rsp + 0x28], rsi
xor r9d, r9d
xor edx, edx
mov qword [rsp + 0x20], rsi
mov dword [rbp - 0x28], r14d
mov dword [rbp - 0x1c], 2
call qword [sym.imp.ADVAPI32.dll_AdjustTokenPrivileges]
test eax, eax
je 0x14000d8db
lea r8, [rbp - 0x24]
xor ecx, ecx
lea rdx, str.SeIncreaseQuotaPrivilege
call qword [sym.imp.ADVAPI32.dll_LookupPrivilegeValueW]
test eax, eax
je 0x14000d8db
mov rcx, qword [rbp - 0x40]
lea r8, [rbp - 0x28]
mov qword [rsp + 0x28], rsi
xor r9d, r9d
xor edx, edx
mov qword [rsp + 0x20], rsi
mov dword [rbp - 0x28], r14d
mov dword [rbp - 0x1c], 2
call qword [sym.imp.ADVAPI32.dll_AdjustTokenPrivileges]
test eax, eax
je 0x14000d8db
lea r8, [rbp - 0x24]
xor ecx, ecx
lea rdx, str.SeAssignPrimaryTokenPrivilege
call qword [sym.imp.ADVAPI32.dll_LookupPrivilegeValueW]
test eax, eax
je 0x14000d8db
mov rcx, qword [rbp - 0x40]
lea r8, [rbp - 0x28]
mov qword [rsp + 0x28], rsi
xor r9d, r9d
xor edx, edx
mov qword [rsp + 0x20], rsi
mov dword [rbp - 0x28], r14d
mov dword [rbp - 0x1c], 2
call qword [sym.imp.ADVAPI32.dll_AdjustTokenPrivileges]
mov rcx, qword [rdi]
lea r8, [rbp - 0x18]
mov r9d, 4
lea edx, [r9 + 8]
call qword [sym.imp.ADVAPI32.dll_SetTokenInformation]
mov rcx, qword [rbp - 0x40]
test rcx, rcx
je 0x14000d901
call qword [sym.imp.KERNEL32.dll_CloseHandle]
test ebx, ebx
je 0x14000d915
mov rcx, qword [rdi]
call qword [sym.imp.ADVAPI32.dll_ImpersonateLoggedOnUser]
test eax, eax
mov eax, r14d
jne 0x14000d917
mov eax, esi
mov rcx, qword [rbp - 0x10]
xor rcx, rsp
call fcn.1400109a0
lea r11, [rsp + 0x70]
mov rbx, qword [r11 + 0x28]
mov rsi, qword [r11 + 0x30]
mov rsp, r11
pop r14
pop rdi
pop rbp
ret