Function at 0x140002e00
Capabilities:
Check mutex on windows
Create mailslot
Create thread
Initialize winsock library
Read file on windows
Write file on windows

Disassembly:
mov qword [rsp + 0x18], rbx
mov qword [rsp + 0x20], rsi
push rbp
push rdi
push r13
push r14
push r15
lea rbp, [rsp - 0x47c0]
mov eax, 0x48c0
call fcn.1400045d0
sub rsp, rax
mov rax, qword [0x140008008]
xor rax, rsp
mov qword [rbp + 0x47b0], rax
lea rax, str.1080
movsxd rsi, ecx
mov qword [0x140008688], rax
lea rcx, str.Socks_Over_RDP_by_Balazs_Bucsay____xoreipeip___n_n
lea rax, str.127.0.0.1
mov byte [0x140008690], 4
xor r15d, r15d
mov qword [0x140008680], rax
mov r14, rdx
mov dword [rsp + 0x40], r15d
mov r13d, r15d
call fcn.140002930
cmp esi, 1
jle 0x140002ee8
dec rsi
mov edi, r15d
mov ebx, r15d
test rsi, rsi
jle 0x140002ee8
nop dword [rax + rax]
mov rcx, qword [r14 + rbx*8 + 8]
lea rdx, [0x1400061b0]
inc rbx
mov r8d, 1
inc edi
call qword [sym.imp.api_ms_win_crt_string_l1_1_0.dll_wcsncmp]
test eax, eax
jne 0x140002f24
mov rdx, qword [r14 + rbx*8]
movzx eax, word [rdx + 2]
cmp eax, 0x3f
je 0x140002f37
cmp eax, 0x64
je 0x140002ed9
cmp eax, 0x68
je 0x140002f37
cmp eax, 0x76
jne 0x140002f2b
mov dword [0x140008658], 1
jmp 0x140002ee3
mov dword [0x14000865c], 1
cmp rbx, rsi
jl 0x140002e90
movzx r8d, byte [0x140008690]
lea rdx, str.SocksChannel
or r8d, 1
mov qword [rsp + 0x48], r15
mov ecx, 0xffffffff
call qword [sym.imp.WTSAPI32.dll_WTSVirtualChannelOpenEx]
mov qword [0x140008698], rax
test rax, rax
jne 0x140002f4b
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov ebx, eax
jmp 0x140002fcd
movsxd rdx, edi
mov rdx, qword [r14 + rdx*8]
lea rcx, str.____Invalid_argument:__s_n
call fcn.140002930
mov rdx, qword [r14]
lea rcx, str.Usage:__s___v____t_timeout_val__n_h_t_tThis_help_n_v_t_tVerbose_Mode_n
call fcn.140002930
jmp 0x140003772
lea r9, [rbp - 0x70]
mov edx, 1
lea r8, [rsp + 0x48]
mov rcx, rax
call qword [sym.imp.WTSAPI32.dll_WTSVirtualChannelQuery]
test eax, eax
jne 0x140002f70
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov ebx, eax
jmp 0x140002fcd
cmp dword [rbp - 0x70], 8
je 0x140002f7d
mov ebx, 0x57
jmp 0x140002fcd
mov rax, qword [rsp + 0x48]
mov rdi, qword [rax]
call qword [sym.imp.KERNEL32.dll_GetCurrentProcess]
mov rbx, rax
call qword [sym.imp.KERNEL32.dll_GetCurrentProcess]
mov dword [rsp + 0x30], 2
lea r9, [0x140008660]
mov rcx, rax
mov dword [rsp + 0x28], r15d
mov r8, rbx
mov dword [rsp + 0x20], r15d
mov rdx, rdi
call qword [sym.imp.KERNEL32.dll_DuplicateHandle]
test eax, eax
jne 0x140002fca
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov ebx, eax
jmp 0x140002fcd
mov ebx, r15d
mov rcx, qword [rsp + 0x48]
test rcx, rcx
je 0x140002fdd
call qword [sym.imp.WTSAPI32.dll_WTSFreeMemory]
mov rcx, qword [0x140008698]
test rcx, rcx
je 0x140002fef
call qword [sym.imp.WTSAPI32.dll_WTSVirtualChannelClose]
test ebx, ebx
je 0x140003021
cmp ebx, 0x1f
jne 0x14000300b
mov edx, ebx
lea rcx, str.____Could_not_open_Dynamic_Virtual_Channel__plugin_was_not_loaded_on_the_client_side:__ld_n
call fcn.140002930
jmp 0x140003772
mov r8d, ebx
lea rcx, str.____Could_not_open_Dynamic_Virtual_Channel:__ld___08X_n
mov edx, ebx
call fcn.140002930
jmp 0x140003772
lea rcx, str.___Channel_opened_over_RDP_n
call fcn.140002930
xor r8d, r8d
xor edx, edx
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_CreateMutexW]
xor r8d, r8d
xor edx, edx
xor ecx, ecx
mov qword [0x140008650], rax
call qword [sym.imp.KERNEL32.dll_CreateMutexW]
xorps xmm0, xmm0
xor r9d, r9d
xor r8d, r8d
mov qword [0x140008678], rax
xor edx, edx
xor ecx, ecx
movups xmmword [rsp + 0x70], xmm0
movups xmmword [rbp - 0x80], xmm0
call qword [sym.imp.KERNEL32.dll_CreateEventW]
xorps xmm0, xmm0
lea rdx, [rbp - 0x60]
movups xmmword [rsp + 0x60], xmm0
mov ecx, 0x202
mov qword [rsp + 0x68], rax
movups xmmword [rsp + 0x50], xmm0
call qword [sym.imp.WS2_32.dll_WSAStartup]
test eax, eax
je 0x1400030a9
mov edx, eax
lea rcx, str.____WSAStartup___failed_with_error:__ld_n
call fcn.140002930
jmp 0x140003772
mov edx, 1
mov qword [rsp + 0x48f0], r12
lea rcx, [0x140002d30]
call qword [sym.imp.KERNEL32.dll_SetConsoleCtrlHandler]
nop dword [rax]
nop word [rax + rax]
mov rcx, qword [0x140008660]
lea rax, [rsp + 0x50]
lea r9, [rbp - 0x6c]
mov qword [rsp + 0x20], rax
mov r8d, 0x648
lea rdx, [rbp + 0x160]
call qword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x14000313e
call qword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x3e5
jne 0x140003756
mov rcx, qword [rsp + 0x68]
mov edx, 0xffffffff
call qword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov rcx, qword [0x140008660]
lea r8, [rbp - 0x6c]
xor r9d, r9d
lea rdx, [rsp + 0x50]
call qword [sym.imp.KERNEL32.dll_GetOverlappedResult]
test eax, eax
je 0x140003756
mov r15d, dword [rbp - 0x6c]
lea r12, [rbp + 0x168]
add r15d, 0xfffffff8
mov dword [rbp - 0x70], 0
test r13d, r13d
je 0x1400031f3
cmp dword [0x14000865c], 0
je 0x14000317c
lea r9d, [r15 + r13]
mov r8d, r15d
mov edx, r13d
lea rcx, str.___Overflow_was_present_from_previous_call._Stored_bytes:__ld._Received_bytes:__ld___ld__n
call fcn.140001010
mov eax, r13d
lea rcx, [rbp + 0x7b0]
add rcx, rax
mov r8d, r15d
test r15d, r15d
je 0x1400031da
test rcx, rcx
jne 0x1400031a4
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__errno]
mov dword [rax], reloc.WS2_32.dll_shutdown
jmp 0x1400031d4
cmp r8, 0x4000
ja 0x1400031bb
lea rdx, [rbp + 0x168]
call sub.VCRUNTIME140.dll_memcpy
jmp 0x1400031da
xor edx, edx
mov r8d, 0x4000
call sub.VCRUNTIME140.dll_memset
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__errno]
mov dword [rax], 0x22
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo]
add r15d, r13d
mov dword [rbp - 0x70], 1
xor r13d, r13d
lea r12, [rbp + 0x7b0]
mov dword [rsp + 0x40], r13d
test r15d, r15d
je 0x1400030d0
nop dword [rax]
cmp r15d, 9
jb 0x140003676
mov rcx, qword [0x140008678]
mov edx, 0xffffffff
mov r14d, dword [r12]
mov r13d, dword [r12 + 4]
call qword [sym.imp.KERNEL32.dll_WaitForSingleObject]
test eax, eax
je 0x140003246
cmp eax, 0x80
jne 0x1400032ad
call qword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
mov edx, eax
lea rcx, str._08X:_LookupThreadRemote_lock_abandoned_n
call fcn.140001010
jmp 0x1400032ad
mov rbx, qword [0x140008670]
test rbx, rbx
jne 0x140003272
mov rcx, qword [0x140008678]
call qword [sym.imp.KERNEL32.dll_ReleaseMutex]
test eax, eax
jne 0x1400032ad
call qword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
lea rdx, str.____LookupThreadRemote_Release_Failed0:__08X
jmp 0x1400032a3
cmp dword [rbx + 4], r14d
je 0x140003437
mov rbx, qword [rbx + 0x30]
test rbx, rbx
jne 0x140003272
mov rcx, qword [0x140008678]
call qword [sym.imp.KERNEL32.dll_ReleaseMutex]
test eax, eax
jne 0x1400032ad
call qword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
lea rdx, str.____LookupThreadRemote_Release_Failed2:__08X
mov r8d, eax
xor ecx, ecx
call fcn.140002ab0
xorps xmm0, xmm0
lea r8, str..mailslotRDPSocks__08X
mov r9d, r14d
lea rcx, [rbp + 0x140]
mov edx, 0x20
movups xmmword [rbp + 0x140], xmm0
movups xmmword [rbp + 0x150], xmm0
call fcn.140002990
xor r9d, r9d
lea rcx, [rbp + 0x140]
xor edx, edx
mov r8d, 0xffffffff
call qword [sym.imp.KERNEL32.dll_CreateMailslotA]
mov rdi, rax
cmp rax, 0xffffffffffffffff
je 0x140003560
xor r9d, r9d
mov qword [rsp + 0x30], 0
mov dword [rsp + 0x28], 0x80
lea rcx, [rbp + 0x140]
mov edx, 0x40000000
mov dword [rsp + 0x20], 3
lea r8d, [r9 + 1]
call qword [sym.imp.KERNEL32.dll_CreateFileA]
mov rsi, rax
cmp rax, 0xffffffffffffffff
je 0x140003542
mov rcx, qword [0x140008678]
mov edx, 0xffffffff
call qword [sym.imp.KERNEL32.dll_WaitForSingleObject]
test eax, eax
je 0x140003373
cmp eax, 0x80
je 0x140003361
xor ebx, ebx
jmp 0x1400033ef
xor edx, edx
lea rcx, str._08X:_AddThread_lock_abandoned_n
call fcn.140001010
xor ebx, ebx
jmp 0x1400033ef
mov ecx, 0x38
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_malloc]
mov rcx, qword [0x140008670]
mov rbx, rax
xor eax, eax
mov dword [rbx], eax
mov dword [rbx + 4], r14d
mov qword [rbx + 8], rax
mov dword [rbx + 0x10], 1
mov qword [rbx + 0x18], rdi
mov qword [rbx + 0x20], rsi
mov qword [rbx + 0x28], rax
mov qword [rbx + 0x30], rax
test rcx, rcx
jne 0x1400033b9
mov qword [0x140008670], rbx
jmp 0x1400033d2
mov rax, qword [rcx + 0x30]
test rax, rax
je 0x1400033ce
mov rcx, rax
mov rax, qword [rax + 0x30]
test rax, rax
jne 0x1400033c2
mov qword [rcx + 0x30], rbx
mov rcx, qword [0x140008678]
call qword [sym.imp.KERNEL32.dll_ReleaseMutex]
test eax, eax
jne 0x1400033ef
lea rcx, str.Release_failed_n
call fcn.140001010
lea rax, [rbp - 0x68]
mov r9, rbx
mov qword [rsp + 0x28], rax
lea r8, [0x140001f50]
xor edx, edx
mov dword [rsp + 0x20], 0
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_CreateThread]
cmp dword [0x14000865c], 0
mov ecx, dword [rbp - 0x68]
mov dword [rbx], ecx
mov qword [rbx + 8], rax
je 0x14000347b
mov edx, r14d
lea rcx, str.____08X:_Thread_not_found__Mailslot_created_n
call fcn.140001010
jmp 0x14000347b
mov rcx, qword [0x140008678]
call qword [sym.imp.KERNEL32.dll_ReleaseMutex]
test eax, eax
jne 0x14000345f
call qword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
lea rdx, str.____LookupThreadRemote_Release_Failed1:__08X
xor ecx, ecx
mov r8d, eax
call fcn.140002ab0
cmp dword [0x14000865c], 0
je 0x140003477
mov edx, r14d
lea rcx, str.____08X:_Thread_found__Mailslot_found_n
call fcn.140001010
mov rsi, qword [rbx + 0x20]
lea rcx, [r15 - 9]
mov ebx, r15d
cmp r13, rcx
ja 0x1400035ad
lea rax, [rsp + 0x70]
mov rcx, rsi
lea rdx, [r12 + 8]
mov qword [rsp + 0x20], rax
lea r9, [rsp + 0x44]
lea r8d, [r13 + 1]
call qword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x1400034f5
call qword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x3e5
jne 0x14000357e
mov rcx, qword [rbp - 0x78]
mov edx, 0xffffffff
call qword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov rcx, qword [0x140008660]
lea r8, [rsp + 0x44]
mov r9d, 1
lea rdx, [rsp + 0x70]
call qword [sym.imp.KERNEL32.dll_GetOverlappedResult]
test eax, eax
je 0x14000357e
cmp dword [0x14000865c], 0
je 0x14000351b
mov r8d, dword [rsp + 0x44]
lea r9d, [r13 + 1]
mov edx, r14d
mov dword [rsp + 0x20], r15d
lea rcx, str.____08X:_no_error__written:__ld__should_have_written:__ld__cbFullSize:__ld_n
call fcn.140001010
mov ecx, dword [rsp + 0x44]
lea r12, [r12 + 8]
mov r13d, dword [rsp + 0x40]
mov eax, 0xfffffff8
sub eax, ecx
lea r12, [r12 + rcx]
add r15d, eax
jne 0x140003200
jmp 0x1400030d0
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, eax
lea rcx, str.CreateMailslot_w_failed_with__d._n
call fcn.140001010
mov r13d, dword [rsp + 0x40]
jmp 0x1400030d0
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, eax
lea rcx, str.CreateMailslot_r_failed_with__d_n
call fcn.140001010
mov r13d, dword [rsp + 0x40]
jmp 0x1400030d0
cmp dword [0x14000865c], 0
mov r13d, dword [rsp + 0x40]
je 0x1400030d0
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, r14d
lea rcx, str._____08X:_WriteChannel_error:__ld_n
mov r8d, eax
call fcn.140001010
jmp 0x1400030d0
cmp dword [0x14000865c], 0
je 0x1400035c8
mov r8d, r15d
lea rcx, str._______OVERFLOW_HAPPENED__ld____ld__9_n
mov edx, r13d
call fcn.140001010
cmp dword [rbp - 0x70], 0
je 0x14000361b
cmp dword [0x14000865c], 0
je 0x1400035e6
mov edx, r15d
lea rcx, str.___Data_left_in_buffer__ofused:__ld_n
call fcn.140001010
test r15d, r15d
je 0x140003749
cmp rbx, 0x4000
ja 0x140003737
mov r8, rbx
lea rcx, [rbp + 0x7b0]
mov rdx, r12
call sub.VCRUNTIME140.dll_memmove
mov r13d, r15d
mov dword [rsp + 0x40], r15d
jmp 0x1400030d0
cmp dword [0x14000865c], 0
je 0x140003633
mov edx, r15d
lea rcx, str.___Data_left_in_buffer__not_ofused:__ld_n
call fcn.140001010
test r15d, r15d
je 0x140003749
lea rcx, [rbp + 0x7b0]
cmp rbx, 0x4000
ja 0x140003664
mov r8, rbx
mov rdx, r12
call sub.VCRUNTIME140.dll_memcpy
mov r13d, r15d
mov dword [rsp + 0x40], r15d
jmp 0x1400030d0
xor edx, edx
mov r8d, 0x4000
call sub.VCRUNTIME140.dll_memset
jmp 0x140003737
cmp dword [rbp - 0x70], 0
je 0x1400036a5
cmp dword [0x14000865c], 0
je 0x140003749
mov edx, r15d
lea rcx, str.___Not_enough_data__ofused:__ld_n
call fcn.140001010
mov r13d, r15d
mov dword [rsp + 0x40], r15d
jmp 0x1400030d0
cmp dword [0x14000865c], 0
je 0x1400036bd
mov edx, r15d
lea rcx, str.___Not_enough_data__no_ofused:__ld_n
call fcn.140001010
mov ebx, r15d
test r15d, r15d
je 0x140003749
test r12, r12
je 0x1400036f6
cmp rbx, 0x4000
ja 0x1400036f6
mov r8d, ebx
lea rcx, [rbp + 0x7b0]
mov rdx, r12
call sub.VCRUNTIME140.dll_memcpy
mov r13d, r15d
mov dword [rsp + 0x40], r15d
jmp 0x1400030d0
xor edx, edx
lea rcx, [rbp + 0x7b0]
mov r8d, 0x4000
call sub.VCRUNTIME140.dll_memset
test r12, r12
jne 0x14000372e
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__errno]
mov dword [rax], reloc.WS2_32.dll_shutdown
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo]
mov r13d, r15d
mov dword [rsp + 0x40], r15d
jmp 0x1400030d0
cmp rbx, 0x4000
jbe 0x140003749
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__errno]
mov dword [rax], 0x22
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo]
mov r13d, r15d
mov dword [rsp + 0x40], r15d
jmp 0x1400030d0
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, eax
lea rcx, str.____ReadFile___WaitForSingleObject___error:__ld_n
call fcn.140002930
mov r12, qword [rsp + 0x48f0]
mov eax, 0xffffffff
mov rcx, qword [rbp + 0x47b0]
xor rcx, rsp
call fcn.1400037c0
lea r11, [rsp + 0x48c0]
mov rbx, qword [r11 + 0x40]
mov rsi, qword [r11 + 0x48]
mov rsp, r11
pop r15
pop r14
pop r13
pop rdi
pop rbp
ret