Function at 0x40c065
Capabilities:
Connect socket
Get socket status
Resolve dns
Set socket configuration

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x270
push edi
xor edi, edi
mov dword [ebp - 4], edi
cmp dword [ebp + 8], edi
je 0x40c3b3
test dword [ebp + 0x10], 0x10000000
je 0x40c096
and dword [ebp + 0x10], 0xefffffff
mov dword [ebp - 8], 0x17
jmp 0x40c09d
mov dword [ebp - 8], 2
cmp dword [ebp + 0x10], edi
jne 0x40c0a9
mov dword [ebp + 0x10], 1
push ebx
push edi
push dword [ebp + 0x10]
push dword [ebp - 8]
call dword [sym.imp.WSOCK32.DLL_socket]
mov ebx, eax
cmp ebx, 0xffffffff
je 0x40c3b2
push esi
push dword [ebp + 8]
call fcn.00436530
cmp dword [ebp - 8], 0x17
mov esi, eax
mov dword [ebp + 8], esi
jne 0x40c123
cmp dword [0x48288c], edi
je 0x40c39c
lea eax, [ebp - 0x68]
push eax
push esi
push 0x17
call fcn.0040bca9
add esp, 0xc
test eax, eax
jg 0x40c158
lea eax, [ebp - 0x14]
push eax
push edi
push edi
push esi
call dword [0x482890]
test eax, eax
jne 0x40c39c
mov eax, dword [ebp - 0x14]
mov esi, dword [eax + 0x18]
add esi, 8
lea edi, [ebp - 0x68]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
push eax
movsd dword es:[edi], dword [esi]
call dword [0x482894]
jmp 0x40c158
push esi
call dword [sym.imp.WSOCK32.DLL_inet_addr]
mov dword [ebp - 0x10], eax
cmp eax, 0xffffffff
jne 0x40c147
push esi
call dword [sym.imp.WSOCK32.DLL_gethostbyname]
cmp eax, edi
je 0x40c147
mov eax, dword [eax + 0xc]
mov eax, dword [eax]
mov eax, dword [eax]
mov dword [ebp - 0x10], eax
xor eax, eax
cmp dword [ebp - 0x10], 0xffffffff
setne al
cmp eax, edi
je 0x40c39c
cmp dword [ebp + 0x1c], 0
mov esi, dword [sym.imp.WSOCK32.DLL_htons]
mov edi, dword [ebp + 0x18]
jne 0x40c171
test edi, edi
je 0x40c1d4
cmp word [edi], 0
je 0x40c1d4
push 0x10
lea eax, [ebp - 0x3c]
push 0
push eax
call sub.MSVCRT.dll_memset
add esp, 0xc
cmp dword [ebp + 0x1c], 0
push 2
pop eax
mov word [ebp - 0x3c], ax
je 0x40c197
push dword [ebp + 0x1c]
call esi
mov word [ebp - 0x3a], ax
test edi, edi
je 0x40c1bb
cmp word [edi], 0
je 0x40c1bb
push edi
call fcn.00436410
mov edi, eax
push edi
call dword [sym.imp.WSOCK32.DLL_inet_addr]
push edi
mov dword [ebp - 0x38], eax
call fcn.004364a0
jmp 0x40c1bf
and dword [ebp - 0x38], 0
push 0x10
lea eax, [ebp - 0x3c]
push eax
push ebx
call dword [sym.imp.WSOCK32.DLL_bind]
test eax, eax
jne 0x40c39c
xor edi, edi
inc edi
cmp dword [ebp + 0x10], edi
jne 0x40c356
cmp dword [ebp - 8], 0x17
jne 0x40c215
push 0x1c
lea eax, [ebp - 0x58]
push 0
push eax
call sub.MSVCRT.dll_memset
add esp, 0xc
push 0x17
pop eax
push dword [ebp + 0xc]
mov word [ebp - 0x58], ax
call esi
mov word [ebp - 0x56], ax
lea esi, [ebp - 0x68]
lea edi, [ebp - 0x50]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
xor edi, edi
inc edi
jmp 0x40c23b
push 0x10
lea eax, [ebp - 0x2c]
push 0
push eax
call sub.MSVCRT.dll_memset
add esp, 0xc
push 2
pop eax
push dword [ebp + 0xc]
mov word [ebp - 0x2c], ax
call esi
mov word [ebp - 0x2a], ax
mov eax, dword [ebp - 0x10]
mov dword [ebp - 0x28], eax
mov esi, dword [ebp + 0x14]
test esi, esi
jle 0x40c30d
lea eax, [ebp - 0xc]
push eax
push 0x8004667e
mov dword [ebp - 0xc], edi
mov edi, dword [sym.imp.WSOCK32.DLL_ioctlsocket]
push ebx
call edi
test eax, eax
jne 0x40c39c
cmp dword [ebp - 8], 0x17
jne 0x40c270
push 0x1c
lea eax, [ebp - 0x58]
jmp 0x40c275
push 0x10
lea eax, [ebp - 0x2c]
push eax
push ebx
call dword [sym.imp.WSOCK32.DLL_connect]
cmp eax, 0xffffffff
jne 0x40c39c
xor eax, eax
inc eax
mov dword [ebp - 0x16c], eax
mov dword [ebp - 0x270], eax
mov eax, esi
cdq
mov ecx, 0x3e8
idiv ecx
mov dword [ebp - 0x168], ebx
mov dword [ebp - 0x26c], ebx
mov dword [ebp - 0x1c], eax
imul eax, eax, 0x3e8
sub esi, eax
lea eax, [ebp - 0x1c]
imul esi, esi, 0x3e8
push eax
lea eax, [ebp - 0x270]
push eax
lea eax, [ebp - 0x16c]
push eax
push 0
lea eax, [ebx + 1]
push eax
mov dword [ebp - 0x18], esi
call dword [sym.imp.WSOCK32.DLL_select]
xor esi, esi
inc esi
cmp eax, esi
jne 0x40c2f8
lea eax, [ebp - 0x16c]
push eax
push ebx
call sub.WSOCK32.DLL___WSAFDIsSet
test eax, eax
je 0x40c2f8
mov dword [ebp - 4], esi
and dword [ebp - 0xc], 0
lea eax, [ebp - 0xc]
push eax
push 0x8004667e
push ebx
call edi
xor edi, edi
inc edi
jmp 0x40c32f
cmp dword [ebp - 8], 0x17
jne 0x40c31a
push 0x1c
lea eax, [ebp - 0x58]
jmp 0x40c31f
push 0x10
lea eax, [ebp - 0x2c]
push eax
push ebx
call dword [sym.imp.WSOCK32.DLL_connect]
cmp eax, 0xffffffff
je 0x40c39c
mov dword [ebp - 4], edi
xor esi, esi
cmp dword [ebp - 4], esi
je 0x40c39c
push 0x10
push esi
push dword [0x482308]
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov dword [ebp - 4], eax
cmp eax, esi
je 0x40c39c
mov dword [eax], edi
mov dword [eax + 8], ebx
mov dword [eax + 0xc], esi
jmp 0x40c39c
lea eax, [ebp - 0xc]
push eax
push 0x8004667e
push ebx
mov dword [ebp - 0xc], edi
call dword [sym.imp.WSOCK32.DLL_ioctlsocket]
test eax, eax
jne 0x40c39c
push 0x20
push eax
push dword [0x482308]
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov dword [ebp - 4], eax
test eax, eax
je 0x40c39c
mov ecx, dword [ebp - 0x10]
and dword [eax + 0xc], 0
mov dword [eax + 4], ecx
mov ecx, dword [ebp + 0xc]
mov dword [eax], 2
mov dword [eax + 0x10], ebx
mov dword [eax + 8], ecx
push dword [ebp + 8]
call fcn.004365c0
cmp dword [ebp - 4], 0
pop esi
jne 0x40c3b2
push ebx
call dword [sym.imp.WSOCK32.DLL_closesocket]
pop ebx
mov eax, dword [ebp - 4]
pop edi
leave
ret 0x18