Function at 0x140256c00
Capabilities:
Receive data
Receive data on socket
Send data
Send data on socket

Disassembly:
mov qword [rsp + 0x20], rbx
push rbp
push rsi
push r14
sub rsp, 0x40
mov rsi, rcx
mov r14, r8
mov rcx, qword [rcx]
mov rbx, rdx
movsx rax, byte [rsi + 0x4ad]
lea rbp, [rax + rax*8]
shl rbp, 5
add rbp, rcx
test byte [rdx + 0xa], 2
je 0x140256c8f
mov rcx, rsi
call fcn.140241350
mov rcx, rax
lea rdx, [0x140240a30]
mov rax, qword [rbx]
mov r9d, 2
mov qword [rsp + 0x30], rax
mov r8, rsi
lea rax, str.SOCKS_fd_d_dead
mov qword [rsp + 0x28], rax
lea rax, str.lws_socks5c_handle_state
mov qword [rsp + 0x20], rax
call fcn.14023ac90
lea rax, str.socks_conn_dead
mov qword [r14], rax
mov eax, 1
mov rbx, qword [rsp + 0x78]
add rsp, 0x40
pop r14
pop rsi
pop rbp
ret
mov r8d, dword [rcx + 0xd0c]
xor r9d, r9d
mov rcx, qword [rsi + 0x470]
mov rdx, qword [rbp + 0x248]
call qword [sym.imp.WS2_32.dll_recv]
test eax, eax
jns 0x140256d23
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
cmp eax, 0x2733
jne 0x140256cce
xor eax, eax
mov rbx, qword [rsp + 0x78]
add rsp, 0x40
pop r14
pop rsi
pop rbp
ret
mov rcx, rsi
call fcn.140241350
mov rcx, rax
lea rdx, [0x140240a30]
lea rax, str.ERROR_reading_from_SOCKS_socket
mov r9d, 1
mov qword [rsp + 0x28], rax
mov r8, rsi
lea rax, str.lws_socks5c_handle_state
mov qword [rsp + 0x20], rax
call fcn.14023ac90
lea rax, str.socks_recv_fail
mov qword [r14], rax
mov eax, 1
mov rbx, qword [rsp + 0x78]
add rsp, 0x40
pop r14
pop rsi
pop rbp
ret
movzx ecx, word [rsi + 0x478]
mov qword [rsp + 0x68], rdi
mov qword [rsp + 0x70], r15
sub ecx, 0x205
je 0x140256eaf
sub ecx, 1
je 0x140256e22
cmp ecx, 1
jne 0x140257043
mov rax, qword [rbp + 0x248]
movzx ecx, byte [rax]
cmp cl, 1
jne 0x14025704a
cmp byte [rax + 1], 0
jne 0x14025704a
movsx rax, byte [rsi + 0x4ad]
mov rbx, 0xffffffffffffffff
mov rdx, qword [rsi]
lea r15, [rax + rax*8]
mov rax, qword [rsi + 0x368]
shl r15, 5
add r15, rdx
mov rcx, qword [rax]
mov rdi, qword [r15 + 0x248]
nop dword [rax]
inc rbx
cmp byte [rcx + rbx], 0
jne 0x140256da0
cmp rbx, 0xfe
jg 0x140256fda
movsxd rcx, dword [rdx + 0xd0c]
lea rax, [rbx + 7]
cmp rcx, rax
jl 0x140256fda
mov dword [rdi], 0x3000105
mov r8, rbx
mov byte [rdi + 4], bl
add rdi, 5
mov rdx, qword [rsi + 0x368]
mov rcx, rdi
mov rdx, qword [rdx]
call fcn.140260c10
movzx ecx, word [rsi + 0x4a2]
add rdi, rbx
call qword [sym.imp.WS2_32.dll_htons]
mov byte [rdi], al
mov ebx, 0x206
inc rdi
sar ax, 8
mov byte [rdi], al
sub edi, dword [r15 + 0x248]
lea eax, [rdi + 1]
mov edi, reloc.WS2_32.dll_sendto
cdqe
jmp 0x140256ff5
mov rax, qword [rbp + 0x248]
movzx ecx, byte [rax]
cmp cl, 5
jne 0x14025704a
cmp byte [rax + 1], 0
jne 0x14025704a
mov rax, qword [rsi + 0x340]
lea rcx, str.HR3_
cmp rax, rcx
je 0x140256e5e
lea rcx, [0x140343380]
cmp rax, rcx
jne 0x140256e86
mov r8, qword [rsi + 8]
mov edx, 0x59
add r8, 0x1c0
mov rcx, rsi
call fcn.1402462d0
test eax, eax
je 0x140256e86
lea rax, str.socks_connect_fail
jmp 0x140257098
mov rax, qword [rsi + 8]
xor r8d, r8d
xor edx, edx
movzx ecx, word [rax + 0x48c]
mov word [rsi + 0x4a2], cx
mov rcx, rsi
call fcn.14023fd90
mov eax, 2
jmp 0x1402570a0
mov rax, qword [rbp + 0x248]
movzx ecx, byte [rax]
cmp cl, 5
jne 0x14025704a
movzx edx, byte [rax + 1]
test dl, dl
jne 0x140256fbb
movsx rax, byte [rsi + 0x4ad]
mov rbx, 0xffffffffffffffff
mov rdx, qword [rsi]
lea r15, [rax + rax*8]
mov rax, qword [rsi + 0x368]
shl r15, 5
add r15, rdx
mov rcx, qword [rax]
mov rdi, qword [r15 + 0x248]
nop dword [rax]
inc rbx
cmp byte [rcx + rbx], 0
jne 0x140256f00
cmp rbx, 0xfe
jg 0x140256f77
movsxd rcx, dword [rdx + 0xd0c]
lea rax, [rbx + 7]
cmp rcx, rax
jl 0x140256f77
mov dword [rdi], 0x3000105
mov r8, rbx
mov byte [rdi + 4], bl
add rdi, 5
mov rdx, qword [rsi + 0x368]
mov rcx, rdi
mov rdx, qword [rdx]
call fcn.140260c10
movzx ecx, word [rsi + 0x4a2]
add rdi, rbx
call qword [sym.imp.WS2_32.dll_htons]
mov byte [rdi], al
mov ebx, 0x206
inc rdi
sar ax, 8
mov byte [rdi], al
sub edi, dword [r15 + 0x248]
lea eax, [rdi + 1]
mov edi, reloc.WS2_32.dll_sendto
cdqe
jmp 0x140256ff5
mov rcx, rsi
call fcn.140241350
mov rcx, rax
lea rdx, [0x140240a30]
lea rax, str.generate_connect_msg_fail
mov r9d, 1
mov qword [rsp + 0x28], rax
mov r8, rsi
lea rax, str.lws_socks5c_handle_state
mov qword [rsp + 0x20], rax
call fcn.14023ac90
lea rax, str.socks_gen_msg_fail
jmp 0x140257098
cmp dl, 2
jne 0x14025704a
lea r8, [rsp + 0x60]
mov edx, 1
mov rcx, rsi
call fcn.140256950
test eax, eax
je 0x140256fe6
lea rax, str.socks_gen_msg_fail
jmp 0x140257098
mov rax, qword [rsp + 0x60]
mov ebx, 0x207
mov edi, reloc.WS2_32.dll_setsockopt
mov rdx, qword [rbp + 0x248]
xor r9d, r9d
mov rcx, qword [rsi + 0x470]
mov r8d, eax
call qword [sym.imp.WS2_32.dll_send]
test eax, eax
jns 0x14025701c
lea rax, str.socks_write_fail
jmp 0x140257098
mov rax, qword [rsi]
mov edx, edi
mov rcx, rsi
mov r8d, dword [rax + 0xd08]
call fcn.14023fd90
mov eax, dword [rsi + 0x478]
and eax, 0xffff0000
or eax, ebx
mov dword [rsi + 0x478], eax
mov eax, 3
jmp 0x1402570a0
movzx ebx, byte [rax + 1]
movzx edi, cl
mov rcx, rsi
call fcn.140241350
mov rcx, rax
mov dword [rsp + 0x38], ebx
lea rax, str.socks_reply:_v_d__err__d
mov dword [rsp + 0x30], edi
mov qword [rsp + 0x28], rax
lea rdx, [0x140240a30]
lea rax, str.lws_socks5c_handle_state
mov r9d, 1
mov r8, rsi
mov qword [rsp + 0x20], rax
call fcn.14023ac90
lea rax, str.socks_reply_fail
mov qword [r14], rax
mov eax, 1
mov rdi, qword [rsp + 0x68]
mov r15, qword [rsp + 0x70]
mov rbx, qword [rsp + 0x78]
add rsp, 0x40
pop r14
pop rsi
pop rbp
ret