Function at 0x140001b50
Capabilities:
Connect socket

Disassembly:
push rbx
sub rsp, 0x80
mov rax, qword [0x140008008]
xor rax, rsp
mov qword [rsp + 0x70], rax
movzx eax, byte [rcx]
mov rbx, rcx
cmp al, 5
jne 0x140001d6d
mov r9d, edx
mov r8, rcx
lea rdx, [rsp + 0x48]
lea rcx, [rsp + 0x38]
call fcn.1400013c0
test eax, eax
jns 0x140001bbd
cmp dword [0x140008648], 0
je 0x140001bac
call qword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
mov edx, eax
lea rcx, str.____SOCKS_thread__08X__DoConnection_could_not_create_socket_structs_n
call fcn.140001010
mov dl, 1
movzx ecx, dl
call fcn.1400012d0
xor eax, eax
jmp 0x140001e81
movzx eax, byte [rbx + 1]
cmp al, 1
jne 0x140001d2a
cmp byte [rbx + 3], 4
mov edx, 1
lea r8d, [rdx + 5]
jne 0x140001c7b
lea ecx, [rdx + 0x16]
call qword [sym.imp.WS2_32.dll_socket]
mov rbx, rax
cmp rax, 0xffffffffffffffff
jne 0x140001c26
cmp dword [0x140008648], 0
je 0x140001c16
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
mov ebx, eax
call qword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
mov r8d, ebx
lea rcx, str.____SOCKS_thread__08X__DoConnection_socket6___failed_with:__ld_n
mov edx, eax
call fcn.140001010
mov dl, 4
mov cl, 1
call fcn.1400012d0
xor eax, eax
jmp 0x140001e81
mov r8d, 0x1c
lea rdx, [rsp + 0x48]
mov rcx, rax
call qword [sym.imp.WS2_32.dll_connect]
cmp eax, 0xffffffff
jne 0x140001d19
cmp dword [0x140008648], 0
je 0x140001c6b
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
mov ebx, eax
call qword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
mov r8d, ebx
lea rcx, str.____SOCKS_thread__08X__DoConnection_connect6___failed_with:__ld_n
mov edx, eax
call fcn.140001010
mov dl, 4
mov cl, 5
call fcn.1400012d0
xor eax, eax
jmp 0x140001e81
mov ecx, 2
call qword [sym.imp.WS2_32.dll_socket]
mov rbx, rax
cmp rax, 0xffffffffffffffff
jne 0x140001cc8
cmp dword [0x140008648], 0
je 0x140001cb7
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
mov ebx, eax
call qword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
mov r8d, ebx
lea rcx, str.____SOCKS_thread__08X__DoConnection_socket___failed_with:__ld_n
mov edx, eax
call fcn.140001010
mov dl, 1
movzx ecx, dl
call fcn.1400012d0
xor eax, eax
jmp 0x140001e81
mov r8d, reloc.WS2_32.dll_recv
lea rdx, [rsp + 0x38]
mov rcx, rax
call qword [sym.imp.WS2_32.dll_connect]
cmp eax, 0xffffffff
jne 0x140001d19
cmp dword [0x140008648], 0
je 0x140001d09
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
mov ebx, eax
call qword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
mov r8d, ebx
lea rcx, str.____SOCKS_thread__08X__DoConnection_connect___failed_with:__ld_n
mov edx, eax
call fcn.140001010
mov dl, 1
mov cl, 5
call fcn.1400012d0
xor eax, eax
jmp 0x140001e81
mov dl, 1
xor ecx, ecx
call fcn.1400012d0
mov rax, rbx
jmp 0x140001e81
cmp al, 2
jne 0x140001d43
cmp dword [0x140008648], 0
je 0x140001d43
lea rcx, str.___SOCKS_DoConnection_BIND_n
call fcn.140001010
cmp byte [rbx + 1], 3
jne 0x140001f50
cmp dword [0x140008648], 0
je 0x140001f50
lea rcx, str.___SOCKS_DoConnection_UDP_ASSOCIATE_n
call fcn.140001010
xor eax, eax
jmp 0x140001e81
cmp al, 4
jne 0x140001f33
mov r9d, edx
lea rcx, [rsp + 0x38]
lea rdx, [rsp + 0x48]
mov r8, rbx
call fcn.1400013c0
test eax, eax
jns 0x140001de9
cmp dword [0x140008648], 0
je 0x140001dab
call qword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
mov edx, eax
lea rcx, str.____SOCKS_thread__08X__DoConnection_v4_could_not_create_socket_structs_n
call fcn.140001010
xor ebx, ebx
mov qword [rsp + 0x68], rbx
call qword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
mov ecx, eax
call fcn.140002ca0
mov byte [rsp + 0x69], 0x5b
lea r8, [rsp + 0x30]
lea edx, [rbx + 8]
mov dword [rsp + 0x20], 1
lea rcx, [rsp + 0x68]
mov r9d, dword [rax + 4]
call fcn.140001080
xor eax, eax
jmp 0x140001e81
movzx eax, byte [rbx + 1]
cmp al, 1
jne 0x140001f13
mov edx, 1
mov qword [rsp + 0xa0], rdi
lea ecx, [rdx + 1]
lea r8d, [rdx + 5]
call qword [sym.imp.WS2_32.dll_socket]
mov rdi, rax
cmp rax, 0xffffffffffffffff
jne 0x140001e97
cmp dword [0x140008648], 0
je 0x140001e40
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
mov ebx, eax
call qword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
mov r8d, ebx
lea rcx, str.____SOCKS_thread__08X__DoConnection_v4_socket___failed_with:__ld_n
mov edx, eax
call fcn.140001010
xor ebx, ebx
mov qword [rsp + 0x68], rbx
call qword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
mov ecx, eax
call fcn.140002ca0
mov byte [rsp + 0x69], 0x5b
lea r8, [rsp + 0x30]
lea edx, [rbx + 8]
mov dword [rsp + 0x20], 1
lea rcx, [rsp + 0x68]
mov r9d, dword [rax + 4]
call fcn.140001080
xor eax, eax
mov rdi, qword [rsp + 0xa0]
mov rcx, qword [rsp + 0x70]
xor rcx, rsp
call fcn.140003850
add rsp, 0x80
pop rbx
ret
mov r8d, reloc.WS2_32.dll_recv
lea rdx, [rsp + 0x38]
mov rcx, rdi
call qword [sym.imp.WS2_32.dll_connect]
cmp eax, 0xffffffff
jne 0x140001ed8
cmp dword [0x140008648], 0
je 0x140001e40
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
mov ebx, eax
call qword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
mov r8d, ebx
lea rcx, str.____SOCKS_thread__08X__DoConnection_v4_connect___failed_with:__ld_n
mov edx, eax
jmp 0x140001e3b
xor ebx, ebx
mov qword [rsp + 0x68], rbx
call qword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
mov ecx, eax
call fcn.140002ca0
mov byte [rsp + 0x69], 0x5a
lea r8, [rsp + 0x30]
lea edx, [rbx + 8]
mov dword [rsp + 0x20], ebx
lea rcx, [rsp + 0x68]
mov r9d, dword [rax + 4]
call fcn.140001080
mov rax, rdi
jmp 0x140001e79
cmp al, 2
jne 0x140001f50
cmp dword [0x140008648], 0
je 0x140001f50
lea rcx, str.___SOCKS_DoConnection_v4_BIND_n
call fcn.140001010
xor eax, eax
jmp 0x140001e81
cmp dword [0x140008648], 0
je 0x140001f50
call qword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
mov edx, eax
lea rcx, str.____SOCKS_thread__08X__DoConnection_unknown_SOCKS_version_n
call fcn.140001010
xor eax, eax
jmp 0x140001e81