Function at 0x140047788
Capabilities:
Get session information
Get session user name

Disassembly:
mov rax, rsp
push rbp
push r12
push r13
push r14
push r15
lea rbp, [rax - 0x5f]
sub rsp, 0x100
mov qword [rbp - 0x71], 0xfffffffffffffffe
mov qword [rax + 0x10], rbx
mov qword [rax + 0x18], rsi
mov qword [rax + 0x20], rdi
mov rax, qword [0x1400c2270]
xor rax, rsp
mov qword [rbp + 0x2f], rax
mov r15, rcx
xor r12d, r12d
mov qword [rsp + 0x40], r12
mov dword [rsp + 0x34], r12d
lea rax, [rsp + 0x34]
mov qword [rsp + 0x20], rax
lea r9, [rsp + 0x40]
lea r13d, [r12 + 1]
mov r8d, r13d
xor edx, edx
xor ecx, ecx
call qword [sym.imp.WTSAPI32.dll_WTSEnumerateSessionsW]
test eax, eax
jne 0x140047845
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov ebx, eax
test byte [0x1400c3100], 8
je 0x14004781d
mov r8d, eax
lea rdx, [0x1400904d8]
mov rcx, qword [0x1400c3148]
call fcn.14000f534
test byte [0x1400c3340], 8
je 0x140047d96
mov r8d, ebx
lea rdx, [0x1400904d8]
mov rcx, qword [0x1400c3348]
call fcn.14000f534
jmp 0x140047d96
mov rbx, qword [rsp + 0x40]
mov ecx, reloc.OLEAUT32.dll_SafeArrayGetElement
call fcn.140065784
mov qword [rsp + 0x38], rax
lea rcx, vtable.appv::utility::scope_guard_func_impl_class_std::_Binder_struct_std::_Unforced__void____cdecl___void____ptr64___struct__WTS_SESSION_INFOW____ptr64____ptr64__.0
mov qword [rax], rcx
mov rcx, qword [sym.imp.WTSAPI32.dll_WTSFreeMemory]
mov qword [rax + 8], rcx
mov qword [rax + 0x10], rbx
mov qword [rbp - 0x79], rax
mov qword [rsp + 0x48], r12
mov dword [rsp + 0x30], r12d
mov r14d, r12d
cmp dword [rsp + 0x34], r12d
jbe 0x140047d8d
mov ebx, 7
mov eax, r14d
lea rsi, [rax + rax*2]
mov rax, qword [rsp + 0x40]
mov ecx, dword [rax + rsi*8 + 0x10]
test ecx, ecx
je 0x1400479c3
call fcn.140049c08
mov qword [rsp + 0x38], rax
mov qword [rbp - 0x39], r12
mov qword [rbp - 0x31], rbx
mov word [rbp - 0x49], r12w
mov r8d, 0x4b
lea rdx, str.UserManager_processing_existing_logons__ignoring_session__1__in_state__2_
lea rcx, [rbp - 0x49]
call fcn.1400030f0
nop
mov qword [rbp - 0x59], r12
mov qword [rbp - 0x51], rbx
mov word [rbp - 0x69], r12w
mov r8d, 6
lea rdx, str.Client
lea rcx, [rbp - 0x69]
call fcn.1400030f0
nop
call fcn.140007558
lea r8, [rbp - 0x49]
lea rdx, [rbp - 1]
call fcn.14003a428
mov rbx, rax
lea rdx, str.AppV::Client::Host::UserManagerImpl::EnumSessions
lea rcx, [rbp - 0x29]
call fcn.14003a658
mov dword [rbp - 9], SysAllocStringByteLen
mov rcx, qword [rsp + 0x40]
lea rdx, [rcx + rsi*8]
mov rcx, rbx
call fcn.140009520
lea rdx, [rsp + 0x38]
mov rcx, rbx
call fcn.14000edac
mov r9, rbx
lea r8, [rbp - 0x69]
mov edx, 4
lea rcx, [rbp - 0x29]
call fcn.14003a5d4
nop
mov rdx, qword [rbp - 0x11]
cmp rdx, 0x10
jb 0x140047977
inc rdx
mov r8, r13
mov rcx, qword [rbp - 0x29]
call fcn.140002ec0
nop
lea rcx, [rbp - 1]
call fcn.14003ace4
nop
mov rdx, qword [rbp - 0x51]
cmp rdx, 8
jb 0x14004799e
inc rdx
mov r8d, 2
mov rcx, qword [rbp - 0x69]
call fcn.140002ec0
nop
mov rdx, qword [rbp - 0x31]
cmp rdx, 8
jb 0x140047d7a
mov rcx, qword [rbp - 0x49]
mov r8d, 2
inc rdx
call fcn.140002ec0
jmp 0x140047d7a
mov qword [rsp + 0x48], r12
mov dword [rsp + 0x30], r12d
mov edi, 5
mov dword [rsp + 0x38], edi
lea rcx, [rsp + 0x30]
mov qword [rsp + 0x20], rcx
lea r9, [rsp + 0x48]
lea r8d, [rdi + 3]
mov edx, dword [rax + rsi*8]
xor ecx, ecx
call qword [sym.imp.WTSAPI32.dll_WTSQuerySessionInformationW]
test eax, eax
je 0x140047a67
mov eax, dword [rsp + 0x30]
mov rbx, qword [rsp + 0x48]
test rax, rax
je 0x140047a59
test rbx, rbx
je 0x140047a27
cmp rax, 4
ja 0x140047a27
mov r8d, eax
mov rdx, rbx
lea rcx, [rsp + 0x38]
call sub.api_ms_win_crt_private_l1_1_0.dll_memcpy
mov edi, dword [rsp + 0x38]
jmp 0x140047a59
xor edi, edi
test rbx, rbx
jne 0x140047a3c
call qword [sym.imp.api_ms_win_crt_private_l1_1_0.dll__o__errno]
mov dword [rax], SafeArrayUnaccessData
jmp 0x140047a4e
cmp rax, 4
jbe 0x140047a59
call qword [sym.imp.api_ms_win_crt_private_l1_1_0.dll__o__errno]
mov dword [rax], 0x22
call qword [sym.imp.api_ms_win_crt_private_l1_1_0.dll__o__invalid_parameter_noinfo]
mov rbx, qword [rsp + 0x48]
mov rcx, rbx
call qword [sym.imp.WTSAPI32.dll_WTSFreeMemory]
mov ebx, 7
test edi, edi
je 0x140047b7b
mov ecx, edi
call fcn.140049c08
mov qword [rsp + 0x38], rax
mov qword [rbp - 0x59], r12
mov qword [rbp - 0x51], rbx
mov word [rbp - 0x69], r12w
mov r8d, 0x4b
lea rdx, str.UserManager_processing_existing_logons__ignoring_session__1__in_state__2_
lea rcx, [rbp - 0x69]
call fcn.1400030f0
nop
mov qword [rbp - 0x39], r12
mov qword [rbp - 0x31], rbx
mov word [rbp - 0x49], r12w
mov r8d, 6
lea rdx, str.Client
lea rcx, [rbp - 0x49]
call fcn.1400030f0
nop
call fcn.140007558
lea r8, [rbp - 0x69]
lea rdx, [rbp - 1]
call fcn.14003a428
mov rbx, rax
lea rdx, str.AppV::Client::Host::UserManagerImpl::EnumSessions
lea rcx, [rbp - 0x29]
call fcn.14003a658
mov dword [rbp - 9], 0xa9
mov rcx, qword [rsp + 0x40]
lea rdx, [rcx + rsi*8]
mov rcx, rbx
call fcn.140009520
lea rdx, [rsp + 0x38]
mov rcx, rbx
call fcn.14000edac
mov r9, rbx
lea r8, [rbp - 0x49]
mov edx, 4
lea rcx, [rbp - 0x29]
call fcn.14003a5d4
nop
mov rdx, qword [rbp - 0x11]
cmp rdx, 0x10
jb 0x140047b3d
inc rdx
mov r8, r13
mov rcx, qword [rbp - 0x29]
call fcn.140002ec0
nop
lea rcx, [rbp - 1]
call fcn.14003ace4
nop
mov rdx, qword [rbp - 0x31]
cmp rdx, 8
jb 0x140047b64
inc rdx
mov r8d, 2
mov rcx, qword [rbp - 0x49]
call fcn.140002ec0
nop
mov rdx, qword [rbp - 0x51]
cmp rdx, 8
jb 0x140047d7a
mov rcx, qword [rbp - 0x69]
jmp 0x1400479b0
mov qword [rbp - 0x59], r12
mov qword [rbp - 0x51], rbx
mov word [rbp - 0x69], r12w
mov r8d, 0x40
lea rdx, str.UserManager_processing_existing_logons__found_active_session__1_
lea rcx, [rbp - 0x69]
call fcn.1400030f0
nop
mov qword [rbp - 0x39], r12
mov qword [rbp - 0x31], rbx
mov word [rbp - 0x49], r12w
mov r8d, 6
lea rdx, str.Client
lea rcx, [rbp - 0x49]
call fcn.1400030f0
nop
call fcn.140007558
lea r8, [rbp - 0x69]
lea rdx, [rbp - 1]
call fcn.14003a428
mov rbx, rax
lea rdx, str.AppV::Client::Host::UserManagerImpl::EnumSessions
lea rcx, [rbp - 0x29]
call fcn.14003a658
mov dword [rbp - 9], 0xaf
mov rcx, qword [rsp + 0x40]
lea rdx, [rcx + rsi*8]
mov rcx, rbx
call fcn.140009520
mov r9, rbx
lea r8, [rbp - 0x49]
mov edx, 4
lea rcx, [rbp - 0x29]
call fcn.14003a5d4
nop
mov rdx, qword [rbp - 0x11]
cmp rdx, 0x10
jb 0x140047c30
inc rdx
mov r8, r13
mov rcx, qword [rbp - 0x29]
call fcn.140002ec0
nop
lea rcx, [rbp - 1]
call fcn.14003ace4
nop
mov rdx, qword [rbp - 0x31]
cmp rdx, 8
jb 0x140047c57
inc rdx
mov r8d, 2
mov rcx, qword [rbp - 0x49]
call fcn.140002ec0
nop
mov rdx, qword [rbp - 0x51]
cmp rdx, 8
jb 0x140047c73
inc rdx
mov r8d, 2
mov rcx, qword [rbp - 0x69]
call fcn.140002ec0
mov rax, qword [rsp + 0x40]
mov r8b, r13b
mov edx, dword [rax + rsi*8]
mov rcx, r15
call fcn.140048e1c
mov rbx, rax
mov esi, 0x5c
mov edx, esi
lea rdi, str.admin_appman_appvclienthostcommonusermanagerimpl.cpp
mov rcx, rdi
call qword [sym.imp.api_ms_win_crt_private_l1_1_0.dll_strrchr]
test rax, rax
je 0x140047caa
add rax, r13
jmp 0x140047cad
mov rax, rdi
mov rdx, rax
lea rcx, [0x1400c3688]
call fcn.14000f3ec
movabs rax, 0x8000000000
test rax, rbx
jne 0x140047d7a
mov edx, esi
mov rcx, rdi
call qword [sym.imp.api_ms_win_crt_private_l1_1_0.dll_strrchr]
test rax, rax
je 0x140047ce4
add rax, r13
jmp 0x140047ce7
mov rax, rdi
mov rdx, rax
lea rcx, [0x1400c3688]
call fcn.14000f3ec
movabs rax, 0x2000000000
test rax, rbx
jne 0x140047d7a
mov edx, esi
mov rcx, rdi
call qword [sym.imp.api_ms_win_crt_private_l1_1_0.dll_strrchr]
test rax, rax
je 0x140047d1a
add rax, r13
jmp 0x140047d1d
mov rax, rdi
mov rdx, rax
lea rcx, [0x1400c3688]
call fcn.14000f3ec
shl rax, 0x34
shr rax, 0x20
and al, 0x11
or al, 0xe
mov rcx, rbx
shr rcx, 0x20
and cl, 0x1f
cmp cl, al
jne 0x140047d7a
mov edx, esi
mov rcx, rdi
call qword [sym.imp.api_ms_win_crt_private_l1_1_0.dll_strrchr]
test rax, rax
je 0x140047d5b
add rax, r13
jmp 0x140047d5e
mov rax, rdi
mov rdx, rax
lea rcx, [0x1400c3688]
call fcn.14000f3ec
shl rax, 0x34
or eax, 0x302
cmp ebx, eax
je 0x140047d8d
add r14d, r13d
cmp r14d, dword [rsp + 0x34]
mov ebx, 7
jb 0x140047893
lea rcx, [rbp - 0x79]
call fcn.140005a4c
mov rcx, qword [rbp + 0x2f]
xor rcx, rsp
call fcn.140065760
lea r11, [rsp + 0x100]
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