Function at 0x140212c00
Capabilities:
Get session information

Disassembly:
mov qword [rsp + 0x10], rbx
mov qword [rsp + 0x18], rsi
mov qword [rsp + 0x20], rdi
push rbp
push r12
push r13
push r14
push r15
lea rbp, [rsp - 0x37]
sub rsp, 0xe0
mov rax, qword [0x140601e40]
xor rax, rsp
mov qword [rbp + 0x27], rax
mov rsi, rcx
mov qword [rbp - 0x29], rcx
xor edi, edi
mov r14d, edi
mov dword [rbp - 0x75], edi
mov dword [rbp - 0x51], edi
mov qword [rbp - 0x49], rdi
lea rax, [rbp - 0x51]
mov qword [rsp + 0x20], rax
lea r9, [rbp - 0x49]
xor edx, edx
xor ecx, ecx
lea r8d, [rdi + 1]
call sub.WTSAPI32.dll_WTSEnumerateSessionsW
test eax, eax
jne 0x140212d33
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, eax
lea rcx, [rbp - 0x19]
call fcn.1402129d0
nop
mov r8, rax
lea rdx, str.enumerate_sessions__error:___
lea rcx, [rbp + 7]
call fcn.140187e90
nop
mov qword [rbp - 0x61], rsi
mov qword [rbp - 0x71], rsi
mov qword [rbp - 0x59], rsi
xorps xmm0, xmm0
movups xmmword [rsi], xmm0
mov qword [rsi + 0x10], rdi
mov qword [rsi + 0x18], rdi
movups xmm0, xmmword [rax]
movups xmmword [rsi], xmm0
movups xmm1, xmmword [rax + 0x10]
movups xmmword [rsi + 0x10], xmm1
mov qword [rax + 0x10], rdi
mov qword [rax + 0x18], reloc.WS2_32.dll_ntohs
mov byte [rax], dil
mov byte [rsi + 0x20], 1
mov byte [rsi + 0x28], dil
mov dword [rbp - 0x75], 1
lea rcx, [rbp + 7]
call fcn.140021b50
nop
mov rdx, qword [rbp - 1]
cmp rdx, 0xf
jbe 0x140212d17
inc rdx
mov rcx, qword [rbp - 0x19]
cmp rdx, 0x1000
jb 0x140212d12
add rdx, 0x27
mov r8, qword [rcx - 8]
sub rcx, r8
lea rax, [rcx - 8]
cmp rax, 0x1f
ja 0x140212d2c
mov rcx, r8
call fcn.140283db0
mov qword [rbp - 9], rdi
mov qword [rbp - 1], reloc.WS2_32.dll_ntohs
mov byte [rbp - 0x19], 0
jmp 0x1402132ff
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo_noreturn]
nop
mov ebx, edi
mov dword [rbp - 0x71], ebx
mov byte [rbp - 0x79], bl
mov r12d, edi
cmp dword [rbp - 0x51], edi
jle 0x140212ebb
mov r13, rdi
nop word [rax + rax]
mov qword [rbp - 0x61], rdi
mov dword [rbp - 0x59], edi
mov rax, qword [rbp - 0x49]
mov r15d, dword [rax + r13]
lea rax, [rbp - 0x59]
mov qword [rsp + 0x20], rax
lea r9, [rbp - 0x61]
mov r8d, 8
mov edx, r15d
xor ecx, ecx
call sub.WTSAPI32.dll_WTSQuerySessionInformationW
test eax, eax
jne 0x140212e94
mov rbx, qword [0x140627790]
test rbx, rbx
je 0x140212ea7
mov rax, qword [rbx]
mov rcx, rbx
call qword [rax + 0x30]
test al, al
je 0x140212ea7
call qword [sym.imp.KERNEL32.dll_GetLastError]
nop
mov r8d, 0x400
mov edx, eax
lea rcx, [rbp - 0x19]
call fcn.140212a10
or r14d, 2
mov dword [rbp - 0x75], r14d
lea r8, [rbp - 0x19]
lea rdx, str.Failed_to_query_session_information__error:___
lea rcx, [rbp + 7]
call fcn.1400267c0
nop
and r14d, 0xfffffffd
mov dword [rbp - 0x75], r14d
mov rdx, qword [rbp - 1]
cmp rdx, 0xf
jbe 0x140212e1d
inc rdx
mov rcx, qword [rbp - 0x19]
cmp rdx, 0x1000
jb 0x140212e18
add rdx, 0x27
mov r8, qword [rcx - 8]
sub rcx, r8
lea rax, [rcx - 8]
cmp rax, 0x1f
ja 0x140212fa1
mov rcx, r8
call fcn.140283db0
mov qword [rbp - 9], rdi
mov qword [rbp - 1], reloc.WS2_32.dll_ntohs
mov byte [rbp - 0x19], 0
mov rax, qword [rbx]
lea r9, [rbp + 7]
lea r8, str.eax::WinUtils::getUserImpersonationToken
mov edx, 1
mov rcx, rbx
call qword [rax + gethostname]
nop
mov rdx, qword [rbp + 0x1f]
cmp rdx, 0xf
jbe 0x140212e82
inc rdx
mov rcx, qword [rbp + 7]
cmp rdx, 0x1000
jb 0x140212e7d
add rdx, 0x27
mov r8, qword [rcx - 8]
sub rcx, r8
lea rax, [rcx - 8]
cmp rax, 0x1f
ja 0x140212fa8
mov rcx, r8
call fcn.140283db0
mov qword [rbp + 0x17], rdi
mov qword [rbp + 0x1f], reloc.WS2_32.dll_ntohs
mov byte [rbp + 7], 0
jmp 0x140212ea7
mov rcx, qword [rbp - 0x61]
mov ebx, dword [rcx]
call sub.WTSAPI32.dll_WTSFreeMemory
test ebx, ebx
je 0x140212faf
inc r12d
add r13, 0x18
cmp r12d, dword [rbp - 0x51]
jl 0x140212d50
mov ebx, dword [rbp - 0x71]
mov rcx, qword [rbp - 0x49]
call sub.WTSAPI32.dll_WTSFreeMemory
cmp byte [rbp - 0x79], 0
jne 0x140212fbb
xorps xmm0, xmm0
movups xmmword [rbp + 7], xmm0
mov qword [rbp + 0x17], rdi
mov qword [rbp + 0x1f], rdi
mov ecx, 0x20
call fcn.140283d70
mov qword [rbp + 7], rax
mov qword [rbp + 0x17], 0x1a
mov qword [rbp + 0x1f], 0x1f
movups xmm0, xmmword [str.no_session_for_active_user]
movups xmmword [rax], xmm0
movsd xmm0, qword [0x1404722d8]
movsd qword [rax + 0x10], xmm0
movzx ecx, word [0x1404722e0]
mov word [rax + 0x18], cx
mov byte [rax + 0x1a], 0
mov qword [rbp - 9], rdi
mov qword [rbp - 1], rdi
movups xmm2, xmmword [rbp + 7]
movups xmmword [rbp - 0x19], xmm2
movups xmm1, xmmword [rbp + 0x17]
movups xmmword [rbp - 9], xmm1
mov qword [rbp + 0x17], rdi
mov qword [rbp + 0x1f], reloc.WS2_32.dll_ntohs
mov byte [rbp + 7], 0
or r14d, 4
mov dword [rbp - 0x75], r14d
mov qword [rbp + 0x17], rdi
mov qword [rbp + 0x1f], reloc.WS2_32.dll_ntohs
mov byte [rbp + 7], 0
mov qword [rbp - 0x61], rsi
mov qword [rbp - 0x71], rsi
mov qword [rbp - 0x59], rsi
movups xmmword [rsi], xmm2
movups xmmword [rsi + 0x10], xmm1
mov qword [rbp - 9], rdi
mov qword [rbp - 1], reloc.WS2_32.dll_ntohs
mov byte [rbp - 0x19], 0
mov byte [rsi + 0x20], 1
mov byte [rsi + 0x28], 0
or r14d, 1
mov dword [rbp - 0x75], r14d
and r14d, 0xfffffffb
mov dword [rbp - 0x75], r14d
jmp 0x140212d17
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo_noreturn]
nop
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo_noreturn]
int3
mov ebx, r15d
mov byte [rbp - 0x79], 1
jmp 0x140212ebb
mov qword [rbp - 0x69], 0xffffffffffffffff
lea rdx, [rbp - 0x69]
mov ecx, ebx
call sub.WTSAPI32.dll_WTSQueryUserToken
test eax, eax
jne 0x1402130a0
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, eax
lea rcx, [rbp - 0x19]
call fcn.1402129d0
nop
mov r8, rax
lea rdx, str.query_user_token__error:___
lea rcx, [rbp + 7]
call fcn.140187e90
nop
mov qword [rbp - 0x61], rsi
mov qword [rbp - 0x71], rsi
mov qword [rbp - 0x59], rsi
xorps xmm0, xmm0
movups xmmword [rsi], xmm0
mov qword [rsi + 0x10], rdi
mov qword [rsi + 0x18], rdi
movups xmm0, xmmword [rax]
movups xmmword [rsi], xmm0
movups xmm1, xmmword [rax + 0x10]
movups xmmword [rsi + 0x10], xmm1
mov qword [rax + 0x10], rdi
mov qword [rax + 0x18], reloc.WS2_32.dll_ntohs
mov byte [rax], 0
mov byte [rsi + 0x20], 1
mov byte [rsi + 0x28], 0
or r14d, 1
mov dword [rbp - 0x75], r14d
lea rcx, [rbp + 7]
call fcn.140021b50
nop
mov rdx, qword [rbp - 1]
cmp rdx, 0xf
jbe 0x14021308b
inc rdx
mov rcx, qword [rbp - 0x19]
cmp rdx, 0x1000
jb 0x140213086
add rdx, 0x27
mov r8, qword [rcx - 8]
sub rcx, r8
lea rax, [rcx - 8]
cmp rax, 0x1f
jbe 0x140213083
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo_noreturn]
int3
mov rcx, r8
call fcn.140283db0
mov qword [rbp - 9], rdi
mov qword [rbp - 1], reloc.WS2_32.dll_ntohs
mov byte [rbp - 0x19], 0
jmp 0x1402132e3
mov qword [rbp - 0x41], rdi
mov dword [rbp - 0x4d], edi
lea rax, [rbp - 0x4d]
mov qword [rsp + 0x20], rax
mov r9d, 8
lea r8, [rbp - 0x41]
lea edx, [r9 + 0xb]
mov rcx, qword [rbp - 0x69]
call qword [sym.imp.ADVAPI32.dll_GetTokenInformation]
test eax, eax
jne 0x140213189
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, eax
lea rcx, [rbp - 0x19]
call fcn.1402129d0
nop
mov r8, rax
lea rdx, str.get_linked_token__error:___
lea rcx, [rbp + 7]
call fcn.140187e90
nop
mov qword [rbp - 0x61], rsi
mov qword [rbp - 0x71], rsi
mov qword [rbp - 0x59], rsi
xorps xmm0, xmm0
movups xmmword [rsi], xmm0
mov qword [rsi + 0x10], rdi
mov qword [rsi + 0x18], rdi
movups xmm0, xmmword [rax]
movups xmmword [rsi], xmm0
movups xmm1, xmmword [rax + 0x10]
movups xmmword [rsi + 0x10], xmm1
mov qword [rax + 0x10], rdi
mov qword [rax + 0x18], reloc.WS2_32.dll_ntohs
mov byte [rax], 0
mov byte [rsi + 0x20], 1
mov byte [rsi + 0x28], 0
or r14d, 1
mov dword [rbp - 0x75], r14d
lea rcx, [rbp + 7]
call fcn.140021b50
nop
mov rdx, qword [rbp - 1]
cmp rdx, 0xf
jbe 0x14021308b
inc rdx
mov rcx, qword [rbp - 0x19]
cmp rdx, 0x1000
jb 0x140213086
add rdx, 0x27
mov r8, qword [rcx - 8]
sub rcx, r8
lea rax, [rcx - 8]
cmp rax, 0x1f
jbe 0x140213083
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo_noreturn]
int3
mov rbx, qword [rbp - 0x41]
mov qword [rbp - 0x61], rbx
mov qword [rbp - 0x39], rdi
lea rax, [rbp - 0x39]
mov qword [rsp + 0x28], rax
mov dword [rsp + 0x20], 1
mov r9d, 2
xor r8d, r8d
mov edx, 0x20f01ff
mov rcx, rbx
call qword [sym.imp.ADVAPI32.dll_DuplicateTokenEx]
test eax, eax
jne 0x140213265
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, eax
lea rcx, [rbp - 0x19]
call fcn.1402129d0
nop
mov r8, rax
lea rdx, str.duplicate_token__error:___
lea rcx, [rbp + 7]
call fcn.140187e90
nop
mov qword [rbp - 0x71], rsi
mov qword [rbp - 0x59], rsi
mov qword [rbp - 0x31], rsi
xorps xmm0, xmm0
movups xmmword [rsi], xmm0
mov qword [rsi + 0x10], rdi
mov qword [rsi + 0x18], rdi
movups xmm0, xmmword [rax]
movups xmmword [rsi], xmm0
movups xmm1, xmmword [rax + 0x10]
movups xmmword [rsi + 0x10], xmm1
mov qword [rax + 0x10], rdi
mov qword [rax + 0x18], reloc.WS2_32.dll_ntohs
mov byte [rax], 0
mov byte [rsi + 0x20], 1
mov byte [rsi + 0x28], 0
or r14d, 1
mov dword [rbp - 0x75], r14d
lea rcx, [rbp + 7]
call fcn.140021b50
nop
mov r8, qword [rbp - 1]
cmp r8, 0xf
jbe 0x140213253
mov rdx, qword [rbp - 0x19]
lea rcx, [rbp - 0x19]
call fcn.1400218f0
mov qword [rbp - 9], rdi
mov qword [rbp - 1], reloc.WS2_32.dll_ntohs
mov byte [rbp - 0x19], 0
jmp 0x1402132c7
mov rax, qword [rbp - 0x39]
mov qword [rbp - 0x71], rax
lea rdx, [rbp - 0x71]
lea rcx, [rbp - 0x59]
call fcn.140212060
nop
mov qword [rbp - 0x31], rsi
mov qword [rbp - 0x21], rsi
mov rcx, qword [rax]
mov qword [rax], 0xffffffffffffffff
mov qword [rsi], rcx
mov byte [rsi + 0x20], 0
mov byte [rsi + 0x28], 0
or r14d, 1
mov dword [rbp - 0x75], r14d
lea rcx, [rbp - 0x59]
call fcn.140212990
nop
mov rcx, qword [rbp - 0x71]
lea rax, [rcx - 1]
cmp rax, 0xfffffffffffffffd
ja 0x1402132c7
mov qword [rbp - 0x71], 0xffffffffffffffff
call qword [sym.imp.KERNEL32.dll_CloseHandle]
nop
lea rax, [rbx - 1]
cmp rax, 0xfffffffffffffffd
ja 0x1402132e3
mov qword [rbp - 0x61], 0xffffffffffffffff
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_CloseHandle]
nop
mov rcx, qword [rbp - 0x69]
lea rax, [rcx - 1]
cmp rax, 0xfffffffffffffffd
ja 0x1402132ff
mov qword [rbp - 0x69], 0xffffffffffffffff
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov rax, rsi
mov rcx, qword [rbp + 0x27]
xor rcx, rsp
call fcn.140284180
lea r11, [rsp + 0xe0]
mov rbx, qword [r11 + 0x38]
mov rsi, qword [r11 + 0x40]
mov rdi, qword [r11 + 0x48]
mov rsp, r11
pop r15
pop r14
pop r13
pop r12
pop rbp
ret