Function at 0x140165910
Capabilities:
Convert ip address from string

Disassembly:
push rbx
push rbp
push rsi
push rdi
push r13
push r14
push r15
sub rsp, 0xa0
mov rax, qword [0x1402e7900]
xor rax, rsp
mov qword [rsp + 0x98], rax
mov r9, qword [rcx + 0x18]
lea rdi, [rdx + 0x10]
mov r10, qword [rdx + 0x270]
mov rsi, r8
mov r14, 0xffffffffffffffff
mov qword [rsp + 0x40], rcx
mov rbx, rdx
mov qword [rsp + 0x48], r9
movzx r8d, byte [r9 + 0xb4]
mov r13, r14
mov byte [rsp + 0x31], r8b
nop word [rax + rax]
inc r13
cmp byte [r10 + r13], 0
jne 0x140165970
mov eax, dword [rbx]
xor r15d, r15d
movzx ebp, byte [rsi + 0x6b3]
dec eax
mov qword [rsp + 0xf8], r12
mov edx, r15d
mov byte [rsp + 0x30], r15b
mov qword [rsp + 0x38], rdx
cmp eax, 0xf
ja case.0x1401659c2.5
cdqe
lea r11, [0x140000000]
lea r12d, [r15 + 0xa]
mov ecx, dword [r11 + rax*4 + 0x16636c]
lea eax, [r15 + 2]
add rcx, r11
jmp rcx
cmp byte [r9 + 0x340], dl
je 0x1401659ec
mov r9d, dword [rbx + 0x278]
lea rdx, str.SOCKS5:_connecting_to_HTTP_proxy__s_port__d
mov r8, r10
mov rcx, rsi
call fcn.140147cc0
movzx r8d, byte [rsp + 0x31]
cmp r8b, 5
je 0x140165a14
cmp r13, 0xff
jbe 0x140165a14
lea rdx, str.SOCKS5:_the_destination_hostname_is_too_long_to_be_resolved_remotely_by_the_proxy.
mov rcx, rsi
call fcn.140147bd0
mov eax, 9
jmp 0x140166340
mov r8d, ebp
test ebp, 0xfffffffa
je 0x140165a2e
lea rdx, str.warning:_unsupported_value_passed_to_CURLOPT_SOCKS5_AUTH:__u
mov rcx, rsi
call fcn.140147cc0
test bpl, 1
jne 0x140165a3b
mov qword [rbx + 0x280], r15
mov byte [rdi], 5
test bpl, 4
je 0x140165a56
mov word [rdi + 2], 0x100
mov ecx, 4
mov byte [rsp + 0x30], 1
jmp 0x140165a64
mov byte [rdi + 2], r15b
mov ecx, 3
mov byte [rsp + 0x30], r15b
cmp qword [rbx + 0x280], r15
je 0x140165a74
mov byte [rcx + rdi], 2
inc rcx
lea eax, [rcx - 2]
mov r9d, 0x1d
mov byte [rdi + 1], al
mov r8, rsi
mov qword [rbx + 8], rcx
lea rax, str.initial_SOCKS5_request
mov rcx, qword [rsp + 0x40]
mov rdx, rbx
mov qword [rsp + 0x20], rax
mov qword [rbx + 0x268], rdi
call fcn.140166470
test eax, eax
jne 0x140166340
cmp qword [rbx + 8], r15
jne 0x14016633e
cmp dword [rbx], 4
je case.0x1401659c2.3
mov dword [rbx], 4
jmp case.0x1401659c2.3
mov rcx, qword [rsp + 0x40]
lea rax, str.initial_SOCKS5_request
mov r9d, 0x1d
mov qword [rsp + 0x20], rax
mov r8, rsi
mov rdx, rbx
call fcn.140166470
test eax, eax
jne 0x140166340
cmp qword [rbx + 8], r15
jne 0x14016633e
mov qword [rbx + 8], 2
mov qword [rbx + 0x268], rdi
mov rbp, qword [rsp + 0x40]
lea rax, str.initial_SOCKS5_response
mov rcx, rbp
mov qword [rsp + 0x20], rax
mov r9d, reloc.WS2_32.dll_ntohs
mov r8, rsi
mov rdx, rbx
call fcn.1401663b0
test eax, eax
jne 0x140166340
cmp qword [rbx + 8], r15
jne 0x14016633e
cmp byte [rdi], 5
je 0x140165b5e
lea rdx, str.Received_invalid_version_in_initial_SOCKS5_response.
mov rcx, rsi
call fcn.140147bd0
mov eax, 2
jmp 0x140166340
movzx eax, byte [rdi + 1]
test al, al
je 0x140165da8
cmp al, 2
jne 0x140165bbe
cmp dword [rbx], 6
je case.0x1401659c2.6
mov dword [rbx], 6
mov rax, qword [rbx + 0x280]
test rax, rax
je 0x140165c4b
mov rcx, qword [rbx + 0x288]
test rcx, rcx
je 0x140165c4b
mov rbp, r14
nop dword [rax]
inc rbp
cmp byte [rax + rbp], r15b
jne 0x140165ba0
nop dword [rax]
inc r14
cmp byte [rcx + r14], r15b
jne 0x140165bb0
jmp 0x140165c51
cmp al, 1
jne 0x140165c15
cmp byte [rsp + 0x30], r15b
je 0x140165bfc
cmp dword [rbx], 5
je 0x140165bd4
mov dword [rbx], 5
mov rdx, rsi
mov rcx, rbp
call fcn.140191dd0
test eax, eax
je 0x140165c32
lea rdx, str.Unable_to_negotiate_SOCKS5_GSS_API_context.
mov rcx, rsi
call fcn.140147bd0
mov eax, 4
jmp 0x140166340
lea rdx, str.SOCKS5_GSSAPI_per_message_authentication_is_not_supported.
mov rcx, rsi
call fcn.140147bd0
mov eax, 5
jmp 0x140166340
cmp al, 0xff
jne 0x140165c32
lea rdx, str.No_authentication_method_was_acceptable.
mov rcx, rsi
call fcn.140147bd0
mov eax, recv
jmp 0x140166340
lea rdx, str.Undocumented_SOCKS5_mode_attempted_to_be_used_by_server.
mov rcx, rsi
call fcn.140147bd0
mov eax, 0x20
jmp 0x140166340
mov rbp, r15
mov r14, r15
mov byte [rdi], 1
mov byte [rdi + 1], bpl
mov rdx, qword [rbx + 0x280]
test rdx, rdx
je 0x140165c97
test rbp, rbp
je 0x140165c97
cmp rbp, 0xff
jbe 0x140165c8b
lea rdx, str.Excessive_user_name_length_for_proxy_auth
mov rcx, rsi
call fcn.140147bd0
mov eax, ntohs
jmp 0x140166340
lea rcx, [rdi + 2]
mov r8, rbp
call fcn.14021a050
mov byte [rdi + rbp + 2], r14b
add rbp, 3
mov rdx, qword [rbx + 0x288]
test rdx, rdx
je 0x140165cdd
test r14, r14
je 0x140165cdd
cmp r14, 0xff
jbe 0x140165cd1
lea rdx, str.Excessive_password_length_for_proxy_auth
mov rcx, rsi
call fcn.140147bd0
mov rax, r12
jmp 0x140166340
lea rcx, [rdi + rbp]
mov r8, r14
call fcn.14021a050
add rbp, r14
cmp dword [rbx], 7
je 0x140165ceb
mov dword [rbx], 7
mov qword [rbx + 8], rbp
mov qword [rbx + 0x268], rdi
mov rbp, qword [rsp + 0x40]
lea rax, str.SOCKS5_sub_negotiation_request
mov rcx, rbp
mov qword [rsp + 0x20], rax
mov r9d, 0x1c
mov r8, rsi
mov rdx, rbx
call fcn.140166470
test eax, eax
jne 0x140166340
cmp qword [rbx + 8], r15
jne 0x14016633e
cmp dword [rbx], 8
mov qword [rbx + 0x268], rdi
mov qword [rbx + 8], 2
je 0x140165d4e
mov dword [rbx], 8
jmp 0x140165d4e
mov rbp, qword [rsp + 0x40]
lea rax, str.SOCKS5_sub_negotiation_response
mov r9d, select
mov r8, rsi
mov qword [rsp + 0x20], rax
mov rdx, rbx
mov rcx, rbp
call fcn.1401663b0
test eax, eax
jne 0x140166340
cmp qword [rbx + 8], r15
jne 0x14016633e
movzx eax, byte [rdi + 1]
test al, al
je 0x140165da8
movzx r8d, byte [rdi]
lea rdx, str.User_was_rejected_by_the_SOCKS5_server___d__d_.
mov r9d, eax
mov rcx, rsi
call fcn.140147bd0
mov eax, 0x21
jmp 0x140166340
cmp dword [rbx], 9
je case.0x1401659c2.9
mov dword [rbx], 9
cmp byte [rsp + 0x31], 5
jne 0x140165e67
mov r8d, dword [rbx + 0x278]
lea rax, [rsp + 0x38]
mov rdx, qword [rbx + 0x270]
mov r9b, 1
mov rcx, rsi
mov qword [rsp + 0x20], rax
call fcn.14016e220
cmp eax, 0xffffffff
je 0x140165ef0
mov ecx, dword [rbx]
cmp eax, 1
jne 0x140165e02
cmp ecx, r12d
je 0x14016633e
mov dword [rbx], r12d
jmp 0x14016633e
mov rdx, qword [rsp + 0x38]
cmp ecx, 0xb
je case.0x1401659c2.11
mov dword [rbx], recv
mov rbp, r15
test rdx, rdx
je 0x140165e1d
mov rbp, qword [rdx]
movzx edx, byte [rsi + 0x6e8]
mov rax, rbp
test dl, dl
je 0x140165efa
cmp dl, 1
mov ecx, reloc.WS2_32.dll_socket
mov eax, 2
cmove ecx, eax
test rbp, rbp
je 0x140165eff
nop dword [rax + rax]
cmp dword [rbp + 4], ecx
je 0x140165f1f
mov rbp, qword [rbp + 0x28]
test rbp, rbp
jne 0x140165e50
jmp 0x140165eff
mov r9, qword [rsp + 0x48]
mov eax, 2
mov word [rdi], 0x105
mov byte [rdi + 2], r15b
jmp 0x140166092
mov r8d, dword [rbx + 0x278]
mov rdx, r10
mov rcx, rsi
call fcn.14016d950
mov qword [rsp + 0x38], rax
test rax, rax
je 0x140165ecd
mov qword [rsi + 0xd88], rax
lea rdx, str.SOCKS5:_hostname__s_found
mov byte [rsi + 0xda8], 1
mov rcx, rsi
mov r8, qword [rbx + 0x270]
call fcn.140147cc0
mov rdx, qword [rsp + 0x38]
test rdx, rdx
jne case.0x1401659c2.11
lea rdx, [rsp + 0x38]
mov rcx, rsi
call fcn.14016e760
mov rdx, qword [rsp + 0x38]
test rdx, rdx
jne case.0x1401659c2.11
test eax, eax
je 0x14016633e
mov eax, 0x1b
jmp 0x140166340
test rax, rax
jne 0x140165f1f
mov r8, qword [rbx + 0x270]
lea rdx, str.Failed_to_resolve___s__for_SOCKS5_connect.
mov rcx, rsi
call fcn.140147bd0
mov eax, 0x1b
jmp 0x140166340
mov r8d, 0x2e
lea rdx, [rsp + 0x68]
mov rcx, rbp
call fcn.14016e1e0
mov byte [rdi + 2], r15b
mov r15d, 3
mov word [rdi], 0x105
mov eax, dword [rbp + 4]
cmp eax, 2
jne 0x140165fa0
mov byte [rdi + 3], 1
lea r8, [rsp + 0x68]
mov rcx, qword [rbp + 0x20]
lea rdx, str.SOCKS5_connect_to__s:_d__locally_resolved_
mov r15d, 8
movzx eax, byte [rcx + 4]
mov byte [rdi + 4], al
movzx eax, byte [rcx + 5]
mov byte [rdi + 5], al
movzx eax, byte [rcx + 6]
mov byte [rdi + 6], al
movzx eax, byte [rcx + 7]
mov rcx, rsi
mov byte [rdi + 7], al
mov r9d, dword [rbx + 0x278]
call fcn.140147cc0
mov rdx, qword [rsp + 0x38]
mov rcx, rsi
call fcn.14016e810
jmp case.0x1401659c2.13
cmp eax, 0x17
jne 0x140166054
mov byte [rdi + 3], 4
lea r8, [rsp + 0x68]
mov rcx, qword [rbp + 0x20]
lea rdx, str.SOCKS5_connect_to___s_:_d__locally_resolved_
mov r15d, reloc.WS2_32.dll_sendto
movzx eax, byte [rcx + 8]
mov byte [rdi + 4], al
movzx eax, byte [rcx + 9]
mov byte [rdi + 5], al
movzx eax, byte [rcx + 0xa]
mov byte [rdi + 6], al
movzx eax, byte [rcx + 0xb]
mov byte [rdi + 7], al
movzx eax, byte [rcx + 0xc]
mov byte [rdi + 8], al
movzx eax, byte [rcx + 0xd]
mov byte [rdi + 9], al
movzx eax, byte [rcx + 0xe]
mov byte [rdi + 0xa], al
movzx eax, byte [rcx + 0xf]
mov byte [rdi + 0xb], al
movzx eax, byte [rcx + 0x10]
mov byte [rdi + 0xc], al
movzx eax, byte [rcx + 0x11]
mov byte [rdi + 0xd], al
movzx eax, byte [rcx + 0x12]
mov byte [rdi + 0xe], al
movzx eax, byte [rcx + 0x13]
mov byte [rdi + 0xf], al
movzx eax, byte [rcx + 0x14]
mov byte [rdi + 0x10], al
movzx eax, byte [rcx + 0x15]
mov byte [rdi + 0x11], al
movzx eax, byte [rcx + 0x16]
mov byte [rdi + 0x12], al
movzx eax, byte [rcx + 0x17]
mov rcx, rsi
mov byte [rdi + 0x13], al
mov r9d, dword [rbx + 0x278]
call fcn.140147cc0
mov rdx, qword [rsp + 0x38]
mov rcx, rsi
call fcn.14016e810
jmp case.0x1401659c2.13
lea r8, [rsp + 0x68]
mov rcx, rsi
lea rdx, str.SOCKS5_connection_to__s_not_supported
call fcn.140147bd0
mov rdx, qword [rsp + 0x38]
mov rcx, rsi
call fcn.14016e810
jmp case.0x1401659c2.13
mov word [rdi], 0x105
mov r15d, 3
mov byte [rdi + 2], dl
cmp r8b, 5
je case.0x1401659c2.13
cmp byte [r9 + 0x34b], 0
mov rdx, qword [rbx + 0x270]
je 0x1401660cf
lea r8, [rsp + 0x58]
mov ecx, reloc.WS2_32.dll_socket
call qword [sym.imp.WS2_32.dll_inet_pton]
cmp eax, 1
jne 0x1401662ed
movups xmm0, xmmword [rsp + 0x58]
mov byte [rdi + 3], 4
lea r15d, [rax + 0x13]
movups xmmword [rdi + 4], xmm0
jmp 0x140166112
lea r8, [rsp + 0x50]
mov ecx, eax
call qword [sym.imp.WS2_32.dll_inet_pton]
cmp eax, 1
jne 0x1401660f3
mov byte [rdi + 3], al
mov r15d, 8
mov eax, dword [rsp + 0x50]
mov dword [rdi + 4], eax
jmp 0x140166112
mov byte [rdi + 3], 3
lea rcx, [rdi + 5]
mov byte [rdi + 4], r13b
mov r8, r13
mov rdx, qword [rbx + 0x270]
call fcn.14021a050
lea r15, [r13 + 5]
mov r9d, dword [rbx + 0x278]
lea rdx, str.SOCKS5_connect_to__s:_d__remotely_resolved_
mov r8, qword [rbx + 0x270]
mov rcx, rsi
call fcn.140147cc0
mov eax, dword [rbx + 0x278]
mov r14, qword [rsp + 0x48]
sar eax, 8
mov byte [r15 + rdi], al
movzx eax, byte [rbx + 0x278]
mov byte [r15 + rdi + 1], al
cmp dword [r14 + 0x760], 0
jne 0x1401661b7
cmp dword [rbx], 0xe
lea rax, [r15 + 2]
mov qword [rbx + 8], rax
mov qword [rbx + 0x268], rdi
je 0x140166176
mov dword [rbx], select
jmp 0x140166176
mov r14, r9
mov rbp, qword [rsp + 0x40]
lea rax, str.SOCKS5_connect_request
mov rcx, rbp
mov qword [rsp + 0x20], rax
mov r9d, 0x1e
mov r8, rsi
mov rdx, rbx
call fcn.140166470
test eax, eax
jne 0x140166340
cmp qword [rbx + 8], 0
jne 0x14016633e
cmp dword [r14 + 0x760], eax
je 0x1401661d0
lea rdx, str.SOCKS5_GSS_API_protection_not_yet_implemented.
mov rcx, rsi
call fcn.140147bd0
mov eax, 6
jmp 0x140166340
cmp dword [rbx], 0xf
mov qword [rbx + 8], r12
mov qword [rbx + 0x268], rdi
je 0x1401661f0
mov dword [rbx], reloc.WS2_32.dll_ntohs
jmp 0x1401661f0
mov rbp, qword [rsp + 0x40]
mov r14, r9
lea rax, str.SOCKS5_connect_request_ack
mov r9d, reloc.WS2_32.dll_recv
mov r8, rsi
mov qword [rsp + 0x20], rax
mov rdx, rbx
mov rcx, rbp
call fcn.1401663b0
test eax, eax
jne 0x140166340
cmp qword [rbx + 8], 0
jne 0x14016633e
cmp byte [rdi], 5
je 0x140166241
lea rdx, str.SOCKS5_reply_has_wrong_version__version_should_be_5.
mov rcx, rsi
call fcn.140147bd0
mov eax, 2
jmp 0x140166340
movzx eax, byte [rdi + 1]
test al, al
je 0x140166283
mov r8, qword [rbx + 0x270]
lea rdx, str.Cant_complete_SOCKS5_connection_to__s.___d_
mov r9d, eax
mov rcx, rsi
mov ebp, 0x19
mov edi, eax
call fcn.140147bd0
cmp edi, 9
jae 0x14016627c
lea rcx, [0x140000000]
mov ebp, dword [rcx + rdi*4 + 0x247ee8]
mov eax, ebp
jmp 0x140166340
movzx eax, byte [rdi + 3]
cmp al, 3
jne 0x140166296
movzx r12d, byte [rdi + 4]
add r12, 7
jmp 0x1401662a6
cmp al, 4
jne 0x1401662a2
mov r12d, socket
jmp 0x1401662a6
cmp al, 1
jne 0x1401662de
cmp dword [r14 + 0x760], 0
jne 0x1401662f9
mov ecx, dword [rbx]
cmp r12, 0xa
jbe 0x1401662d9
lea rax, [r12 - 0xa]
mov qword [rbx + 8], rax
lea rax, [rdi + 0xa]
mov qword [rbx + 0x268], rax
cmp ecx, 0x10
je 0x1401662f9
mov dword [rbx], reloc.WS2_32.dll_recv
jmp 0x1401662f9
cmp ecx, 0x11
jmp 0x140166327
lea rdx, str.SOCKS5_reply_has_wrong_address_type.
mov rcx, rsi
call fcn.140147bd0
mov eax, 1
jmp 0x140166340
mov rbp, qword [rsp + 0x40]
lea rax, str.SOCKS5_connect_request_address
mov r9d, reloc.WS2_32.dll_listen
mov r8, rsi
mov qword [rsp + 0x20], rax
mov rdx, rbx
mov rcx, rbp
call fcn.1401663b0
test eax, eax
jne 0x140166340
cmp qword [rbx + 8], 0
jne 0x14016633e
cmp dword [rbx], 0x11
je case.0x1401659c2.5
mov dword [rbx], reloc.WS2_32.dll_recvfrom
lea rdx, str.SOCKS5_request_granted.
mov rcx, rsi
call fcn.140147cc0
xor eax, eax
mov r12, qword [rsp + 0xf8]
mov rcx, qword [rsp + 0x98]
xor rcx, rsp
call fcn.1401d5b70
add rsp, 0xa0
pop r15
pop r14
pop r13
pop rdi
pop rsi
pop rbp
pop rbx
ret