Function at 0x1400013c0
Capabilities:
Resolve dns

Disassembly:
push rbx
push rbp
push rsi
push rdi
push r12
push r13
push r14
push r15
sub rsp, 0x188
mov rax, qword [0x140008008]
xor rax, rsp
mov qword [rsp + 0x170], rax
xor ebx, ebx
movsxd rsi, r9d
cmp byte [r8], 4
mov rdi, r8
mov r13, rdx
mov qword [rsp + 0x30], rbx
mov r12, rcx
lea eax, [rbx + 2]
jne 0x1400016fc
lea r15, [rcx + 4]
mov word [rcx], ax
lea r14, [r8 + 4]
test r15, r15
je 0x140001428
test r14, r14
je 0x140001423
mov eax, dword [r14]
mov dword [r15], eax
jmp 0x14000143a
xor eax, eax
mov dword [r15], eax
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__errno]
mov dword [rax], reloc.WS2_32.dll_shutdown
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo]
cmp byte [r14], bl
jne 0x14000166b
cmp byte [rdi + 5], bl
jne 0x14000166b
cmp byte [rdi + 6], bl
jne 0x14000166b
cmp byte [rdi + 7], bl
je 0x14000166b
cmp dword [0x14000864c], ebx
je 0x140001474
xor edx, edx
lea rcx, str._08X:_SOCKS_HandleClient_Socks4a_request_n
call fcn.140001010
cmp esi, 9
jge 0x1400014a6
cmp dword [0x140008648], ebx
je 0x140001a4f
call qword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
lea rcx, str.____SOCKS_thread__08Xd__getAddressInfo_DNSv4a_selected__length_mismatch:__ld_n
mov r8d, esi
mov edx, eax
call fcn.140001010
mov eax, 0xffffffff
jmp 0x140001b2a
mov r9d, 8
mov rcx, rbx
cmp rsi, r9
jbe 0x1400014f4
mov r8d, r9d
nop word [rax + rax]
lea rax, [rdi + r8]
inc r9d
inc r8
lea edx, [rbx + 1]
cmp byte [rax], 0
mov rbp, rcx
cmovne edx, ebx
cmp edx, 1
jne 0x1400014e8
test rcx, rcx
jne 0x1400014ed
movsxd rcx, r9d
add rcx, rdi
jmp 0x1400014ed
cmp edx, 2
je 0x140001522
mov ebx, edx
cmp r8, rsi
jl 0x1400014c0
cmp dword [0x140008648], 0
je 0x140001a4f
call qword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
lea rcx, str.____SOCKS_thread__08Xd__getAddressInfo_DNSv4a_selected__corrup_request:__ld_n
mov r8d, esi
mov edx, eax
call fcn.140001010
mov eax, 0xffffffff
jmp 0x140001b2a
xorps xmm0, xmm0
mov dword [rsp + 0x3c], 2
xorps xmm1, xmm1
mov dword [rsp + 0x40], 1
lea r9, [rsp + 0x30]
mov dword [rsp + 0x44], 6
lea r8, [rsp + 0x38]
mov dword [rsp + 0x38], 1
lea rdx, [0x140005510]
movdqu xmmword [rsp + 0x48], xmm0
movdqu xmmword [rsp + 0x58], xmm1
call qword [sym.imp.WS2_32.dll_getaddrinfo]
mov esi, eax
test eax, eax
je 0x1400015aa
cmp dword [0x140008648], 0
je 0x140001a4f
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
mov ebx, eax
call qword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
mov r9d, ebx
lea rcx, str.____SOCKS_thread__08X__getAddressInfo_GetAddrInfoA_v4a_failed_with_error:__ld__ld_n
mov edx, eax
mov r8d, esi
call fcn.140001010
mov eax, 0xffffffff
jmp 0x140001b2a
mov rax, qword [rsp + 0x30]
mov rcx, qword [rax + 0x20]
test rcx, rcx
je 0x1400015c2
movups xmm0, xmmword [rcx]
movups xmmword [r12], xmm0
jmp 0x1400015dc
xorps xmm0, xmm0
movups xmmword [r12], xmm0
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__errno]
mov dword [rax], reloc.WS2_32.dll_shutdown
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo]
lea rbx, [r12 + 2]
lea rax, [rdi + 2]
test rbx, rbx
je 0x1400015fa
test rax, rax
je 0x1400015f7
movzx eax, word [rax]
mov word [rbx], ax
jmp 0x14000160c
mov word [rbx], ax
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__errno]
mov dword [rax], reloc.WS2_32.dll_shutdown
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo]
mov ecx, reloc.WS2_32.dll_shutdown
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_malloc]
mov r9d, reloc.WS2_32.dll_shutdown
mov rdx, r15
mov r8, rax
mov r14, rax
lea ecx, [r9 - 0x14]
call qword [sym.imp.WS2_32.dll_inet_ntop]
cmp dword [0x140008648], 0
je 0x140001663
movzx ecx, word [rbx]
call qword [sym.imp.WS2_32.dll_htons]
movzx ebx, ax
call qword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
mov r9, r14
mov dword [rsp + 0x20], ebx
mov edx, eax
lea rcx, str.___SOCKS_thread__08X__getAddressInfo_CONNECT_DNSv4a:__s__s_:_hd_n
mov r8, rbp
call fcn.140001010
mov rcx, r14
jmp 0x1400016f1
lea rbx, [r12 + 2]
lea rax, [rdi + 2]
test rbx, rbx
je 0x140001689
test rax, rax
je 0x140001686
movzx eax, word [rax]
mov word [rbx], ax
jmp 0x14000169b
mov word [rbx], ax
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__errno]
mov dword [rax], reloc.WS2_32.dll_shutdown
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo]
mov ecx, reloc.WS2_32.dll_shutdown
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_malloc]
mov r9d, reloc.WS2_32.dll_shutdown
mov rdx, r15
mov r8, rax
mov rbp, rax
lea ecx, [r9 - 0x14]
call qword [sym.imp.WS2_32.dll_inet_ntop]
cmp dword [0x140008648], 0
je 0x1400016ee
movzx ecx, word [rbx]
call qword [sym.imp.WS2_32.dll_htons]
movzx ebx, ax
call qword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
mov r9d, ebx
lea rcx, str.___SOCKS_thread__08X__getAddressInfo_CONNECT_IPv4:__s:_hd_n
mov edx, eax
mov r8, rbp
call fcn.140001010
mov rcx, rbp
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov eax, 2
cmp byte [rdi], 5
jne 0x140001b28
cmp byte [rdi + 3], 1
jne 0x140001808
cmp esi, 0xa
je 0x140001742
cmp dword [0x140008648], 0
je 0x140001a4f
call qword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
lea rcx, str.____SOCKS_thread__08Xd__getAddressInfo_IPv4_selected__length_mismatch:__ld_n
mov r8d, esi
mov edx, eax
call fcn.140001010
mov eax, 0xffffffff
jmp 0x140001b2a
lea r15, [r12 + 2]
mov word [r12], ax
lea rax, [rdi + 8]
test r15, r15
je 0x140001767
test rax, rax
je 0x140001763
movzx eax, word [rax]
mov word [r15], ax
jmp 0x140001779
mov word [r15], ax
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__errno]
mov dword [rax], reloc.WS2_32.dll_shutdown
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo]
lea rbx, [r12 + 4]
lea r14, [rdi + 4]
test rbx, rbx
je 0x140001797
test r14, r14
je 0x140001793
mov eax, dword [r14]
mov dword [rbx], eax
jmp 0x1400017a9
xor eax, eax
mov dword [rbx], eax
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__errno]
mov dword [rax], reloc.WS2_32.dll_shutdown
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo]
mov ecx, reloc.WS2_32.dll_shutdown
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_malloc]
mov r9d, reloc.WS2_32.dll_shutdown
mov rdx, rbx
mov r8, rax
mov rbp, rax
lea ecx, [r9 - 0x14]
call qword [sym.imp.WS2_32.dll_inet_ntop]
cmp dword [0x140008648], 0
je 0x1400017fd
movzx ecx, word [r15]
call qword [sym.imp.WS2_32.dll_htons]
movzx ebx, ax
call qword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
mov r9d, ebx
lea rcx, str.___SOCKS_thread__08X__getAddressInfo_CONNECT_IPv4:__s:_hd_n
mov edx, eax
mov r8, rbp
call fcn.140001010
mov rcx, rbp
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
jmp 0x14000180c
lea r14, [rdi + 4]
cmp byte [rdi + 3], 3
jne 0x140001a20
movzx ebx, byte [r14]
lea eax, [rbx + 7]
cmp eax, esi
je 0x14000184f
cmp dword [0x140008648], 0
je 0x140001a4f
call qword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
lea rcx, str.____SOCKS_thread__08X__getAddressInfo_DNS_selected__length_mismatch:__ld_n
mov r8d, esi
mov edx, eax
call fcn.140001010
mov eax, 0xffffffff
jmp 0x140001b2a
xorps xmm0, xmm0
lea rcx, [rsp + 0x70]
xorps xmm1, xmm1
xor edx, edx
mov r8d, 0x100
movdqu xmmword [rsp + 0x48], xmm0
movdqu xmmword [rsp + 0x58], xmm1
call sub.VCRUNTIME140.dll_memset
mov dword [rsp + 0x40], 1
mov r15d, 2
mov dword [rsp + 0x3c], r15d
mov r8, rbx
mov dword [rsp + 0x44], 6
lea rdx, [rdi + 5]
mov dword [rsp + 0x38], 1
test bl, bl
je 0x1400018c4
test rdx, rdx
je 0x1400018b2
lea rcx, [rsp + 0x70]
call sub.VCRUNTIME140.dll_memcpy
jmp 0x1400018c4
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__errno]
mov dword [rax], reloc.WS2_32.dll_shutdown
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo]
lea r9, [rsp + 0x30]
lea r8, [rsp + 0x38]
lea rdx, [0x140005510]
lea rcx, [rsp + 0x70]
call qword [sym.imp.WS2_32.dll_getaddrinfo]
mov esi, eax
test eax, eax
je 0x14000191f
cmp dword [0x140008648], 0
je 0x140001a4f
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
mov ebx, eax
call qword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
mov r9d, ebx
lea rcx, str.____SOCKS_thread__08X__getAddressInfo_GetAddrInfoA_failed_with_error:__ld__ld_n
mov edx, eax
mov r8d, esi
call fcn.140001010
mov eax, 0xffffffff
jmp 0x140001b2a
mov rax, qword [rsp + 0x30]
mov rcx, qword [rax + 0x20]
test r12, r12
jne 0x140001957
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__errno]
mov dword [rax], reloc.WS2_32.dll_shutdown
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo]
movzx edx, byte [r14]
lea rcx, [r12 + 2]
add rdx, 5
mov rbx, rcx
add rdx, rdi
mov rax, rcx
jmp 0x14000199b
test rcx, rcx
je 0x140001966
movups xmm0, xmmword [rcx]
movups xmmword [r12], xmm0
jmp 0x140001980
xorps xmm0, xmm0
movups xmmword [r12], xmm0
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__errno]
mov dword [rax], reloc.WS2_32.dll_shutdown
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo]
movzx edx, byte [r14]
lea rcx, [r12 + 2]
add rdx, 5
mov rbx, rcx
add rdx, rdi
mov rax, rcx
test rcx, rcx
je 0x1400019ab
test rdx, rdx
je 0x1400019a8
movzx eax, word [rdx]
mov word [rcx], ax
jmp 0x1400019bd
mov word [rax], dx
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__errno]
mov dword [rax], reloc.WS2_32.dll_shutdown
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo]
mov ecx, reloc.WS2_32.dll_shutdown
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_malloc]
lea rdx, [r12 + 4]
mov r9d, reloc.WS2_32.dll_shutdown
mov r8, rax
mov ecx, r15d
mov rbp, rax
call qword [sym.imp.WS2_32.dll_inet_ntop]
cmp dword [0x140008648], 0
je 0x140001a17
movzx ecx, word [rbx]
call qword [sym.imp.WS2_32.dll_htons]
movzx ebx, ax
call qword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
mov r9, rbp
mov dword [rsp + 0x20], ebx
mov edx, eax
lea r8, [rsp + 0x70]
lea rcx, str.___SOCKS_thread__08X__getAddressInfo_CONNECT_DNS:__s__s_:_hd_n
call fcn.140001010
mov rcx, rbp
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
cmp byte [rdi + 3], 4
jne 0x140001b28
cmp esi, 0x16
je 0x140001a59
cmp dword [0x140008648], 0
je 0x140001a4f
call qword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
lea rcx, str.____SOCKS_thread__08X__getAddressInfo_IPv6_selected__length_mismatch:__ld_n
mov r8d, esi
mov edx, eax
call fcn.140001010
mov eax, 0xffffffff
jmp 0x140001b2a
lea rax, [rdi + 0x14]
mov ebp, reloc.WS2_32.dll_socket
lea rdi, [r13 + 2]
mov word [r13], bp
test rdi, rdi
je 0x140001a80
test rax, rax
je 0x140001a7d
movzx eax, word [rax]
mov word [rdi], ax
jmp 0x140001a92
mov word [rdi], ax
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__errno]
mov dword [rax], reloc.WS2_32.dll_shutdown
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo]
lea rbx, [r13 + 8]
test rbx, rbx
je 0x140001abc
test r14, r14
je 0x140001aa9
movups xmm0, xmmword [r14]
movups xmmword [rbx], xmm0
jmp 0x140001ace
xor eax, eax
xorps xmm0, xmm0
movups xmmword [rbx], xmm0
mov qword [rbx + 0x10], rax
mov dword [rbx + 0x18], eax
mov word [rbx + 0x1c], ax
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__errno]
mov dword [rax], reloc.WS2_32.dll_shutdown
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo]
mov ecx, 0x41
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_malloc]
mov r9d, 0x41
mov rdx, rbx
mov r8, rax
mov ecx, ebp
mov rsi, rax
call qword [sym.imp.WS2_32.dll_inet_ntop]
cmp dword [0x140008648], 0
je 0x140001b1f
movzx ecx, word [rdi]
call qword [sym.imp.WS2_32.dll_htons]
movzx ebx, ax
call qword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
mov r9d, ebx
lea rcx, str.___SOCKS_thread__08X__getAddressInfo_CONNECT_IPv6:__s:_hd_n
mov edx, eax
mov r8, rsi
call fcn.140001010
mov rcx, rsi
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
xor eax, eax
mov rcx, qword [rsp + 0x170]
xor rcx, rsp
call fcn.140003850
add rsp, 0x188
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
pop rbx
ret