Function at 0x6005e0
Capabilities:
Check os version
Connect pipe
Enumerate processes on remote desktop session host
Read pipe
Write pipe

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x208
mov eax, dword [0x906648]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 0xc]
push ebx
mov dword [ebp - 0x208], eax
mov eax, dword [ebp + 0x10]
push esi
mov esi, dword [ebp + 8]
mov dword [ebp - 0x204], eax
mov eax, dword [ebp + 0x14]
push 0xc8
mov dword [ebp - 0x200], eax
lea eax, [ebp - 0xcc]
push 0
push eax
call sub.VCRUNTIME140.dll_memset
add esp, 0xc
lea eax, [ebp - 0x1ec]
or ebx, 0xffffffff
push eax
push esi
call dword [sym.imp.KERNEL32.dll_ProcessIdToSessionId]
test eax, eax
jne 0x600688
test byte [0x9538a8], 1
je 0x600b85
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.Failed_to_get_the_sess_id_for_proc_id_err___d
push 0x51a
push str.E:_workspace_AC_CC_Windows_TACC_MASTER_master_src_solidifier_sapr_sapr_user.c
push str.sapr_call_named_pipe_for_user_session
push dword [0x905514]
push 1
call fcn.004f21c0
add esp, 0x1c
mov eax, ebx
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0063c972
mov esp, ebp
pop ebp
ret
cmp dword [ebp - 0x1ec], 0
push edi
jne 0x6008bd
push 0x118
lea eax, [ebp - 0x1e4]
push 0
push eax
call sub.VCRUNTIME140.dll_memset
add esp, 0xc
mov dword [ebp - 0x1e8], 0x11c
lea eax, [ebp - 0x1e8]
push eax
call dword [sym.imp.KERNEL32.dll_GetVersionExW]
test eax, eax
jne 0x6006ea
test byte [0x9538a8], 1
je 0x600b84
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.Error_in_getting_OS_version_info__err___d
push 0x52c
jmp 0x600b6a
cmp dword [ebp - 0x1e4], 6
jb 0x6008bd
mov al, byte [ebp - 0xce]
cmp al, 2
je 0x600953
cmp al, 3
je 0x600953
lea eax, [ebp - 0x1f0]
push eax
lea eax, [ebp - 0x1fc]
push eax
push 1
push 0
push 0
call sub.WTSAPI32.dll_WTSEnumerateSessionsW
test eax, eax
jne 0x6007a6
test byte [0x9538a8], 1
je 0x600b84
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.WTSEnumerateSessions_failed__err__d
push 0x4e0
push str.E:_workspace_AC_CC_Windows_TACC_MASTER_master_src_solidifier_sapr_sapr_user.c
push str.sapr_find_interactive_session_id
push dword [0x905514]
push 1
call fcn.004f21c0
add esp, 0x1c
test byte [0x9538a8], 1
je 0x600b84
push str.Error_in_getting_interactive_sessID
push 0x557
push str.E:_workspace_AC_CC_Windows_TACC_MASTER_master_src_solidifier_sapr_sapr_user.c
push str.sapr_call_named_pipe_for_user_session
push dword [0x905514]
push 1
call fcn.004f21c0
add esp, 0x18
mov eax, ebx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0063c972
mov esp, ebp
pop ebp
ret
test byte [0x9538a8], 0x10
je 0x6007d9
push dword [ebp - 0x1f0]
push str.Found__d_sessions
push 0x4e4
push str.E:_workspace_AC_CC_Windows_TACC_MASTER_master_src_solidifier_sapr_sapr_user.c
push str.sapr_find_interactive_session_id
push dword [0x905514]
push 0x10
call fcn.004f21c0
add esp, 0x1c
mov esi, dword [ebp - 0x1fc]
xor edi, edi
cmp dword [ebp - 0x1f0], edi
jle 0x600762
nop dword [eax]
mov eax, dword [esi + 4]
mov ebx, dword [esi]
mov dword [ebp - 0x1f4], eax
lea eax, [ebp - 0x1f8]
push eax
push ebx
mov dword [ebp - 0x1f8], 0
call sub.WTSAPI32.dll_WTSQueryUserToken
test eax, eax
jne 0x60085e
test byte [0x9538a8], 0x10
je 0x60084a
push dword [ebp - 0x1f4]
push ebx
push str.Session_id__d___s__is_not_interactive
push 0x4f5
push str.E:_workspace_AC_CC_Windows_TACC_MASTER_master_src_solidifier_sapr_sapr_user.c
push str.sapr_find_interactive_session_id
push dword [0x905514]
push 0x10
call fcn.004f21c0
add esp, 0x20
inc edi
add esi, 0xc
cmp edi, dword [ebp - 0x1f0]
jl 0x6007f0
or ebx, 0xffffffff
jmp 0x600762
test byte [0x9538a8], 0x10
je 0x600892
push dword [ebp - 0x1f4]
push ebx
push str.Session_id__d___s__is_interactive
push 0x4fb
push str.E:_workspace_AC_CC_Windows_TACC_MASTER_master_src_solidifier_sapr_sapr_user.c
push str.sapr_find_interactive_session_id
push dword [0x905514]
push 0x10
call fcn.004f21c0
add esp, 0x20
push dword [ebp - 0x1f8]
mov dword [ebp - 0x1ec], ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [ebp - 0x1ec]
push 0x55b
push str.E:_workspace_AC_CC_Windows_TACC_MASTER_master_src_solidifier_sapr_sapr_user.c
push eax
call fcn.004f19f0
add esp, 0xc
test byte [0x9538a8], 8
je 0x6008f0
push dword [ebp - 0x1ec]
push str.Session_id_is__d
push 0x55f
push str.E:_workspace_AC_CC_Windows_TACC_MASTER_master_src_solidifier_sapr_sapr_user.c
push str.sapr_call_named_pipe_for_user_session
push dword [0x905514]
push 8
call fcn.004f21c0
add esp, 0x1c
push 0xa3d30c
call fcn.004f4a70
push 0
push dword [ebp - 0x1ec]
push 0xa3d2e4
call fcn.00509e80
add esp, 0x10
cmp eax, 2
jne 0x600b3f
push 0
push dword [ebp - 0x1ec]
push 0xa3d2e4
call fcn.00509e40
add esp, 0xc
mov ebx, eax
push 0xa3d30c
call fcn.004f4b00
test ebx, ebx
je 0x60098b
add esp, 4
mov eax, ebx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0063c972
mov esp, ebp
pop ebp
ret
call dword [sym.imp.KERNEL32.dll_WTSGetActiveConsoleSessionId]
mov dword [ebp - 0x1ec], eax
cmp eax, 0xffffffff
jne 0x6008aa
test byte [0x9538a8], 1
je 0x600b84
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.Error_in_getting_console_sess_ID__err___d
push 0x54c
jmp 0x600b6a
push dword [ebp - 0x1ec]
lea eax, [ebp - 0xcc]
push str..pipe_sapr_channel__x
push 0xc8
push eax
call fcn.004f3b60
add esp, 0x14
test eax, eax
jne 0x6009ea
test byte [0x9538a8], 1
je 0x600b03
push dword [ebp - 0x1ec]
push str.Failed_to_create_session_pipe__session___d
push 0x581
push str.E:_workspace_AC_CC_Windows_TACC_MASTER_master_src_solidifier_sapr_sapr_user.c
push str.sapr_call_named_pipe_for_user_session
push dword [0x905514]
push 1
call fcn.004f21c0
add esp, 0x1c
jmp 0x600b03
mov edi, dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, 1
push 0x1388
push dword [ebp - 0x200]
lea eax, [ebp - 0xcc]
push pe_nt_image_headers32
push dword [ebp - 0x204]
push 0x12ac
push dword [ebp - 0x208]
push eax
call dword [sym.imp.KERNEL32.dll_CallNamedPipeW]
test eax, eax
jne 0x600acd
call edi
cmp eax, 0xe7
je 0x600a89
test byte [0x9538a8], 4
je 0x600a6f
call edi
push eax
movzx eax, si
push eax
lea eax, [ebp - 0xcc]
push eax
push str._s_pipe_doesnt_exist__retry__d__err_d
push 0x59a
push str.E:_workspace_AC_CC_Windows_TACC_MASTER_master_src_solidifier_sapr_sapr_user.c
push str.sapr_call_named_pipe_for_user_session
push dword [0x905514]
push 4
call fcn.004f21c0
add esp, 0x24
push dword [ebp - 0x1ec]
call fcn.00600160
push 0
push 0x7d0
call fcn.004f49d0
add esp, 0xc
inc esi
cmp si, 4
jb 0x6009f5
test byte [0x9538a8], 1
je 0x600b03
call edi
push eax
lea eax, [ebp - 0xcc]
push eax
push str.Failed_connect_for_named_pipe__s__err___d
push 0x5ab
push str.E:_workspace_AC_CC_Windows_TACC_MASTER_master_src_solidifier_sapr_sapr_user.c
push str.sapr_call_named_pipe_for_user_session
push dword [0x905514]
push 1
call fcn.004f21c0
add esp, 0x20
jmp 0x600b03
test byte [0x9538a8], 4
je 0x600b01
lea eax, [ebp - 0xcc]
push eax
push str.Connected_to_pipe__s
push 0x5a5
push str.E:_workspace_AC_CC_Windows_TACC_MASTER_master_src_solidifier_sapr_sapr_user.c
push str.sapr_call_named_pipe_for_user_session
push dword [0x905514]
push 4
call fcn.004f21c0
add esp, 0x1c
xor ebx, ebx
push 0xa3d30c
call fcn.004f4a70
push 0
push dword [ebp - 0x1ec]
push 0xa3d2e4
call fcn.00509e60
push 0xa3d30c
call fcn.004f4b00
add esp, 0x14
mov eax, ebx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0063c972
mov esp, ebp
pop ebp
ret
push 0xa3d30c
call fcn.004f4b00
add esp, 4
mov ebx, 0x10
test byte [0x9538a8], 1
je 0x600b84
push dword [ebp - 0x1ec]
push str.Error__pipe_:_0x_x_is_already_busy
push 0x579
push str.E:_workspace_AC_CC_Windows_TACC_MASTER_master_src_solidifier_sapr_sapr_user.c
push str.sapr_call_named_pipe_for_user_session
push dword [0x905514]
push 1
call fcn.004f21c0
add esp, 0x1c
pop edi
mov ecx, dword [ebp - 4]
mov eax, ebx
pop esi
xor ecx, ebp
pop ebx
call fcn.0063c972
mov esp, ebp
pop ebp
ret