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

Disassembly:
push r13
sub rsp, 0xc0
xor edx, edx
lea rcx, [rsp + 0x44]
mov dword [rsp + 0x40], 0x50
lea r8d, [rdx + 0x4c]
call fcn.14009e740
mov rcx, qword [0x1400d8210]
mov edx, 3
call qword [sym.imp.USER32.dll_GetSubMenu]
mov r13, rax
nop word [rax + rax]
xor edx, edx
mov r8d, 0x400
mov rcx, r13
call qword [sym.imp.USER32.dll_DeleteMenu]
test eax, eax
jne 0x14004a030
xor edx, edx
lea rax, [rsp + 0xd0]
lea r9, [rsp + 0xe8]
lea r8d, [rdx + 1]
xor ecx, ecx
mov qword [rsp + 0x20], rax
call sub.WTSAPI32.dll_WTSEnumerateSessionsW
test eax, eax
je 0x14004a2a6
mov qword [rsp + 0x98], r12
xor r12d, r12d
cmp dword [rsp + 0xd0], r12d
jbe 0x14004a291
mov qword [rsp + 0xb8], rbx
mov qword [rsp + 0xb0], rbp
mov qword [rsp + 0xa8], rsi
mov qword [rsp + 0xa0], rdi
xor ebp, ebp
nop word [rax + rax]
mov rax, qword [rsp + 0xe8]
lea rcx, [rsp + 0xd8]
lea r9, [rsp + 0x30]
mov edx, dword [rax + rbp]
mov qword [rsp + 0x20], rcx
mov r8d, 7
xor ecx, ecx
call sub.WTSAPI32.dll_WTSQuerySessionInformationW
test eax, eax
je 0x14004a11b
mov r8, qword [rsp + 0x30]
or rcx, 0xffffffffffffffff
xor eax, eax
mov rdi, r8
repne scasw ax, word [rdi]
not rcx
lea rdx, [rcx + rcx - 2]
mov rcx, r8
call sym.ProcessHacker.exe_PhCreateStringEx
mov rcx, qword [rsp + 0x30]
mov rbx, rax
call sub.WTSAPI32.dll_WTSFreeMemory
test rbx, rbx
je 0x14004a11d
mov rcx, rbx
call sym.ProcessHacker.exe_PhaDereferenceObject
jmp 0x14004a11d
xor ebx, ebx
mov rax, qword [rsp + 0xe8]
lea rcx, [rsp + 0xe0]
lea r9, [rsp + 0x38]
mov edx, dword [rax + rbp]
mov qword [rsp + 0x20], rcx
mov r8d, 5
xor ecx, ecx
call sub.WTSAPI32.dll_WTSQuerySessionInformationW
test eax, eax
je 0x14004a188
mov r8, qword [rsp + 0x38]
or rcx, 0xffffffffffffffff
xor eax, eax
mov rdi, r8
repne scasw ax, word [rdi]
not rcx
lea rdx, [rcx + rcx - 2]
mov rcx, r8
call sym.ProcessHacker.exe_PhCreateStringEx
mov rcx, qword [rsp + 0x38]
mov rdi, rax
call sub.WTSAPI32.dll_WTSFreeMemory
test rdi, rdi
je 0x14004a18a
mov rcx, rdi
call sym.ProcessHacker.exe_PhaDereferenceObject
jmp 0x14004a18a
xor edi, edi
test rbx, rbx
je 0x14004a25c
cmp word [rbx], 0
je 0x14004a25c
test rdi, rdi
je 0x14004a25c
cmp word [rdi], 0
je 0x14004a25c
mov rax, qword [rsp + 0xe8]
lea r9, [rdi + 0x10]
lea r8, [rbx + 0x10]
mov edx, dword [rax + rbp]
lea rcx, str._u:__s_s
call sym.ProcessHacker.exe_PhaFormatString
mov rcx, qword [0x1400d8fa0]
mov edx, 0x97
mov rdi, rax
call qword [sym.imp.USER32.dll_LoadMenuW]
xor edx, edx
mov rcx, rax
call qword [sym.imp.USER32.dll_GetSubMenu]
lea r9, [rdi + 0x10]
mov edx, 0x10
mov r8, rax
mov rcx, r13
mov rsi, rax
call qword [sym.imp.USER32.dll_AppendMenuW]
mov rcx, qword [rsp + 0xe8]
mov dword [rsp + 0x44], 0x20
mov edx, dword [rcx + rbp]
mov rcx, rsi
mov qword [rsp + 0x70], rdx
call qword [sym.imp.USER32.dll_GetMenuItemCount]
mov ebx, eax
cmp eax, 0xffffffff
je 0x14004a25c
xor edi, edi
test eax, eax
je 0x14004a25c
nop word [rax + rax]
lea r9, [rsp + 0x40]
mov r8d, 1
mov edx, edi
mov rcx, rsi
call qword [sym.imp.USER32.dll_SetMenuItemInfoW]
inc edi
cmp edi, ebx
jb 0x14004a240
inc r12d
add rbp, 0x18
cmp r12d, dword [rsp + 0xd0]
jb 0x14004a0b0
mov rdi, qword [rsp + 0xa0]
mov rsi, qword [rsp + 0xa8]
mov rbp, qword [rsp + 0xb0]
mov rbx, qword [rsp + 0xb8]
mov rcx, qword [rsp + 0xe8]
call sub.WTSAPI32.dll_WTSFreeMemory
mov r12, qword [rsp + 0x98]
mov rcx, qword [sym.ProcessHacker.exe_PhMainWndHandle]
call qword [sym.imp.USER32.dll_DrawMenuBar]
add rsp, 0xc0
pop r13
ret