Function at 0x1400997b0
Capabilities:
Get hostname
Get session information
Get session user name
Prompt user for credentials

Disassembly:
mov qword [rsp + 0x10], rbx
push rbp
push rsi
push rdi
lea rbp, [rsp - 0x3f0]
sub rsp, 0x4f0
mov rax, qword [0x1401737a8]
xor rax, rsp
mov qword [rbp + 0x3e0], rax
mov rbx, r8
mov rdi, rcx
mov r8d, 0x208
lea rcx, [rbp - 0x40]
xor edx, edx
mov rsi, r9
call fcn.1400e36c0
mov edx, ebx
mov rcx, rsi
call qword [sym.imp.USER32.dll_GetMenuItemID]
mov ebx, eax
lea ecx, [rbx - 0x9ead]
cmp ecx, 2
jbe 0x140099837
cmp ebx, 0x9eb1
je 0x140099837
lea ecx, [rbx - 0x9f27]
cmp ecx, 1
jbe 0x140099837
mov r8d, ebx
lea rcx, [0x14016fa78]
xor r9d, r9d
mov rdx, rdi
call fcn.140067a10
jmp 0x140099aa9
lea rdx, [rsp + 0x68]
mov dword [rsp + 0x68], 0x28
mov rcx, rsi
mov dword [rsp + 0x6c], 8
call qword [sym.imp.USER32.dll_GetMenuInfo]
add ebx, 0xffff6153
cmp ebx, 0x7b
ja case.0x14009987d.40624
lea rdx, [0x140000000]
movzx eax, byte [rdx + rbx + 0x99ae8]
mov ecx, dword [rdx + rax*4 + 0x99acc]
add rcx, rdx
jmp rcx
mov edx, dword [rbp - 0x78]
xor r8d, r8d
xor ecx, ecx
call sub.WTSAPI32.dll_WTSDisconnectSession
test eax, eax
jne case.0x14009987d.40624
mov rdx, qword [0x14018ec78]
lea rcx, str.Error_disconnecting_session
call fcn.1400c56e0
jmp case.0x14009987d.40624
mov edx, dword [rbp - 0x78]
lea rax, [rsp + 0x50]
lea r9, [rsp + 0x60]
mov qword [rsp + 0x20], rax
mov r8d, 5
xor ecx, ecx
call sub.WTSAPI32.dll_WTSQuerySessionInformationW
test eax, eax
je 0x14009998b
lea rax, str.Enter_the_selected_users_password
mov dword [rbp - 0x70], 0x28
xor ecx, ecx
mov qword [rbp - 0x60], rax
lea rax, str.Process_Explorer_Connect_Password
mov dword [rsp + 0x54], ecx
mov qword [rbp - 0x58], rax
mov qword [rbp - 0x68], rdi
mov qword [rbp - 0x50], rcx
nop
mov dword [rsp + 0x48], 0x140082
lea rax, [rsp + 0x54]
mov qword [rsp + 0x40], rax
lea rdx, [0x14011eaa0]
lea rax, [rbp - 0x40]
mov dword [rsp + 0x38], 0x104
mov qword [rsp + 0x30], rax
lea rcx, [rbp - 0x70]
mov eax, dword [rsp + 0x50]
mov r9d, 0x52e
mov dword [rsp + 0x28], eax
xor r8d, r8d
mov rax, qword [rsp + 0x60]
mov qword [rsp + 0x20], rax
call qword [sym.imp.credui.dll_CredUIPromptForCredentialsW]
test eax, eax
jne 0x14009997e
mov rax, qword [0x140194178]
lea r9, [rbp - 0x40]
mov edx, dword [rbp - 0x78]
mov r8d, 0xffffffff
xor ecx, ecx
mov byte [rsp + 0x20], 1
call rax
test al, al
jne case.0x14009987d.40624
call qword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x52e
je 0x140099900
jmp 0x140099991
call qword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
je case.0x14009987d.40624
mov ecx, eax
call qword [sym.imp.KERNEL32.dll_SetLastError]
mov rdx, qword [0x14018ec78]
lea rcx, str.Error_connecting_to_session
call fcn.1400c56e0
jmp case.0x14009987d.40624
call qword [sym.imp.KERNEL32.dll_GetCurrentProcessId]
mov ecx, eax
lea rdx, [rsp + 0x58]
call qword [sym.imp.KERNEL32.dll_ProcessIdToSessionId]
call qword [sym.imp.KERNEL32.dll_WTSGetActiveConsoleSessionId]
cmp eax, dword [rsp + 0x58]
jne 0x1400999f0
mov rdx, qword [0x14018ec78]
lea rcx, str.Remote_control_is_not_supported_from_a_console_session
call fcn.1400c56e0
jmp case.0x14009987d.40624
lea rdx, [rsp + 0x50]
mov dword [rsp + 0x50], 0x104
lea rcx, [rbp + 0x1d0]
call qword [sym.imp.KERNEL32.dll_GetComputerNameW]
mov rax, qword [0x140194180]
lea rdx, [rbp + 0x1d0]
mov r8d, dword [rbp - 0x78]
mov ecx, 2
mov word [rsp + 0x20], cx
mov r9b, 0x70
xor ecx, ecx
call rax
test al, al
jne case.0x14009987d.40624
mov rdx, qword [0x14018ec78]
lea rcx, str.Error_starting_remote_control
call fcn.1400c56e0
jmp case.0x14009987d.40624
mov edx, dword [rbp - 0x78]
xor r8d, r8d
xor ecx, ecx
call sub.WTSAPI32.dll_WTSLogoffSession
test eax, eax
jne case.0x14009987d.40624
mov rdx, qword [0x14018ec78]
lea rcx, str.Error_logging_off_session
call fcn.1400c56e0
jmp case.0x14009987d.40624
lea r9, [0x1400a1760]
lea rdx, str.SENDMESSAGE
jmp 0x140099a8a
lea r9, [0x1400a2080]
lea rdx, str.TSINFO
mov rax, qword [rbp - 0x78]
mov r8, qword [0x14018ec78]
mov rcx, qword [0x1401896c0]
mov qword [rsp + 0x20], rax
call qword [sym.imp.USER32.dll_DialogBoxParamW]
xor eax, eax
mov rcx, qword [rbp + 0x3e0]
xor rcx, rsp
call fcn.1400e17a0
mov rbx, qword [rsp + 0x518]
add rsp, 0x4f0
pop rdi
pop rsi
pop rbp
ret