Function at 0x401050
Capabilities:
Link many functions at runtime
Reference google public dns server

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff0
sub esp, 0x98
mov eax, dword [0x404004]
xor eax, esp
mov dword [esp + 0x94], eax
push esi
push edi
mov edi, dword [sym.imp.KERNEL32.dll_GetModuleHandleA]
push str.NtDeviceIoControlFile
push str.ntdll.dll
call edi
mov esi, dword [sym.imp.KERNEL32.dll_GetProcAddress]
push eax
call esi
push str.NtCreateFile
push str.ntdll.dll
mov dword [0x404388], eax
call edi
push eax
call esi
push str.NtCreateEvent
push str.ntdll.dll
mov dword [0x404394], eax
call edi
push eax
call esi
push str.NtClose
push str.ntdll.dll
mov dword [0x404390], eax
call edi
push eax
call esi
push str.NtWaitForSingleObject
push str.ntdll.dll
mov dword [0x40438c], eax
call edi
push eax
call esi
mov ecx, 0x16
mov dword [0x404398], eax
add ecx, 0x1a
mov dword [esp + 0xc], 0x2a0028
xorps xmm0, xmm0
mov dword [esp + 0x10], str.DeviceAfdEndpoint
mov eax, 0x18
movaps xmmword [esp + 0x70], xmm0
movaps xmmword [esp + 0x80], xmm0
lea edi, [ecx + 0x18]
mov word [esp + 0x52], ax
push edi
mov dword [esp + 0x18], 0
mov dword [esp + 0xc], ecx
call dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_malloc]
mov esi, eax
add esp, 4
test esi, esi
jne 0x401137
mov edi, 0xc000009a
jmp 0x401208
push edi
push 0
push esi
call sub.VCRUNTIME140.dll_memset
mov eax, dword [esp + 0x14]
add esp, 0xc
mov dword [esi], 0
mov word [esi + 4], 0xf00
movups xmm0, xmmword [str.AfdOpenPacketXX]
push edi
push esi
movups xmmword [esi + 8], xmm0
mov word [esi + 6], ax
mov eax, str.DeviceTcp
mov dword [esi + 0x1c], 0
mov dword [esi + 0x18], 0x10
mov dword [esi + 0x20], 2
mov dword [esi + 0x24], 1
mov dword [esi + 0x28], 6
mov dword [esi + 0x2c], 0x16
movups xmm0, xmmword [eax]
push 0
push 3
movups xmmword [esi + 0x30], xmm0
push 3
movq xmm0, qword [eax + 0x10]
lea eax, [esp + 0x20]
movq qword [esi + 0x40], xmm0
push 0
mov dword [esp + 0x40], eax
lea eax, [esp + 0x68]
push 0
push eax
lea eax, [esp + 0x40]
mov dword [esp + 0x40], 0x18
push eax
push 0xc0100000
lea eax, [esp + 0x3c]
mov dword [esp + 0x4c], 0
push eax
mov dword [esp + 0x58], 0x42
mov dword [esp + 0x5c], 0
mov dword [esp + 0x60], 0
call dword [0x404394]
push esi
mov edi, eax
call dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
add esp, 4
test edi, edi
je 0x401216
push edi
push str.AfdCreateSocket_failed_with__lx_n
call fcn.00401010
add esp, 8
xorps xmm0, xmm0
push 0
movaps xmmword [esp + 0x54], xmm0
call dword [sym.imp.WS2_32.dll_htons]
push 0
push 0
mov word [esp + 0x5a], ax
mov eax, dword [esp + 0x1c]
push 0
mov dword [esp + 0x14], eax
lea eax, [esp + 0x18]
push 0x1f0003
push eax
call dword [0x404390]
mov edi, eax
test edi, edi
js 0x4012fd
push 0x1a
call dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_malloc]
mov esi, eax
add esp, 4
test esi, esi
jne 0x401278
push dword [esp + 0xc]
call dword [0x40438c]
mov edi, 0xc000009a
jmp 0x4012fd
movq xmm0, qword [esp + 0x52]
mov eax, dword [esp + 0x5a]
push 0x1a
push esi
push 0x1a
mov dword [esi], 0
mov dword [esi + 4], 1
mov dword [esi + 8], 0x2000e
movq qword [esi + 0xc], xmm0
mov dword [esi + 0x14], eax
mov ax, word [esp + 0x6a]
push esi
push 0x12003
mov word [esi + 0x18], ax
lea eax, [esp + 0x7c]
push eax
push 0
push 0
push dword [esp + 0x2c]
push dword [esp + 0x2c]
call dword [0x404388]
mov edi, eax
cmp edi, 0x103
jne 0x4012e5
push 0
push 0
push dword [esp + 0x14]
call dword [0x404398]
mov edi, dword [esp + 0x68]
push esi
call dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
add esp, 4
push dword [esp + 0xc]
call dword [0x40438c]
test edi, edi
je 0x40130b
push edi
push str.AfdBind_failed_with__lx_n
call fcn.00401010
add esp, 8
xorps xmm0, xmm0
push str.8.8.8.8
movaps xmmword [esp + 0x54], xmm0
call dword [sym.imp.WS2_32.dll_inet_addr]
push 0x35
mov dword [esp + 0x58], eax
call dword [sym.imp.WS2_32.dll_htons]
push 0
push 0
mov word [esp + 0x5a], ax
mov eax, dword [esp + 0x1c]
push 0
mov dword [esp + 0x14], eax
lea eax, [esp + 0x18]
push 0x1f0003
push eax
call dword [0x404390]
mov edi, eax
test edi, edi
jns 0x40135a
mov esi, eax
jmp 0x40140e
push 0x22
call dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_malloc]
mov esi, eax
add esp, 4
test esi, esi
jne 0x40137f
push dword [esp + 0xc]
call dword [0x40438c]
mov esi, 0xc000009a
jmp 0x401429
movq xmm0, qword [esp + 0x52]
mov eax, dword [esp + 0x5a]
push 0
push 0
push 0x22
mov byte [esi], 0
mov dword [esi + 4], 0
mov dword [esi + 8], 0
mov dword [esi + 0xc], 1
mov dword [esi + 0x10], 0x2000e
movq qword [esi + 0x14], xmm0
mov dword [esi + 0x1c], eax
mov ax, word [esp + 0x6a]
push esi
push 0x12007
mov word [esi + 0x20], ax
lea eax, [esp + 0x7c]
push eax
push 0
push 0
push dword [esp + 0x2c]
push dword [esp + 0x2c]
call dword [0x404388]
mov edi, eax
cmp edi, 0x103
jne 0x4013f8
push 0
push 0
push dword [esp + 0x14]
call dword [0x404398]
mov edi, dword [esp + 0x68]
push esi
call dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
add esp, 4
push dword [esp + 0xc]
call dword [0x40438c]
mov esi, edi
cmp edi, 0xc0000022
jne 0x401425
push str.Internet_connection_not_allowed_n
call fcn.00401010
add esp, 4
jmp 0x401429
test edi, edi
je 0x401437
push esi
push str.AfdConnect_failed_with__lx_n
call fcn.00401010
add esp, 8
mov edi, dword [esp + 0x14]
lea eax, [esp + 8]
push 0
push 0
push 0
xorps xmm0, xmm0
push 0x1f0003
push eax
movaps xmmword [esp + 0x54], xmm0
movlpd qword [esp + 0x2c], xmm0
call dword [0x404390]
mov esi, eax
test esi, esi
js 0x4014e3
push 0
push 0
lea eax, [esp + 0x78]
mov dword [esp + 0x20], 0x20
mov dword [esp + 0x24], eax
lea eax, [esp + 0x20]
push 0x10
mov dword [esp + 0x4c], eax
lea eax, [esp + 0x4c]
push eax
push 0x1201f
lea eax, [esp + 0x64]
mov dword [esp + 0x58], 1
push eax
push 0
push 0
push dword [esp + 0x28]
mov dword [esp + 0x70], 0
push edi
mov dword [esp + 0x70], 0
call dword [0x404388]
mov esi, eax
cmp esi, 0x103
jne 0x4014d5
push 0
push 0
push dword [esp + 0x10]
call dword [0x404398]
mov esi, dword [esp + 0x50]
push dword [esp + 8]
call dword [0x40438c]
test esi, esi
je 0x4014f1
push esi
push str.AfdSend_failed_with__lx_n
call fcn.00401010
add esp, 8
mov edi, dword [esp + 0x14]
lea eax, [esp + 0xc]
push 0
push 0
push 0
push 0x1f0003
push eax
call dword [0x404390]
mov esi, eax
test esi, esi
js 0x4015a4
push 0
push 0
lea eax, [esp + 0x78]
mov dword [esp + 0x40], 0x20
mov dword [esp + 0x44], eax
lea eax, [esp + 0x40]
push 0x10
mov dword [esp + 0x2c], eax
lea eax, [esp + 0x2c]
push eax
push 0x12017
lea eax, [esp + 0x7c]
mov dword [esp + 0x38], 1
push eax
push 0
push 0
push dword [esp + 0x2c]
mov dword [esp + 0x4c], 0
push edi
mov dword [esp + 0x54], 0x20
call dword [0x404388]
mov esi, eax
cmp esi, 0x103
jne 0x401596
push 0
push 0
push dword [esp + 0x14]
call dword [0x404398]
push dword [esp + 0x6c]
mov esi, dword [esp + 0x6c]
push 0x403174
call fcn.00401010
add esp, 8
push dword [esp + 0xc]
call dword [0x40438c]
test esi, esi
je 0x4015b2
push esi
push str.AfdRecv_failed_with__lx_n
call fcn.00401010
add esp, 8
push str.Response:_
call fcn.00401010
add esp, 4
xor esi, esi
movsx eax, byte [esp + esi + 0x70]
push eax
push 0x4032a8
call fcn.00401010
inc esi
add esp, 8
cmp esi, 0x20
jb 0x4015c1
push 0x4032ac
call fcn.00401010
mov ecx, dword [esp + 0xa0]
add esp, 4
xor eax, eax
pop edi
pop esi
xor ecx, esp
call fcn.004015fd
mov esp, ebp
pop ebp
ret