Function at 0x140001b40
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 0x140001d63
mov r9d, edx
mov r8, rcx
lea rdx, [rsp + 0x48]
lea rcx, [rsp + 0x38]
call fcn.1400013c0
test eax, eax
jns 0x140001bad
cmp dword [0x140008658], 0
je 0x140001b9c
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 0x140001e77
movzx eax, byte [rbx + 1]
cmp al, 1
jne 0x140001d1a
cmp byte [rbx + 3], 4
mov edx, 1
lea r8d, [rdx + 5]
jne 0x140001c6b
lea ecx, [rdx + 0x16]
call qword [sym.imp.WS2_32.dll_socket]
mov rbx, rax
cmp rax, 0xffffffffffffffff
jne 0x140001c16
cmp dword [0x140008658], 0
je 0x140001c06
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 0x140001e77
mov r8d, 0x1c
lea rdx, [rsp + 0x48]
mov rcx, rax
call qword [sym.imp.WS2_32.dll_connect]
cmp eax, 0xffffffff
jne 0x140001d09
cmp dword [0x140008658], 0
je 0x140001c5b
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 0x140001e77
mov ecx, 2
call qword [sym.imp.WS2_32.dll_socket]
mov rbx, rax
cmp rax, 0xffffffffffffffff
jne 0x140001cb8
cmp dword [0x140008658], 0
je 0x140001ca7
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 0x140001e77
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 0x140001d09
cmp dword [0x140008658], 0
je 0x140001cf9
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 0x140001e77
mov dl, 1
xor ecx, ecx
call fcn.1400012d0
mov rax, rbx
jmp 0x140001e77
cmp al, 2
jne 0x140001d3b
cmp dword [0x140008658], 0
je 0x140001f46
lea rcx, str.___SOCKS_DoConnection_BIND_n
call fcn.140001010
movzx eax, byte [rbx + 1]
cmp al, 3
jne 0x140001f46
cmp dword [0x140008658], 0
je 0x140001f46
lea rcx, str.___SOCKS_DoConnection_UDP_ASSOCIATE_n
call fcn.140001010
xor eax, eax
jmp 0x140001e77
cmp al, 4
jne 0x140001f29
mov r9d, edx
lea rcx, [rsp + 0x38]
lea rdx, [rsp + 0x48]
mov r8, rbx
call fcn.1400013c0
test eax, eax
jns 0x140001ddf
cmp dword [0x140008658], 0
je 0x140001da1
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.140002c20
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 0x140001e77
movzx eax, byte [rbx + 1]
cmp al, 1
jne 0x140001f09
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 0x140001e8d
cmp dword [0x140008658], 0
je 0x140001e36
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.140002c20
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.1400037c0
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 0x140001ece
cmp dword [0x140008658], 0
je 0x140001e36
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 0x140001e31
xor ebx, ebx
mov qword [rsp + 0x68], rbx
call qword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
mov ecx, eax
call fcn.140002c20
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 0x140001e6f
cmp al, 2
jne 0x140001f46
cmp dword [0x140008658], 0
je 0x140001f46
lea rcx, str.___SOCKS_DoConnection_v4_BIND_n
call fcn.140001010
xor eax, eax
jmp 0x140001e77
cmp dword [0x140008658], 0
je 0x140001f46
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 0x140001e77