Function at 0x40249e
Capabilities:
Act as tcp client
Connect socket
Connect tcp socket
Connect udp socket
Create tcp socket
Create udp socket
Resolve dns
Set socket configuration

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x98
mov dword [0x41e060], 1
mov eax, dword [ebp + 8]
movzx eax, byte [eax]
test al, al
jne 0x4024de
mov dword [0x41e060], 0
mov dword [esp], 0x3e8
call sym._Sleep_4
sub esp, 4
mov eax, 0x3e8
jmp 0x402730
mov eax, dword [ebp + 8]
mov dword [esp], eax
call sym._gethostbyname_4
sub esp, 4
mov dword [ebp - 0x10], eax
mov dword [esp + 8], 0
mov dword [esp + 4], 1
mov dword [esp], 2
call sym._socket_12
sub esp, 0xc
mov dword [ebp - 0x14], eax
cmp dword [ebp - 0x14], 0xffffffff
jne 0x40254e
mov dword [0x41e060], 0
call sym.__errno
mov eax, dword [eax]
mov dword [esp + 8], eax
mov dword [esp + 4], str.Failed_to_create_INET_socket__error__d_n
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
mov dword [esp], eax
call sym._fprintf
mov eax, 1
jmp 0x402730
mov dword [esp + 8], 0x10
mov dword [esp + 4], 0
lea eax, [ebp - 0x34]
mov dword [esp], eax
call sym._memset
mov word [ebp - 0x34], 2
mov eax, dword [ebp - 0x10]
movzx eax, word [eax + 0xa]
movsx edx, ax
mov eax, dword [ebp - 0x10]
mov eax, dword [eax + 0xc]
mov eax, dword [eax]
mov dword [esp + 8], edx
mov dword [esp + 4], eax
lea eax, [ebp - 0x34]
add eax, 4
mov dword [esp], eax
call sym._memcpy
mov eax, dword [ebp + 0xc]
movzx eax, ax
mov dword [esp], eax
call sym._htons_4
sub esp, 4
mov word [ebp - 0x32], ax
mov eax, dword [ebp - 0x10]
mov eax, dword [eax + 0xc]
mov dword [ebp - 0x18], eax
mov dword [ebp - 0x54], 2
mov dword [ebp - 0x50], 0
mov eax, dword [ebp - 0x14]
mov dword [esp + 0x10], 8
lea edx, [ebp - 0x54]
mov dword [esp + 0xc], edx
mov dword [esp + 8], 0x1006
mov dword [esp + 4], 0xffff
mov dword [esp], eax
call sym._setsockopt_20
sub esp, 0x14
mov dword [ebp - 0x1c], eax
cmp dword [ebp - 0x1c], 0
jns 0x40261c
call sym.__errno
mov eax, dword [eax]
mov dword [esp + 8], eax
mov dword [esp + 4], str.Failed_setsockopt_SO_RCVTIMEO__error__d_n
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
mov dword [esp], eax
call sym._fprintf
mov eax, dword [ebp - 0x14]
mov dword [esp + 0x10], 8
lea edx, [ebp - 0x54]
mov dword [esp + 0xc], edx
mov dword [esp + 8], 0x1005
mov dword [esp + 4], 0xffff
mov dword [esp], eax
call sym._setsockopt_20
sub esp, 0x14
mov dword [ebp - 0x1c], eax
cmp dword [ebp - 0x1c], 0
jns 0x402675
call sym.__errno
mov eax, dword [eax]
mov dword [esp + 8], eax
mov dword [esp + 4], str.Failed_setsockopt_SO_SNDTIMEO__error__d_n
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
mov dword [esp], eax
call sym._fprintf
mov dword [esp + 4], 0
lea eax, [ebp - 0x5c]
mov dword [esp], eax
call sym._gettimeofday
mov eax, dword [ebp - 0x14]
mov dword [esp + 8], 0x10
lea edx, [ebp - 0x34]
mov dword [esp + 4], edx
mov dword [esp], eax
call sym._connect_12
sub esp, 0xc
mov dword [ebp - 0x1c], eax
cmp dword [ebp - 0x1c], 0xffffffff
jne 0x4026c5
call sym._WSAGetLastError_0
mov dword [ebp - 0x20], eax
mov eax, dword [ebp - 0x14]
mov dword [esp], eax
call sym._closesocket_4
sub esp, 4
nop
mov dword [esp + 4], 0
lea eax, [ebp - 0x64]
mov dword [esp], eax
call sym._gettimeofday
lea eax, [ebp - 0x5c]
mov dword [esp + 4], eax
lea eax, [ebp - 0x64]
mov dword [esp], eax
call sym.timeval_subtract_timeval_const__timeval_const_
mov dword [ebp - 0x24], eax
mov eax, dword [ebp - 0x14]
mov dword [esp], eax
call sym._closesocket_4
sub esp, 4
mov dword [0x41e060], 0
mov ecx, dword [ebp - 0x24]
mov edx, 0x10624dd3
mov eax, ecx
imul edx
sar edx, 6
mov eax, ecx
sar eax, 0x1f
sub edx, eax
mov eax, edx
mov dword [ebp - 0xc], eax
cmp dword [ebp - 0xc], 0
jne 0x40272d
mov dword [ebp - 0xc], 1
mov eax, dword [ebp - 0xc]
leave
ret