Function at 0x4014a0
Capabilities:
Resolve dns

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x13c
mov eax, dword [0x408004]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
mov ebx, dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo]
push esi
push edi
mov edi, dword [ebp + 8]
mov esi, 2
mov dword [ebp - 0x13c], edx
mov edx, dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__errno]
mov dword [ebp - 0x130], ecx
cmp byte [edi], 4
mov dword [ebp - 0x12c], 0
jne 0x40182d
lea eax, [ecx + 4]
mov word [ecx], si
mov dword [ebp - 0x134], eax
lea esi, [edi + 4]
test eax, eax
je 0x40150d
test esi, esi
je 0x401507
mov eax, dword [esi]
mov dword [ecx + 4], eax
jmp 0x401523
mov dword [eax], 0
call edx
mov dword [eax], 0x16
call ebx
mov ecx, dword [ebp - 0x130]
mov edx, dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__errno]
cmp byte [esi], 0
jne 0x401799
cmp byte [edi + 5], 0
jne 0x401799
cmp byte [edi + 6], 0
jne 0x401799
cmp byte [edi + 7], 0
je 0x401799
cmp dword [0x4083a0], 0
je 0x401562
push 0
push str._08X:_SOCKS_HandleClient_Socks4a_request_n
call fcn.004010b0
add esp, 8
mov ebx, dword [ebp + 0xc]
cmp ebx, 9
jge 0x4015a0
cmp dword [0x408398], 0
je 0x401b9b
push ebx
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
push eax
push str.____SOCKS_thread__08Xd__getAddressInfo_DNSv4a_selected__length_mismatch:__ld_n
call fcn.004010b0
add esp, 0xc
or eax, 0xffffffff
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00403830
mov esp, ebp
pop ebp
ret
xor esi, esi
mov edx, 8
mov dword [ebp - 0x138], esi
nop dword [eax]
lea eax, [edi + edx]
inc edx
cmp byte [eax], 0
lea ecx, [esi + 1]
cmovne ecx, esi
mov esi, ecx
cmp esi, 1
jne 0x4015d8
cmp dword [ebp - 0x138], 0
jne 0x4015dd
lea eax, [edi + edx]
mov dword [ebp - 0x138], eax
jmp 0x4015dd
cmp esi, 2
je 0x401617
cmp edx, ebx
jl 0x4015b0
cmp dword [0x408398], 0
je 0x401b9b
push ebx
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
push eax
push str.____SOCKS_thread__08Xd__getAddressInfo_DNSv4a_selected__corrup_request:__ld_n
call fcn.004010b0
add esp, 0xc
or eax, 0xffffffff
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00403830
mov esp, ebp
pop ebp
ret
lea eax, [ebp - 0x12c]
mov dword [ebp - 0x124], 2
push eax
lea eax, [ebp - 0x128]
mov dword [ebp - 0x120], 1
push eax
push 0x4052f0
push dword [ebp - 0x138]
xorps xmm0, xmm0
mov dword [ebp - 0x11c], 6
movlpd qword [ebp - 0x118], xmm0
movlpd qword [ebp - 0x110], xmm0
mov dword [ebp - 0x128], 1
call dword [sym.imp.WS2_32.dll_getaddrinfo]
mov esi, eax
test esi, esi
je 0x4016b4
cmp dword [0x408398], 0
je 0x401b9b
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
push eax
push esi
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
push eax
push str.____SOCKS_thread__08X__getAddressInfo_GetAddrInfoA_v4a_failed_with_error:__ld__ld_n
call fcn.004010b0
add esp, 0x10
or eax, 0xffffffff
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00403830
mov esp, ebp
pop ebp
ret
mov eax, dword [ebp - 0x12c]
mov ebx, dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__errno]
mov eax, dword [eax + 0x18]
test eax, eax
je 0x4016d5
mov ecx, dword [ebp - 0x130]
movups xmm0, xmmword [eax]
movups xmmword [ecx], xmm0
jmp 0x4016f5
mov eax, dword [ebp - 0x130]
xorps xmm0, xmm0
movups xmmword [eax], xmm0
call ebx
mov dword [eax], 0x16
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo]
mov ecx, dword [ebp - 0x130]
lea eax, [edi + 2]
add ecx, 2
je 0x40170e
test eax, eax
je 0x401709
mov ax, word [eax]
mov word [ecx], ax
jmp 0x40171c
xor eax, eax
mov word [ecx], ax
call ebx
mov dword [eax], 0x16
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo]
mov eax, dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_malloc]
push 0x16
call eax
add esp, 4
mov ebx, eax
mov eax, dword [sym.imp.WS2_32.dll_inet_ntop]
push 0x16
push ebx
push dword [ebp - 0x134]
push 2
call eax
cmp dword [0x408398], 0
je 0x401777
mov eax, dword [ebp - 0x130]
movzx ecx, word [eax + 2]
mov eax, dword [sym.imp.WS2_32.dll_htons]
push ecx
call eax
movzx eax, ax
push eax
mov eax, dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
push ebx
push dword [ebp - 0x138]
call eax
push eax
push str.___SOCKS_thread__08X__getAddressInfo_CONNECT_DNSv4a:__s__s_:_hd_n
call fcn.004010b0
add esp, 0x14
mov eax, dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
push ebx
call eax
mov edx, dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__errno]
add esp, 4
mov ebx, dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo]
mov ecx, dword [ebp - 0x130]
jmp 0x401830
lea ebx, [ecx + 2]
lea eax, [edi + 2]
test ebx, ebx
je 0x4017b4
test eax, eax
je 0x4017af
mov ax, word [eax]
mov word [ebx], ax
jmp 0x4017c2
xor eax, eax
mov word [ebx], ax
call edx
mov dword [eax], 0x16
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo]
mov eax, dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_malloc]
push 0x16
call eax
add esp, 4
mov esi, eax
mov eax, dword [sym.imp.WS2_32.dll_inet_ntop]
push 0x16
push esi
push dword [ebp - 0x134]
push 2
call eax
cmp dword [0x408398], 0
je 0x401810
movzx ecx, word [ebx]
mov eax, dword [sym.imp.WS2_32.dll_htons]
push ecx
call eax
movzx eax, ax
push eax
mov eax, dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
push esi
call eax
push eax
push str.___SOCKS_thread__08X__getAddressInfo_CONNECT_IPv4:__s:_hd_n
call fcn.004010b0
add esp, 0x10
mov eax, dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
push esi
call eax
mov edx, dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__errno]
add esp, 4
mov ebx, dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo]
mov ecx, dword [ebp - 0x130]
mov esi, dword [ebp + 0xc]
cmp byte [edi], 5
jne 0x401c77
mov al, byte [edi + 3]
cmp al, 1
jne 0x401946
cmp esi, 0xa
je 0x40187f
cmp dword [0x408398], 0
je 0x401b9b
push esi
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
push eax
push str.____SOCKS_thread__08Xd__getAddressInfo_IPv4_selected__length_mismatch:__ld_n
call fcn.004010b0
add esp, 0xc
or eax, 0xffffffff
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00403830
mov esp, ebp
pop ebp
ret
mov eax, 2
mov word [ecx], ax
lea eax, [edi + 8]
add ecx, 2
je 0x4018a0
test eax, eax
je 0x40189b
mov ax, word [eax]
mov word [ecx], ax
jmp 0x4018aa
xor eax, eax
mov word [ecx], ax
call edx
mov dword [eax], 0x16
call ebx
mov ebx, dword [ebp - 0x130]
lea eax, [edi + 4]
add ebx, 4
je 0x4018c8
test eax, eax
je 0x4018c2
mov eax, dword [eax]
mov dword [ebx], eax
jmp 0x4018db
mov dword [ebx], 0
mov eax, dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__errno]
call eax
mov dword [eax], 0x16
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo]
push 0x16
call dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_malloc]
add esp, 4
mov dword [ebp - 0x134], eax
push 0x16
push eax
push ebx
push 2
call dword [sym.imp.WS2_32.dll_inet_ntop]
cmp dword [0x408398], 0
je 0x401933
mov eax, dword [ebp - 0x130]
movzx ecx, word [eax + 2]
push ecx
call dword [sym.imp.WS2_32.dll_htons]
mov ebx, dword [ebp - 0x134]
movzx eax, ax
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
push eax
push str.___SOCKS_thread__08X__getAddressInfo_CONNECT_IPv4:__s:_hd_n
call fcn.004010b0
add esp, 0x10
jmp 0x401939
mov ebx, dword [ebp - 0x134]
push ebx
call dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov al, byte [edi + 3]
add esp, 4
cmp al, 3
jne 0x401b70
movzx ebx, byte [edi + 4]
lea eax, [ebx + 7]
cmp eax, esi
je 0x40198f
cmp dword [0x408398], 0
je 0x401b9b
push esi
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
push eax
push str.____SOCKS_thread__08X__getAddressInfo_DNS_selected__length_mismatch:__ld_n
call fcn.004010b0
add esp, 0xc
or eax, 0xffffffff
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00403830
mov esp, ebp
pop ebp
ret
push 0x100
xorps xmm0, xmm0
lea eax, [ebp - 0x108]
push 0
push eax
movlpd qword [ebp - 0x118], xmm0
movlpd qword [ebp - 0x110], xmm0
call sub.VCRUNTIME140.dll_memset
add esp, 0xc
mov dword [ebp - 0x124], 2
mov dword [ebp - 0x120], 1
lea eax, [edi + 5]
mov dword [ebp - 0x11c], 6
mov dword [ebp - 0x128], 1
test ebx, ebx
je 0x4019fc
test eax, eax
je 0x401a65
push ebx
push eax
lea eax, [ebp - 0x108]
push eax
call sub.VCRUNTIME140.dll_memcpy
add esp, 0xc
mov ebx, dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__errno]
lea eax, [ebp - 0x12c]
push eax
lea eax, [ebp - 0x128]
push eax
push 0x4052f0
lea eax, [ebp - 0x108]
push eax
call dword [sym.imp.WS2_32.dll_getaddrinfo]
mov esi, eax
test esi, esi
je 0x401a7b
cmp dword [0x408398], 0
je 0x401b9b
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
push eax
push esi
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
push eax
push str.____SOCKS_thread__08X__getAddressInfo_GetAddrInfoA_failed_with_error:__ld__ld_n
call fcn.004010b0
add esp, 0x10
or eax, 0xffffffff
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00403830
mov esp, ebp
pop ebp
ret
mov ebx, dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__errno]
call ebx
mov dword [eax], 0x16
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo]
jmp 0x401a02
mov eax, dword [ebp - 0x12c]
mov ecx, dword [ebp - 0x130]
mov eax, dword [eax + 0x18]
test ecx, ecx
jne 0x401ab2
call ebx
mov dword [eax], 0x16
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo]
mov ecx, dword [ebp - 0x130]
movzx eax, byte [edi + 4]
add ecx, 2
add eax, 5
mov edx, ecx
add eax, edi
jmp 0x401ae8
test eax, eax
je 0x401abe
movups xmm0, xmmword [eax]
movups xmmword [ecx], xmm0
jmp 0x401ad8
xorps xmm0, xmm0
movups xmmword [ecx], xmm0
call ebx
mov dword [eax], 0x16
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo]
mov ecx, dword [ebp - 0x130]
movzx eax, byte [edi + 4]
add eax, 5
add eax, edi
add ecx, 2
mov edx, ecx
je 0x401af9
test eax, eax
je 0x401af4
mov ax, word [eax]
mov word [ecx], ax
jmp 0x401b07
xor eax, eax
mov word [edx], ax
call ebx
mov dword [eax], 0x16
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo]
push 0x16
call dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_malloc]
mov ecx, dword [ebp - 0x130]
add esp, 4
mov ebx, eax
add ecx, 4
push 0x16
push ebx
push ecx
push 2
call dword [sym.imp.WS2_32.dll_inet_ntop]
cmp dword [0x408398], 0
je 0x401b63
mov eax, dword [ebp - 0x130]
movzx eax, word [eax + 2]
push eax
call dword [sym.imp.WS2_32.dll_htons]
movzx eax, ax
push eax
push ebx
lea eax, [ebp - 0x108]
push eax
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
push eax
push str.___SOCKS_thread__08X__getAddressInfo_CONNECT_DNS:__s__s_:_hd_n
call fcn.004010b0
add esp, 0x14
push ebx
call dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov al, byte [edi + 3]
add esp, 4
cmp al, 4
jne 0x401c77
cmp esi, 0x16
je 0x401baf
cmp dword [0x408398], 0
je 0x401b9b
push esi
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
push eax
push str.____SOCKS_thread__08X__getAddressInfo_IPv6_selected__length_mismatch:__ld_n
call fcn.004010b0
add esp, 0xc
or eax, 0xffffffff
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00403830
mov esp, ebp
pop ebp
ret
mov esi, dword [ebp - 0x13c]
mov eax, 0x17
lea ebx, [esi + 2]
mov word [esi], ax
lea eax, [edi + 0x14]
test ebx, ebx
je 0x401bd8
test eax, eax
je 0x401bd3
mov ax, word [eax]
mov word [ebx], ax
jmp 0x401bea
xor eax, eax
mov word [ebx], ax
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__errno]
mov dword [eax], 0x16
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo]
add edi, 4
add esi, 8
je 0x401c16
test edi, edi
je 0x401bfe
movups xmm0, xmmword [edi]
movups xmmword [esi], xmm0
jmp 0x401c28
xorps xmm0, xmm0
movups xmmword [esi], xmm0
movq qword [esi + 0x10], xmm0
mov dword [esi + 0x18], 0
mov word [esi + 0x1c], 0
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__errno]
mov dword [eax], 0x16
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo]
push 0x41
call dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_malloc]
add esp, 4
mov edi, eax
push 0x41
push edi
push esi
push 0x17
call dword [sym.imp.WS2_32.dll_inet_ntop]
cmp dword [0x408398], 0
je 0x401c6d
movzx ecx, word [ebx]
push ecx
call dword [sym.imp.WS2_32.dll_htons]
movzx eax, ax
push eax
push edi
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
push eax
push str.___SOCKS_thread__08X__getAddressInfo_CONNECT_IPv6:__s:_hd_n
call fcn.004010b0
add esp, 0x10
push edi
call dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
add esp, 4
mov ecx, dword [ebp - 4]
xor eax, eax
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.00403830
mov esp, ebp
pop ebp
ret