Function at 0x140061810
Capabilities:
Check for time delay via gettickcount
Send data
Send data on socket
Set socket configuration

Disassembly:
push rbp
push rbx
push rsi
push rdi
push r12
push r13
push r14
push r15
lea rbp, [rsp - 0x248]
sub rsp, 0x368
mov rax, qword [0x140177090]
xor rax, rsp
mov qword [rbp + 0x230], rax
mov rsi, qword [rbp + 0x2b8]
mov dword [rbp - 0x68], r9d
xor r9d, r9d
cmp dword [rsi + 0x188], 5
mov r14, qword [rsi + 0x1a8]
mov rdi, qword [rsi]
sete r9b
or r13, 0xffffffffffffffff
mov qword [rbp - 0x58], r8
mov qword [rbp - 0x50], rdx
mov r12, rcx
mov qword [rbp - 0x48], rsi
mov r15, r13
mov qword [rbp - 0x60], r14
mov qword [rbp - 0x40], rdi
mov dword [rbp - 0x70], r9d
inc r15
cmp byte [r8 + r15], 0
jne 0x140061882
mov ebx, 1
test r9d, r9d
jne 0x1400618b4
cmp r15, 0xff
jbe 0x1400618b4
lea rdx, str.SOCKS5:_server_resolving_disabled_for_hostnames_of_length___255__actual_len_zu__n
mov r8, r15
mov rcx, rdi
call fcn.140052ba0
mov dword [rbp - 0x70], ebx
mov r8d, dword [rdi + 0x338]
mov edx, dword [rdi + 0x33c]
xor ecx, ecx
test r8d, r8d
mov eax, 1
mov ebx, 0x493e0
cmovg ecx, eax
test edx, edx
jle 0x1400618da
or ecx, 2
dec ecx
je 0x1400618f5
dec ecx
je 0x1400618f1
dec ecx
jne 0x1400618f8
mov ebx, edx
cmp r8d, edx
cmovl ebx, r8d
jmp 0x1400618f8
mov ebx, edx
jmp 0x1400618f8
mov ebx, r8d
call qword [sym.imp.KERNEL32.dll_GetTickCount]
mov r8d, eax
mov eax, 0x10624dd3
mul r8d
mov eax, 0x10624dd3
mov r9d, edx
shr r9d, 6
mov dword [rbp - 0x78], r9d
imul ecx, r9d, 0x3e8
sub r8d, ecx
imul ecx, r8d, 0x3e8
mov dword [rbp - 0x74], ecx
mov rcx, qword [rdi + 0x7d0]
mov r8, qword [rbp - 0x78]
mov rdx, rcx
shr r8, 0x20
sub ecx, r9d
shr rdx, 0x20
sub r8d, edx
imul r8d
sar edx, 6
mov eax, edx
shr eax, 0x1f
add edx, eax
imul eax, ecx, 0x3e8
sub eax, edx
add ebx, eax
test ebx, ebx
jg 0x14006197d
lea rdx, str.Connection_time_out
mov rcx, rdi
call fcn.140052c80
mov eax, 0x1c
jmp 0x1400621f2
mov eax, 1
lea r8, [rbp - 0x80]
mov edx, 0x8004667e
mov rcx, r14
mov dword [rbp - 0x80], eax
call qword [sym.imp.WS2_32.dll_ioctlsocket]
mov r9d, ebx
mov r8, r14
mov rcx, r13
call fcn.140052450
cmp eax, 0xffffffff
jne 0x1400619b9
mov rcx, qword [rsi]
lea rdx, str.SOCKS5:_no_connection_here
jmp 0x1400621e8
test eax, eax
jne 0x1400619d6
mov rcx, qword [rsi]
lea rdx, str.SOCKS5:_connection_timeout
call fcn.140052c80
mov eax, 0x1c
jmp 0x1400621f2
test al, 4
je 0x1400619e9
mov rcx, qword [rsi]
lea rdx, str.SOCKS5:_error_occurred_during_connection
jmp 0x1400621e8
test r12, r12
lea r8, [rbp - 0x80]
mov edx, 0x8004667e
setne al
mov rcx, r14
mov byte [rbp - 0x30], 5
add al, 2
mov word [rbp - 0x2e], 0x100
mov byte [rbp - 0x2c], 2
mov byte [rbp - 0x2f], al
mov dword [rbp - 0x80], 0
call qword [sym.imp.WS2_32.dll_ioctlsocket]
movzx eax, byte [rbp - 0x2f]
lea rdx, [rbp - 0x30]
add eax, 2
movsxd r8, eax
xor eax, eax
cmp r14, qword [rsi + 0x1b0]
sete al
xor r9d, r9d
mov rcx, qword [rsi + rax*8 + 0x1a8]
call qword [sym.imp.WS2_32.dll_send]
xor r14d, r14d
movsxd r13, eax
mov qword [rbp - 0x78], r13
cmp r13, 0xffffffffffffffff
jne 0x140061a9f
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
mov r14d, eax
cmp eax, 0x2733
jne 0x140061a73
xor r13d, r13d
mov qword [rbp - 0x78], r13
lea r14d, [r13 + 0x51]
jmp 0x140061a9f
mov edx, eax
mov rcx, rsi
call fcn.1400649c0
mov rcx, qword [rsi]
lea rdx, str.Send_failure:__s
mov r8, rax
call fcn.140052c80
mov rax, qword [rsi]
mov dword [rax + 0x88d4], r14d
mov r14d, 0x37
test r14d, r14d
jne 0x1400621de
movzx eax, byte [rbp - 0x2f]
add eax, 2
cdqe
cmp r13, rax
jne 0x1400621de
mov r13, qword [rbp - 0x60]
mov eax, 1
lea r8, [rbp - 0x80]
mov edx, 0x8004667e
mov rcx, r13
mov dword [rbp - 0x80], eax
call qword [sym.imp.WS2_32.dll_ioctlsocket]
mov r9d, ebx
or r8, 0xffffffffffffffff
mov rcx, r13
call fcn.140052450
cmp eax, 0xffffffff
jne 0x140061afb
mov rcx, qword [rsi]
lea rdx, str.SOCKS5_nothing_to_read
jmp 0x1400621e8
test eax, eax
jne 0x140061b18
mov rcx, qword [rsi]
lea rdx, str.SOCKS5_read_timeout
call fcn.140052c80
mov eax, 0x1c
jmp 0x1400621f2
test al, 4
je 0x140061b35
mov rcx, qword [rsi]
lea rdx, str.SOCKS5_read_error_occurred
call fcn.140052c80
mov eax, 0x38
jmp 0x1400621f2
lea r8, [rbp - 0x80]
mov edx, 0x8004667e
mov rcx, r13
mov dword [rbp - 0x80], 0
call qword [sym.imp.WS2_32.dll_ioctlsocket]
lea rax, [rbp - 0x80]
lea r8, [rbp - 0x30]
mov r9d, 2
mov rdx, r13
mov rcx, rsi
mov qword [rsp + 0x20], rax
call fcn.140061080
test eax, eax
jne 0x1400621d5
cmp qword [rbp - 0x80], 2
jne 0x1400621d5
cmp byte [rbp - 0x30], 5
je 0x140061b91
lea rdx, str.Received_invalid_version_in_initial_SOCKS5_response.
jmp 0x1400621e5
movzx eax, byte [rbp - 0x2f]
test al, al
je 0x140061d6c
cmp al, 1
jne 0x140061bc0
mov rdx, rsi
call fcn.14006cd80
mov r14d, eax
test eax, eax
je 0x140061d6c
lea rdx, str.Unable_to_negotiate_SOCKS5_GSS_API_context.
jmp 0x1400621e5
cmp al, 2
jne 0x140061d39
mov r13, qword [rbp - 0x50]
test r12, r12
je 0x140061bfd
test r13, r13
je 0x140061bfd
or rax, 0xffffffffffffffff
mov rbx, rax
nop dword [rax]
inc rbx
cmp byte [r12 + rbx], 0
jne 0x140061be0
mov r14, rax
nop dword [rax]
inc r14
cmp byte [r13 + r14], 0
jne 0x140061bf0
jmp 0x140061c02
xor ebx, ebx
xor r14d, r14d
mov byte [rbp - 0x30], 1
mov byte [rbp - 0x2f], bl
test r12, r12
je 0x140061c22
test rbx, rbx
je 0x140061c22
lea rcx, [rbp - 0x2e]
mov r8, rbx
mov rdx, r12
call sub.MSVCR120.dll_memcpy
mov byte [rbp + rbx - 0x2e], r14b
add rbx, 3
test r13, r13
je 0x140061c47
test r14, r14
je 0x140061c47
lea rcx, [rbp - 0x30]
mov r8, r14
mov rdx, r13
add rcx, rbx
call sub.MSVCR120.dll_memcpy
mov r12, qword [rbp - 0x60]
xor eax, eax
add rbx, r14
cmp r12, qword [rsi + 0x1b0]
lea rdx, [rbp - 0x30]
mov r8d, ebx
sete al
xor r9d, r9d
mov rcx, qword [rsi + rax*8 + 0x1a8]
call qword [sym.imp.WS2_32.dll_send]
xor r14d, r14d
movsxd r13, eax
mov qword [rbp - 0x78], r13
cmp r13, 0xffffffffffffffff
jne 0x140061ccb
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
mov r14d, eax
cmp eax, 0x2733
jne 0x140061c9f
xor r13d, r13d
mov qword [rbp - 0x78], r13
lea r14d, [r13 + 0x51]
jmp 0x140061ccb
mov edx, eax
mov rcx, rsi
call fcn.1400649c0
mov rcx, qword [rsi]
lea rdx, str.Send_failure:__s
mov r8, rax
call fcn.140052c80
mov rax, qword [rsi]
mov dword [rax + 0x88d4], r14d
mov r14d, 0x37
test r14d, r14d
jne 0x140061d2d
cmp rbx, r13
jne 0x140061d2d
lea rax, [rbp - 0x80]
lea r9d, [r14 + 2]
lea r8, [rbp - 0x30]
mov rdx, r12
mov rcx, rsi
mov qword [rsp + 0x20], rax
call fcn.140061080
test eax, eax
jne 0x140061d21
cmp qword [rbp - 0x80], 2
jne 0x140061d21
movzx eax, byte [rbp - 0x2f]
test al, al
je 0x140061d6c
movzx r8d, byte [rbp - 0x30]
lea rdx, str.User_was_rejected_by_the_SOCKS5_server___d__d_.
movzx r9d, al
mov rcx, rdi
call fcn.140052c80
jmp 0x1400621ed
lea rdx, str.Unable_to_receive_SOCKS5_sub_negotiation_response.
jmp 0x1400621e5
lea rdx, str.Failed_to_send_SOCKS5_sub_negotiation_request.
jmp 0x1400621e5
cmp al, 0xff
jne 0x140061d60
test r12, r12
je 0x140061d54
cmp byte [r12], 0
lea rdx, str.No_authentication_method_was_acceptable.
jne 0x1400621e5
lea rdx, str.No_authentication_method_was_acceptable.__It_is_quite_likely_that_the_SOCKS5_server_wanted_a_username_password__since_none_was_supplied_to_the_server_on_this_connection._
jmp 0x1400621e5
lea rdx, str.Undocumented_SOCKS5_mode_attempted_to_be_used_by_server.
jmp 0x1400621e5
cmp dword [rbp - 0x70], 0
mov word [rbp - 0x30], 0x105
mov ebx, 3
mov byte [rbp - 0x2e], 0
jne 0x140061da4
mov r13, qword [rbp - 0x58]
lea rcx, [rbp - 0x2b]
mov r8, r15
mov rdx, r13
mov byte [rbp - 0x2d], bl
mov byte [rbp - 0x2c], r15b
call sub.MSVCR120.dll_memcpy
lea rbx, [r15 + 5]
jmp 0x140061eb3
mov r15, qword [rbp - 0x58]
mov r8d, dword [rbp - 0x68]
lea r9, [rbp - 0x70]
mov rdx, r15
mov rcx, rsi
call fcn.1400515a0
cmp eax, 0xffffffff
je 0x1400621ce
cmp eax, 1
jne 0x140061de0
lea rdx, [rbp - 0x70]
mov rcx, rsi
call fcn.140051fa0
mov r14d, eax
test eax, eax
jne 0x1400621f2
mov rax, qword [rbp - 0x70]
test rax, rax
je 0x1400621bc
mov r13, qword [rax]
test r13, r13
je 0x1400621bc
mov eax, dword [r13 + 4]
cmp eax, 2
jne 0x140061e58
mov ebx, 4
mov byte [rbp - 0x2d], 1
mov r12, qword [r13 + 0x20]
lea rcx, [rbp - 0x2c]
mov r15d, ebx
sub r12, rcx
add r12, rbx
or rsi, 0xffffffffffffffff
lea rax, [r12 + rbx]
inc rbx
lea rdx, [0x140178d1c]
movzx ecx, byte [rbp + rax - 0x30]
lea rax, [rsi + rbx]
mov byte [rbp + rbx - 0x31], cl
movzx r8d, byte [rbp + rax - 0x30]
mov rcx, rdi
call fcn.140052ba0
dec r15
jne 0x140061e20
mov rsi, qword [rbp - 0x48]
mov r15, qword [rbp - 0x58]
jmp 0x140061e9a
cmp eax, 0x17
jne 0x140061e97
mov byte [rbp - 0x2d], 4
mov r8, qword [r13 + 0x20]
lea rcx, [rbp - 0x2c]
sub r8, rcx
lea ebx, [rax - 0x13]
lea edx, [rax - 7]
add r8, 8
nop word [rax + rax]
lea rax, [r8 + rbx]
inc rbx
movzx ecx, byte [rbp + rax - 0x30]
mov byte [rbp + rbx - 0x31], cl
dec rdx
jne 0x140061e80
jmp 0x140061e9a
xor r13d, r13d
mov rdx, qword [rbp - 0x70]
mov rcx, rdi
call fcn.140051760
test r13, r13
je 0x1400621bc
mov r13, qword [rbp - 0x58]
mov ecx, dword [rbp - 0x68]
add rbx, 2
mov eax, ecx
sar eax, 8
cmp dword [rsi + 0x7b0], 0
mov byte [rbp + rbx - 0x32], al
mov byte [rbp + rbx - 0x31], cl
je 0x140061ee9
lea rdx, [0x14017ae80]
mov rcx, rdi
call fcn.140052c80
mov r15, qword [rbp - 0x78]
mov r12, qword [rbp - 0x60]
jmp 0x140061f62
mov r12, qword [rbp - 0x60]
xor eax, eax
lea rdx, [rbp - 0x30]
cmp r12, qword [rsi + 0x1b0]
mov r8d, ebx
sete al
xor r9d, r9d
mov rcx, qword [rsi + rax*8 + 0x1a8]
call qword [sym.imp.WS2_32.dll_send]
xor r14d, r14d
movsxd r15, eax
cmp r15, 0xffffffffffffffff
jne 0x140061f62
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
mov r14d, eax
cmp eax, 0x2733
jne 0x140061f36
xor r15d, r15d
lea r14d, [r15 + 0x51]
jmp 0x140061f62
mov edx, eax
mov rcx, rsi
call fcn.1400649c0
mov rcx, qword [rsi]
lea rdx, str.Send_failure:__s
mov r8, rax
call fcn.140052c80
mov rax, qword [rsi]
mov dword [rax + 0x88d4], r14d
mov r14d, 0x37
test r14d, r14d
jne 0x1400621b3
cmp rbx, r15
jne 0x1400621b3
lea ebx, [r14 + 0xa]
cmp dword [rsi + 0x7b0], r14d
je 0x140061f9c
lea rdx, str.SOCKS5_GSS_API_protection_not_yet_implemented.
mov rcx, rdi
call fcn.140052c80
lea rdx, [0x14017af08]
jmp 0x1400621e5
lea rax, [rbp - 0x80]
lea r8, [rbp - 0x30]
mov r9, rbx
mov rdx, r12
mov rcx, rsi
mov qword [rsp + 0x20], rax
call fcn.140061080
test eax, eax
jne 0x140061f90
cmp qword [rbp - 0x80], rbx
jne 0x140061f90
cmp byte [rbp - 0x30], 5
je 0x140061fd3
lea rdx, str.SOCKS5_reply_has_wrong_version__version_should_be_5.
jmp 0x1400621e5
movzx r8d, byte [rbp - 0x2f]
movzx eax, byte [rbp - 0x2d]
test r8b, r8b
je 0x140062139
cmp al, 1
jne 0x140062034
movzx eax, byte [rbp - 0x27]
movzx ecx, byte [rbp - 0x2a]
movzx r10d, byte [rbp - 0x28]
movzx r9d, byte [rbp - 0x2b]
movzx edx, r8b
movzx r8d, byte [rbp - 0x2c]
mov dword [rsp + 0x38], edx
shl r10d, 8
lea rdx, str.Cant_complete_SOCKS5_connection_to__d._d._d._d:_d.___d_
or r10d, eax
movzx eax, byte [rbp - 0x29]
mov dword [rsp + 0x30], r10d
mov dword [rsp + 0x28], eax
mov dword [rsp + 0x20], ecx
mov rcx, rdi
call fcn.140052c80
jmp 0x1400621ed
cmp al, 3
jne 0x140062067
movzx r9d, byte [rbp - 0x28]
movzx eax, byte [rbp - 0x27]
movzx ecx, r8b
shl r9d, 8
mov dword [rsp + 0x20], ecx
lea rdx, str.Cant_complete_SOCKS5_connection_to__s:_d.___d_
mov r8, r13
mov rcx, rdi
or r9d, eax
call fcn.140052c80
jmp 0x1400621ed
cmp al, 4
jne 0x1400621ed
movzx ecx, byte [rbp - 0x27]
movzx r12d, byte [rbp - 0x2f]
movzx edx, byte [rbp - 0x1f]
movzx eax, byte [rbp - 0x28]
movzx r10d, byte [rbp - 0x20]
movzx r11d, byte [rbp - 0x21]
movzx ebx, byte [rbp - 0x22]
movzx edi, byte [rbp - 0x23]
movzx esi, byte [rbp - 0x24]
movzx r14d, byte [rbp - 0x25]
movzx r15d, byte [rbp - 0x26]
movzx r13d, byte [rbp - 0x2a]
movzx r9d, byte [rbp - 0x2b]
movzx r8d, byte [rbp - 0x2c]
mov dword [rsp + 0x98], r12d
shl eax, 8
or eax, ecx
movzx ecx, byte [rbp - 0x1e]
mov dword [rbp - 0x80], eax
movzx eax, byte [rbp - 0x1d]
mov r12d, dword [rbp - 0x80]
mov dword [rsp + 0x90], r12d
movzx r12d, byte [rbp - 0x29]
mov dword [rsp + 0x88], eax
movzx eax, byte [rbp - 0x27]
mov dword [rsp + 0x80], ecx
mov rcx, qword [rbp - 0x40]
mov dword [rsp + 0x78], edx
mov dword [rsp + 0x70], r10d
mov dword [rsp + 0x68], r11d
mov dword [rsp + 0x60], ebx
mov dword [rsp + 0x58], edi
mov dword [rsp + 0x50], esi
mov dword [rsp + 0x48], r14d
mov dword [rsp + 0x40], r15d
mov dword [rsp + 0x38], eax
movzx eax, byte [rbp - 0x28]
lea rdx, str.Cant_complete_SOCKS5_connection_to__02x_02x:_02x_02x:_02x_02x:_02x_02x:_02x_02x:_02x_02x:_02x_02x:_02x_02x:_d.___d_
mov dword [rsp + 0x30], eax
mov dword [rsp + 0x28], r12d
mov dword [rsp + 0x20], r13d
call fcn.140052c80
jmp 0x1400621ed
cmp al, 3
jne 0x140062149
movzx eax, byte [rbp - 0x2c]
add eax, 7
movsxd rbx, eax
jmp 0x140062154
mov ecx, reloc.WS2_32.dll_shutdown
cmp al, 4
cmove rbx, rcx
cmp dword [rsi + 0x7b0], 0
jne 0x140062195
cmp rbx, 0xa
jle 0x140062195
lea rax, [rbp - 0x80]
sub rbx, 0xa
lea r8, [rbp - 0x26]
mov rdx, r12
mov rcx, rsi
mov r9, rbx
mov qword [rsp + 0x20], rax
call fcn.140061080
test eax, eax
jne 0x14006218c
cmp rbx, qword [rbp - 0x80]
je 0x140062195
lea rdx, str.Failed_to_receive_SOCKS5_connect_request_ack.
jmp 0x1400621e5
mov eax, 1
lea r8, [rbp - 0x80]
mov edx, 0x8004667e
mov rcx, r12
mov dword [rbp - 0x80], eax
call qword [sym.imp.WS2_32.dll_ioctlsocket]
xor eax, eax
jmp 0x1400621f2
lea rdx, str.Failed_to_send_SOCKS5_connect_request.
jmp 0x1400621e5
lea rdx, str.Failed_to_resolve___s__for_SOCKS5_connect.
mov r8, r15
mov rcx, rdi
call fcn.140052c80
mov eax, 6
jmp 0x1400621f2
lea rdx, str.Unable_to_receive_initial_SOCKS5_response.
jmp 0x1400621e5
lea rdx, str.Unable_to_send_initial_SOCKS5_request.
mov rcx, rdi
call fcn.140052c80
mov eax, 7
mov rcx, qword [rbp + 0x230]
xor rcx, rsp
call fcn.140129b50
add rsp, 0x368
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbx
pop rbp
ret