Function at 0x402310
Capabilities:
Resolve dns
Set socket configuration

Disassembly:
sub esp, 8
push ebx
push ebp
mov ebp, dword [esp + 0x14]
xor ebx, ebx
push esi
push edi
test ebp, ebp
mov dword [esp + 0x10], ebx
mov dword [0x40fcd0], ebx
je 0x40233e
push 0x1e0
call fcn.00402230
add esp, 4
mov dword [esp + 0x10], eax
mov ebx, eax
test ebx, ebx
jne 0x40234f
push str.gethostpoop_fuxored
call fcn.004021c0
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 sub.WSOCK32.dll_inet_addr
cmp eax, 0xffffffff
mov dword [esp + 0x14], eax
jne 0x402499
cmp word [esp + 0x20], 0
je 0x40239a
push ebp
push str.Cant_parse__s_as_an_IP_address
call fcn.004021c0
add esp, 8
push ebp
call sub.WSOCK32.dll_gethostbyname
mov ebp, eax
test ebp, ebp
jne 0x4023be
call sub.WSOCK32.dll_WSAGetLastError
mov ecx, dword [esp + 0x1c]
push eax
push ecx
push str._s:_forward_host_lookup_failed:_h_errno__d
call fcn.004021c0
add esp, 0xc
mov edx, dword [ebp]
push 0x100
push edx
push ebx
call fcn.00404610
mov eax, dword [ebp + 0xc]
add esp, 0xc
cmp dword [eax], 0
je 0x40241b
xor esi, esi
lea edi, [ebx + 0x100]
add ebx, 0x1c0
cmp esi, 0x20
jge 0x402417
mov eax, dword [esi + eax]
push 0x18
mov eax, dword [eax]
push eax
mov dword [ebx], eax
call sub.WSOCK32.dll_inet_ntoa
push eax
push edi
call fcn.00404610
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 0x4023e6
mov ebx, dword [esp + 0x10]
cmp word [0x40fcb8], 0
je 0x40254f
mov eax, dword [ebx + 0x1c0]
lea esi, [ebx + 0x1c0]
xor ebp, ebp
test eax, eax
je 0x40254f
lea edi, [ebx + 0x100]
cmp ebp, 8
jge 0x40254f
push 2
push 4
push esi
call sub.WSOCK32.dll_gethostbyaddr
test eax, eax
je 0x40246d
cmp dword [eax], 0
je 0x40246d
push eax
push ebx
call fcn.004022c0
add esp, 8
jmp 0x402481
call sub.WSOCK32.dll_WSAGetLastError
push eax
push edi
push str.Warning:_inverse_host_lookup_failed_for__s:_h_errno__d
call fcn.00402120
add esp, 0xc
mov eax, dword [esi + 4]
add esi, 4
inc ebp
add edi, 0x18
test eax, eax
jne 0x402445
mov eax, ebx
pop edi
pop esi
pop ebp
pop ebx
add esp, 8
ret
mov dword [ebx + 0x1c0], eax
mov ecx, dword [esp + 0x14]
push 0xc0
push ecx
call sub.WSOCK32.dll_inet_ntoa
lea edx, [ebx + 0x100]
push eax
push edx
call fcn.00404610
add esp, 0xc
cmp word [esp + 0x20], 0
jne 0x40254f
cmp word [0x40fcb8], 0
je 0x40254f
push 2
lea eax, [esp + 0x18]
push 4
push eax
call sub.WSOCK32.dll_gethostbyaddr
test eax, eax
jne 0x402504
call sub.WSOCK32.dll_WSAGetLastError
push eax
push ebp
push str._s:_inverse_host_lookup_failed:_h_errno__d
call fcn.00402120
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.00404610
add esp, 0xc
push ebx
call sub.WSOCK32.dll_gethostbyname
test eax, eax
je 0x40253b
mov edx, dword [eax + 0xc]
cmp dword [edx], 0
je 0x40253b
push eax
push ebx
call fcn.004022c0
add esp, 8
mov eax, ebx
pop edi
pop esi
pop ebp
pop ebx
add esp, 8
ret
call sub.WSOCK32.dll_WSAGetLastError
push eax
push ebx
push str.Warning:_forward_host_lookup_failed_for__s:_h_errno__d
call fcn.00402120
add esp, 0xc
pop edi
pop esi
mov eax, ebx
pop ebp
pop ebx
add esp, 8
ret