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 rbp, r9d
cmp byte [r8], 4
mov rdi, r8
mov r13, rdx
mov qword [rsp + 0x30], rbx
mov r15, rcx
lea r12d, [rbx + 2]
jne 0x1400016fd
mov word [rcx], r12w
lea rsi, [r8 + 4]
lea r12, [rcx + 4]
test r12, r12
je 0x14000142b
test rsi, rsi
je 0x140001425
mov eax, dword [rsi]
mov dword [r12], eax
jmp 0x14000143d
xor eax, eax
mov dword [r12], 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 [rsi], bl
jne 0x14000166d
cmp byte [rdi + 5], bl
jne 0x14000166d
cmp byte [rdi + 6], bl
jne 0x14000166d
cmp byte [rdi + 7], bl
je 0x14000166d
cmp dword [0x14000865c], ebx
je 0x140001476
xor edx, edx
lea rcx, str._08X:_SOCKS_HandleClient_Socks4a_request_n
call fcn.140001010
cmp ebp, 9
jge 0x1400014a8
cmp dword [0x140008658], ebx
je 0x140001a3a
call qword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
lea rcx, str.____SOCKS_thread__08Xd__getAddressInfo_DNSv4a_selected__length_mismatch:__ld_n
mov r8d, ebp
mov edx, eax
call fcn.140001010
mov eax, 0xffffffff
jmp 0x140001b18
mov r8d, 8
mov rsi, rbx
cmp rbp, r8
jbe 0x1400014f1
mov edx, r8d
nop dword [rax]
lea rax, [rdi + rdx]
inc r8d
inc rdx
lea ecx, [rbx + 1]
cmp byte [rax], 0
cmovne ecx, ebx
cmp ecx, 1
jne 0x1400014e5
test rsi, rsi
jne 0x1400014ea
movsxd rsi, r8d
add rsi, rdi
jmp 0x1400014ea
cmp ecx, 2
je 0x14000151f
mov ebx, ecx
cmp rdx, rbp
jl 0x1400014c0
cmp dword [0x140008658], 0
je 0x140001a3a
call qword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
lea rcx, str.____SOCKS_thread__08Xd__getAddressInfo_DNSv4a_selected__corrup_request:__ld_n
mov r8d, ebp
mov edx, eax
call fcn.140001010
mov eax, 0xffffffff
jmp 0x140001b18
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, [0x140005500]
mov rcx, rsi
movdqu xmmword [rsp + 0x48], xmm0
movdqu xmmword [rsp + 0x58], xmm1
call qword [sym.imp.WS2_32.dll_getaddrinfo]
mov ebp, eax
test eax, eax
je 0x1400015aa
cmp dword [0x140008658], 0
je 0x140001a3a
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, ebp
call fcn.140001010
mov eax, 0xffffffff
jmp 0x140001b18
mov rax, qword [rsp + 0x30]
mov rcx, qword [rax + 0x20]
test rcx, rcx
je 0x1400015c1
movups xmm0, xmmword [rcx]
movups xmmword [r15], xmm0
jmp 0x1400015da
xorps xmm0, xmm0
movups xmmword [r15], 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, [r15 + 2]
lea rax, [rdi + 2]
test rbx, rbx
je 0x1400015f7
test rax, rax
je 0x1400015f4
movzx eax, word [rax]
mov word [rbx], ax
jmp 0x140001609
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 rdx, r12
mov r9d, reloc.WS2_32.dll_shutdown
mov r12d, 2
mov r8, rax
mov ecx, r12d
mov r14, rax
call qword [sym.imp.WS2_32.dll_inet_ntop]
cmp dword [0x140008658], 0
je 0x140001665
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, rsi
call fcn.140001010
mov rcx, r14
jmp 0x1400016f7
lea rbx, [r15 + 2]
lea rax, [rdi + 2]
test rbx, rbx
je 0x14000168a
test rax, rax
je 0x140001687
movzx eax, word [rax]
mov word [rbx], ax
jmp 0x14000169c
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 rdx, r12
mov r9d, reloc.WS2_32.dll_shutdown
mov r12d, 2
mov r8, rax
mov ecx, r12d
mov rsi, rax
call qword [sym.imp.WS2_32.dll_inet_ntop]
cmp dword [0x140008658], 0
je 0x1400016f4
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, rsi
call fcn.140001010
mov rcx, rsi
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
cmp byte [rdi], 5
jne 0x140001b16
movzx eax, byte [rdi + 3]
cmp al, 1
jne 0x140001806
cmp ebp, 0xa
je 0x140001745
cmp dword [0x140008658], 0
je 0x140001a3a
call qword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
lea rcx, str.____SOCKS_thread__08Xd__getAddressInfo_IPv4_selected__length_mismatch:__ld_n
mov r8d, ebp
mov edx, eax
call fcn.140001010
mov eax, 0xffffffff
jmp 0x140001b18
lea r14, [r15 + 2]
mov word [r15], r12w
lea rax, [rdi + 8]
test r14, r14
je 0x140001768
test rax, rax
je 0x140001764
movzx eax, word [rax]
mov word [r14], ax
jmp 0x14000177a
mov word [r14], 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, [r15 + 4]
lea rax, [rdi + 4]
test rbx, rbx
je 0x140001794
test rax, rax
je 0x140001792
mov eax, dword [rax]
mov dword [rbx], eax
jmp 0x1400017a6
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 ecx, r12d
mov rsi, rax
call qword [sym.imp.WS2_32.dll_inet_ntop]
cmp dword [0x140008658], 0
je 0x1400017f9
movzx ecx, word [r14]
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, rsi
call fcn.140001010
mov rcx, rsi
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
movzx eax, byte [rdi + 3]
cmp al, 3
jne 0x140001a0d
movzx ebx, byte [rdi + 4]
lea eax, [rbx + 7]
cmp eax, ebp
je 0x140001847
cmp dword [0x140008658], 0
je 0x140001a3a
call qword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
lea rcx, str.____SOCKS_thread__08X__getAddressInfo_DNS_selected__length_mismatch:__ld_n
mov r8d, ebp
mov edx, eax
call fcn.140001010
mov eax, 0xffffffff
jmp 0x140001b18
xorps xmm0, xmm0
lea rcx, [rsp + 0x70]
xorps xmm1, xmm1
xor edx, edx
mov r8d, pe_nt_image_headers64
movdqu xmmword [rsp + 0x48], xmm0
movdqu xmmword [rsp + 0x58], xmm1
call sub.VCRUNTIME140.dll_memset
mov dword [rsp + 0x3c], r12d
mov r8, rbx
mov dword [rsp + 0x40], 1
lea rdx, [rdi + 5]
mov dword [rsp + 0x44], 6
mov dword [rsp + 0x38], 1
test bl, bl
je 0x1400018b6
test rdx, rdx
je 0x1400018a4
lea rcx, [rsp + 0x70]
call sub.VCRUNTIME140.dll_memcpy
jmp 0x1400018b6
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, [0x140005500]
lea rcx, [rsp + 0x70]
call qword [sym.imp.WS2_32.dll_getaddrinfo]
mov ebp, eax
test eax, eax
je 0x140001911
cmp dword [0x140008658], 0
je 0x140001a3a
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, ebp
call fcn.140001010
mov eax, 0xffffffff
jmp 0x140001b18
mov rax, qword [rsp + 0x30]
mov rcx, qword [rax + 0x20]
test r15, r15
jne 0x140001945
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 eax, byte [rdi + 4]
lea rcx, [rdi + 5]
lea rbx, [r15 + 2]
add rcx, rax
mov rax, rbx
jmp 0x140001983
test rcx, rcx
je 0x140001953
movups xmm0, xmmword [rcx]
movups xmmword [r15], xmm0
jmp 0x14000196c
xorps xmm0, xmm0
movups xmmword [r15], 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 eax, byte [rdi + 4]
lea rbx, [r15 + 2]
lea rcx, [rdi + 5]
add rcx, rax
mov rax, rbx
test rbx, rbx
je 0x140001995
test rcx, rcx
je 0x140001990
movzx eax, word [rcx]
mov word [rbx], ax
jmp 0x1400019a7
xor edx, edx
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, [r15 + 4]
mov r9d, reloc.WS2_32.dll_shutdown
mov r8, rax
mov ecx, r12d
mov rsi, rax
call qword [sym.imp.WS2_32.dll_inet_ntop]
cmp dword [0x140008658], 0
je 0x140001a00
movzx ecx, word [rbx]
call qword [sym.imp.WS2_32.dll_htons]
movzx ebx, ax
call qword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
mov r9, rsi
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, rsi
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
movzx eax, byte [rdi + 3]
cmp al, 4
jne 0x140001b16
cmp ebp, 0x16
je 0x140001a44
cmp dword [0x140008658], 0
je 0x140001a3a
call qword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
lea rcx, str.____SOCKS_thread__08X__getAddressInfo_IPv6_selected__length_mismatch:__ld_n
mov r8d, ebp
mov edx, eax
call fcn.140001010
mov eax, 0xffffffff
jmp 0x140001b18
lea rsi, [r13 + 2]
mov ebp, reloc.WS2_32.dll_socket
mov word [r13], bp
lea rax, [rdi + 0x14]
test rsi, rsi
je 0x140001a6b
test rax, rax
je 0x140001a68
movzx eax, word [rax]
mov word [rsi], ax
jmp 0x140001a7d
mov word [rsi], 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]
add rdi, 4
lea rbx, [r13 + 8]
test rbx, rbx
je 0x140001aaa
test rdi, rdi
je 0x140001a97
movups xmm0, xmmword [rdi]
movups xmmword [rbx], xmm0
jmp 0x140001abc
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 rdi, rax
call qword [sym.imp.WS2_32.dll_inet_ntop]
cmp dword [0x140008658], 0
je 0x140001b0d
movzx ecx, word [rsi]
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, rdi
call fcn.140001010
mov rcx, rdi
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.1400037c0
add rsp, 0x188
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
pop rbx
ret