Function at 0x40a500
Capabilities:
Reference cloudflare dns server

Disassembly:
sub esp, 0x11c
mov eax, dword [esp + 0x120]
mov ecx, dword [0x418d10]
cmp eax, 2
push ebx
mov word [esp + 4], ax
mov dword [esp + 0x10], ecx
jne 0x40a558
mov eax, dword [0x41bd10]
test eax, eax
jne 0x40a535
mov al, 1
pop ebx
add esp, 0x11c
ret
mov edx, dword [0x418ce4]
lea ecx, [esp + 4]
push ecx
mov dword [esp + 0xc], 0x4186a0
mov dword [esp + 0x10], edx
call eax
mov al, 1
pop ebx
add esp, 0x11c
ret
cmp eax, 3
jne 0x40a58b
mov eax, dword [0x41bd10]
test eax, eax
jne 0x40a570
mov al, 1
pop ebx
add esp, 0x11c
ret
mov edx, dword [0x41b594]
lea ecx, [esp + 4]
push ecx
mov dword [esp + 0x1c], edx
call eax
mov al, 1
pop ebx
add esp, 0x11c
ret
cmp eax, 4
jne 0x40a5a7
mov eax, dword [0x41bd10]
test eax, eax
jne 0x40a737
mov al, 1
pop ebx
add esp, 0x11c
ret
cmp eax, 1
jne 0x40a5eb
mov eax, dword [0x41bd10]
xor ebx, ebx
cmp eax, ebx
jne 0x40a5c1
mov al, 1
pop ebx
add esp, 0x11c
ret
lea ecx, [esp + 4]
push ecx
call eax
mov edx, dword [0x41bd0c]
push edx
call dword [sym.imp.KERNEL32.dll_FreeLibrary]
mov dword [0x41bd0c], ebx
mov dword [0x41bd10], ebx
mov al, 1
pop ebx
add esp, 0x11c
ret
xor ebx, ebx
cmp eax, ebx
jne 0x40a6d7
cmp dword [0x41bd0c], ebx
je 0x40a607
mov al, 1
pop ebx
add esp, 0x11c
ret
push str.drcomdll.dll
call dword [sym.imp.KERNEL32.dll_LoadLibraryA]
cmp eax, ebx
mov dword [0x41bd0c], eax
jne 0x40a64e
push str.drcomdll.dll
lea eax, [esp + 0xa4]
push str._tLoadLibrary____s___error
push eax
call dword [sym.imp.USER32.dll_wsprintfA]
lea ecx, [esp + 0xac]
push ebx
push ecx
call fcn.00406100
add esp, 0x14
mov al, 1
pop ebx
add esp, 0x11c
ret
push str.GetInfo
push eax
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
cmp eax, ebx
mov dword [0x41bd10], eax
jne 0x40a68e
mov edx, dword [0x41bd0c]
push edx
call dword [sym.imp.KERNEL32.dll_FreeLibrary]
push ebx
push str.GetDll_error
mov dword [0x41bd0c], ebx
call fcn.00406100
add esp, 8
mov al, 1
pop ebx
add esp, 0x11c
ret
mov ecx, dword [0x41b648]
lea edx, [esp + 4]
push edx
mov dword [esp + 0x18], ecx
call eax
mov eax, dword [esp + 6]
lea ecx, [esp + 0xa0]
and eax, 0xffff
push eax
push str.dllver_lu
push ecx
call dword [sym.imp.USER32.dll_wsprintfA]
lea edx, [esp + 0xac]
push ebx
push edx
call fcn.00406100
add esp, 0x14
mov al, 1
pop ebx
add esp, 0x11c
ret
cmp eax, 5
je 0x40a880
cmp eax, 8
je 0x40a880
cmp eax, 6
jne 0x40a748
mov eax, dword [0x41bd10]
cmp eax, ebx
jne 0x40a71b
mov eax, dword [0x41a574]
mov ecx, dword [0x41a570]
push eax
push 0x41a578
push ecx
call fcn.00401d70
add esp, 0xc
mov al, 1
pop ebx
add esp, 0x11c
ret
mov edx, dword [0x41a574]
mov ecx, dword [0x41a570]
mov dword [esp + 8], 0x41a578
mov dword [esp + 0xc], edx
mov dword [esp + 0x18], ecx
lea edx, [esp + 4]
push edx
call eax
mov al, 1
pop ebx
add esp, 0x11c
ret
cmp eax, 7
jne 0x40a76d
mov eax, dword [0x41bd10]
mov byte [esp + 0x1c], bl
cmp eax, ebx
je 0x40a761
lea ecx, [esp + 4]
push ecx
call eax
mov al, byte [esp + 0x1c]
pop ebx
add esp, 0x11c
ret
cmp eax, 9
jne 0x40a784
mov eax, dword [0x41bd10]
cmp eax, ebx
pop ebx
setne al
add esp, 0x11c
ret
cmp eax, 0xa
jne 0x40a876
mov eax, dword [0x41bd10]
cmp eax, ebx
jne 0x40a7c9
push str.drcomdll.dll
lea edx, [esp + 0xa4]
push str.can_not_open__s
push edx
call dword [sym.imp.USER32.dll_wsprintfA]
lea eax, [esp + 0xac]
push ebx
push eax
call fcn.004038a0
add esp, 0x14
xor al, al
pop ebx
add esp, 0x11c
ret
lea ecx, [esp + 4]
push ecx
call eax
mov al, byte [esp + 0x1c]
cmp al, bl
mov eax, dword [0x41b504]
je 0x40a86c
cmp eax, ebx
jne 0x40a862
cmp byte [esp + 0x20], bl
je 0x40a862
push esi
push edi
mov edi, str.1.1.1.1
or ecx, 0xffffffff
xor eax, eax
push 0x41b610
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov edx, ecx
mov esi, edi
mov edi, 0x41b610
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
call fcn.00406600
mov dword [0x41b594], eax
lea eax, [esp + 0x2c]
push 0x1b
push eax
push 0x41b538
call dword [sym.imp.MSVCRT.dll_strncpy]
mov edi, 0x4146f4
or ecx, 0xffffffff
xor eax, eax
add esp, 0x10
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov edx, ecx
mov esi, edi
mov edi, 0x41b553
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
call fcn.0040abd0
pop edi
pop esi
mov al, 1
pop ebx
add esp, 0x11c
ret
cmp eax, 0xa
jl 0x40a876
call fcn.00401540
mov al, 1
pop ebx
add esp, 0x11c
ret
mov eax, dword [0x41bd10]
cmp eax, ebx
jne 0x40a893
mov al, 1
pop ebx
add esp, 0x11c
ret
mov ecx, dword [0x418ce4]
mov edx, dword [0x41b594]
mov dword [esp + 0xc], ecx
lea ecx, [esp + 4]
push ecx
mov dword [esp + 0xc], 0x4186a0
mov byte [esp + 0x20], 1
mov dword [esp + 0x1c], edx
call eax
mov al, byte [esp + 0x1c]
cmp al, bl
jne 0x40a8d3
mov dword [0x41bc44], ebx
mov dword [0x41bc3c], 5
pop ebx
add esp, 0x11c
ret