Function at 0x140047178
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 [0x1400c1270]
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 0x140047235
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov ebx, eax
test byte [0x1400c2100], 8
je 0x14004720d
mov r8d, eax
lea rdx, [0x14008b2f0]
mov rcx, qword [0x1400c2148]
call fcn.14000f534
test byte [0x1400c2340], 8
je 0x140047786
mov r8d, ebx
lea rdx, [0x14008b2f0]
mov rcx, qword [0x1400c2348]
call fcn.14000f534
jmp 0x140047786
mov rbx, qword [rsp + 0x40]
mov ecx, reloc.OLEAUT32.dll_SafeArrayGetElement
call fcn.1400651c4
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 0x14004777d
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 0x1400473b3
call fcn.1400495f8
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.140039d08
mov rbx, rax
lea rdx, str.AppV::Client::Host::UserManagerImpl::EnumSessions
lea rcx, [rbp - 0x29]
call fcn.140039f38
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.140039eb4
nop
mov rdx, qword [rbp - 0x11]
cmp rdx, 0x10
jb 0x140047367
inc rdx
mov r8, r13
mov rcx, qword [rbp - 0x29]
call fcn.140002ec0
nop
lea rcx, [rbp - 1]
call fcn.14003a5c4
nop
mov rdx, qword [rbp - 0x51]
cmp rdx, 8
jb 0x14004738e
inc rdx
mov r8d, 2
mov rcx, qword [rbp - 0x69]
call fcn.140002ec0
nop
mov rdx, qword [rbp - 0x31]
cmp rdx, 8
jb 0x14004776a
mov rcx, qword [rbp - 0x49]
mov r8d, 2
inc rdx
call fcn.140002ec0
jmp 0x14004776a
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 0x140047457
mov eax, dword [rsp + 0x30]
mov rbx, qword [rsp + 0x48]
test rax, rax
je 0x140047449
test rbx, rbx
je 0x140047417
cmp rax, 4
ja 0x140047417
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 0x140047449
xor edi, edi
test rbx, rbx
jne 0x14004742c
call qword [sym.imp.api_ms_win_crt_private_l1_1_0.dll__o__errno]
mov dword [rax], SafeArrayUnaccessData
jmp 0x14004743e
cmp rax, 4
jbe 0x140047449
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 0x14004756b
mov ecx, edi
call fcn.1400495f8
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.140039d08
mov rbx, rax
lea rdx, str.AppV::Client::Host::UserManagerImpl::EnumSessions
lea rcx, [rbp - 0x29]
call fcn.140039f38
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.140039eb4
nop
mov rdx, qword [rbp - 0x11]
cmp rdx, 0x10
jb 0x14004752d
inc rdx
mov r8, r13
mov rcx, qword [rbp - 0x29]
call fcn.140002ec0
nop
lea rcx, [rbp - 1]
call fcn.14003a5c4
nop
mov rdx, qword [rbp - 0x31]
cmp rdx, 8
jb 0x140047554
inc rdx
mov r8d, 2
mov rcx, qword [rbp - 0x49]
call fcn.140002ec0
nop
mov rdx, qword [rbp - 0x51]
cmp rdx, 8
jb 0x14004776a
mov rcx, qword [rbp - 0x69]
jmp 0x1400473a0
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.140039d08
mov rbx, rax
lea rdx, str.AppV::Client::Host::UserManagerImpl::EnumSessions
lea rcx, [rbp - 0x29]
call fcn.140039f38
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.140039eb4
nop
mov rdx, qword [rbp - 0x11]
cmp rdx, 0x10
jb 0x140047620
inc rdx
mov r8, r13
mov rcx, qword [rbp - 0x29]
call fcn.140002ec0
nop
lea rcx, [rbp - 1]
call fcn.14003a5c4
nop
mov rdx, qword [rbp - 0x31]
cmp rdx, 8
jb 0x140047647
inc rdx
mov r8d, 2
mov rcx, qword [rbp - 0x49]
call fcn.140002ec0
nop
mov rdx, qword [rbp - 0x51]
cmp rdx, 8
jb 0x140047663
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.14004880c
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 0x14004769a
add rax, r13
jmp 0x14004769d
mov rax, rdi
mov rdx, rax
lea rcx, [0x1400c2688]
call fcn.14000f3ec
movabs rax, 0x8000000000
test rax, rbx
jne 0x14004776a
mov edx, esi
mov rcx, rdi
call qword [sym.imp.api_ms_win_crt_private_l1_1_0.dll_strrchr]
test rax, rax
je 0x1400476d4
add rax, r13
jmp 0x1400476d7
mov rax, rdi
mov rdx, rax
lea rcx, [0x1400c2688]
call fcn.14000f3ec
movabs rax, 0x2000000000
test rax, rbx
jne 0x14004776a
mov edx, esi
mov rcx, rdi
call qword [sym.imp.api_ms_win_crt_private_l1_1_0.dll_strrchr]
test rax, rax
je 0x14004770a
add rax, r13
jmp 0x14004770d
mov rax, rdi
mov rdx, rax
lea rcx, [0x1400c2688]
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 0x14004776a
mov edx, esi
mov rcx, rdi
call qword [sym.imp.api_ms_win_crt_private_l1_1_0.dll_strrchr]
test rax, rax
je 0x14004774b
add rax, r13
jmp 0x14004774e
mov rax, rdi
mov rdx, rax
lea rcx, [0x1400c2688]
call fcn.14000f3ec
shl rax, 0x34
or eax, 0x302
cmp ebx, eax
je 0x14004777d
add r14d, r13d
cmp r14d, dword [rsp + 0x34]
mov ebx, 7
jb 0x140047283
lea rcx, [rbp - 0x79]
call fcn.140005a4c
mov rcx, qword [rbp + 0x2f]
xor rcx, rsp
call fcn.1400651a0
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