Function at 0x402340
Capabilities:
Resolve dns

Disassembly:
sub esp, 8
push ebx
push ebp
mov ebp, dword [esp + 0x14]
xor ebx, ebx
push esi
cmp ebp, ebx
push edi
mov dword [esp + 0x10], ebx
mov dword [0x40fcd4], ebx
je 0x402372
push 0x1e0
call fcn.00402260
add esp, 4
cmp eax, ebx
mov dword [esp + 0x10], eax
mov ebx, eax
jne 0x40237f
push str.gethostpoop_fuxored
call fcn.004021f0
add esp, 4
mov edi, str._UNKNOWN_
or ecx, 0xffffffff
xor eax, eax
push ebp
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov eax, ecx
mov esi, edi
mov edi, ebx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
call dword [sym.imp.WS2_32.dll_inet_addr]
cmp eax, 0xffffffff
mov dword [esp + 0x14], eax
jne 0x4024cf
cmp word [esp + 0x20], 0
je 0x4023cb
push ebp
push str.Cant_parse__s_as_an_IP_address
call fcn.004021f0
add esp, 8
push ebp
call dword [sym.imp.WS2_32.dll_gethostbyname]
mov ebp, eax
test ebp, ebp
jne 0x4023f1
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov ecx, dword [esp + 0x1c]
push eax
push ecx
push str._s:_forward_host_lookup_failed:_h_errno__d
call fcn.004021f0
add esp, 0xc
mov edx, dword [ebp]
push 0x100
push edx
push ebx
call fcn.00404630
mov eax, dword [ebp + 0xc]
add esp, 0xc
cmp dword [eax], 0
je 0x40244f
xor esi, esi
lea edi, [ebx + 0x100]
add ebx, 0x1c0
cmp esi, 0x20
jge 0x40244b
mov eax, dword [esi + eax]
push 0x18
mov eax, dword [eax]
push eax
mov dword [ebx], eax
call dword [sym.imp.WS2_32.dll_inet_ntoa]
push eax
push edi
call fcn.00404630
mov eax, dword [ebp + 0xc]
add esi, 4
add esp, 0xc
add edi, 0x18
mov ecx, dword [esi + eax]
add ebx, 4
test ecx, ecx
jne 0x402419
mov ebx, dword [esp + 0x10]
cmp word [0x40fcbe], 0
je 0x40258a
mov eax, dword [ebx + 0x1c0]
lea esi, [ebx + 0x1c0]
xor ebp, ebp
test eax, eax
je 0x40258a
lea edi, [ebx + 0x100]
cmp ebp, 8
jge 0x40258a
push 2
push 4
push esi
call dword [sym.imp.WS2_32.dll_gethostbyaddr]
test eax, eax
je 0x4024a2
cmp dword [eax], 0
je 0x4024a2
push eax
push ebx
call fcn.004022f0
add esp, 8
jmp 0x4024b7
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
push eax
push edi
push str.Warning:_inverse_host_lookup_failed_for__s:_h_errno__d
call fcn.00402150
add esp, 0xc
mov eax, dword [esi + 4]
add esi, 4
inc ebp
add edi, 0x18
test eax, eax
jne 0x402479
pop edi
pop esi
mov eax, ebx
pop ebp
pop ebx
add esp, 8
ret
mov dword [ebx + 0x1c0], eax
mov ecx, dword [esp + 0x14]
push 0xc0
push ecx
call dword [sym.imp.WS2_32.dll_inet_ntoa]
lea edx, [ebx + 0x100]
push eax
push edx
call fcn.00404630
add esp, 0xc
cmp word [esp + 0x20], 0
jne 0x40258a
cmp word [0x40fcbe], 0
je 0x40258a
push 2
lea eax, [esp + 0x18]
push 4
push eax
call dword [sym.imp.WS2_32.dll_gethostbyaddr]
test eax, eax
jne 0x40253d
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
push eax
push ebp
push str._s:_inverse_host_lookup_failed:_h_errno__d
call fcn.00402150
add esp, 0xc
mov eax, ebx
pop edi
pop esi
pop ebp
pop ebx
add esp, 8
ret
mov ecx, dword [eax]
push 0xfe
push ecx
push ebx
call fcn.00404630
add esp, 0xc
push ebx
call dword [sym.imp.WS2_32.dll_gethostbyname]
test eax, eax
je 0x402575
mov edx, dword [eax + 0xc]
cmp dword [edx], 0
je 0x402575
push eax
push ebx
call fcn.004022f0
add esp, 8
mov eax, ebx
pop edi
pop esi
pop ebp
pop ebx
add esp, 8
ret
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
push eax
push ebx
push str.Warning:_forward_host_lookup_failed_for__s:_h_errno__d
call fcn.00402150
add esp, 0xc
pop edi
pop esi
mov eax, ebx
pop ebp
pop ebx
add esp, 8
ret