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

Disassembly:
mov eax, 0x40ef24
call fcn.0040d790
sub esp, 0x12c
push ebx
push esi
push edi
mov esi, ecx
xor ebx, ebx
xor eax, eax
lea edi, [ebp - 0x32]
mov word [ebp - 0x34], bx
stosd dword es:[edi], eax
stosd dword es:[edi], eax
stosd dword es:[edi], eax
push 0x416b40
lea ecx, [ebp - 0x10]
mov dword [ebp - 4], ebx
stosw word es:[edi], ax
call sub.MFC42.DLL_CString::CString_1
push dword [ebp + 0xc]
mov byte [ebp - 4], 1
mov word [ebp - 0x34], 2
call sub.WSOCK32.dll_htons
push dword [ebp + 8]
mov word [ebp - 0x32], ax
call sub.WSOCK32.dll_inet_addr
cmp eax, 0xffffffff
jne 0x40c365
push dword [ebp + 8]
call sub.WSOCK32.dll_gethostbyname
movsx ecx, word [eax + 0xa]
mov eax, dword [eax + 0xc]
push ecx
push dword [eax]
lea eax, [ebp - 0x30]
push eax
call sub.MSVCRT.dll_memcpy
add esp, 0xc
jmp 0x40c368
mov dword [ebp - 0x30], eax
cmp dword [esi + 0x24], ebx
mov dword [ebp - 0x18], ebx
jle 0x40c488
mov eax, dword [esi + 0xc]
cmp eax, ebx
je 0x40c384
push eax
call sub.WSOCK32.dll_closesocket
mov dword [esi + 0xc], ebx
push ebx
push 1
pop edi
push edi
push 2
call sub.WSOCK32.dll_socket
cmp eax, 0xffffffff
mov dword [esi + 0xc], eax
jne 0x40c3b4
call sub.WSOCK32.dll_WSAGetLastError
push eax
lea eax, [esi + 0x60]
push str.socket_error___d_n
push eax
call sub.MFC42.DLL_CString::Format
add esp, 0xc
jmp 0x40c479
lea ecx, [ebp - 0x14]
mov dword [ebp - 0x14], edi
push ecx
push 0x8004667e
push eax
call sub.WSOCK32.dll_ioctlsocket
cmp eax, 0xffffffff
je 0x40c458
lea eax, [ebp - 0x34]
push 0x10
push eax
push dword [esi + 0xc]
call sub.WSOCK32.dll_connect
push 0x40
xor eax, eax
pop ecx
lea edi, [ebp - 0x134]
rep stosd dword es:[edi], eax
lea edi, [ebp - 0x20]
lea ecx, [ebp - 0x24]
stosd dword es:[edi], eax
mov eax, dword [esi + 0xc]
push ecx
lea ecx, [ebp - 0x138]
mov dword [ebp - 0x134], eax
push ebx
push ecx
inc eax
push ebx
push eax
mov dword [ebp - 0x24], 5
mov dword [ebp - 0x20], ebx
mov dword [ebp - 0x138], 1
call sub.WSOCK32.dll_select
cmp eax, ebx
jg 0x40c43f
lea eax, [ebp - 0x10]
push 0x416940
push eax
call sub.MFC42.DLL_CString::Format
pop ecx
pop ecx
push 0x63
push dword [ebp - 0x10]
push str.connect
jmp 0x40c472
lea eax, [ebp - 0x14]
mov dword [ebp - 0x14], ebx
push eax
push 0x8004667e
push dword [esi + 0xc]
call sub.WSOCK32.dll_ioctlsocket
cmp eax, 0xffffffff
jne 0x40c4a0
lea eax, [ebp - 0x10]
push 0x416918
push eax
call sub.MFC42.DLL_CString::Format
pop ecx
pop ecx
push 0x63
push dword [ebp - 0x10]
push str.ioctlsocket
mov ecx, esi
call fcn.0040cd26
inc dword [ebp - 0x18]
mov eax, dword [ebp - 0x18]
cmp eax, dword [esi + 0x24]
jl 0x40c374
mov eax, dword [esi + 0xc]
cmp eax, ebx
jbe 0x40c498
push eax
call sub.WSOCK32.dll_closesocket
mov dword [esi + 0xc], ebx
push 0xffffffffffffff9b
pop esi
jmp 0x40c56a
mov eax, dword [esi + 0x3c]
push 4
mov dword [ebp + 0xc], eax
lea eax, [ebp + 0xc]
push eax
mov edi, 0xffff
push 0x1002
push edi
push dword [esi + 0xc]
call sub.WSOCK32.dll_setsockopt
cmp eax, 0xffffffff
mov ebx, str.setsockopt
jne 0x40c4d8
push 0x63
push 0x4168e4
push ebx
mov ecx, esi
call fcn.0040cd26
mov eax, dword [esi + 0x40]
push 4
mov dword [ebp + 0xc], eax
lea eax, [ebp + 0xc]
push eax
push 0x1001
push edi
push dword [esi + 0xc]
call sub.WSOCK32.dll_setsockopt
cmp eax, 0xffffffff
jne 0x40c506
push 0x63
push 0x4168c8
push ebx
mov ecx, esi
call fcn.0040cd26
mov eax, dword [esi + 8]
push 4
imul eax, eax, 0xea60
mov dword [ebp - 0x1c], eax
lea eax, [ebp - 0x1c]
push eax
push 0x1006
push edi
push dword [esi + 0xc]
call sub.WSOCK32.dll_setsockopt
cmp eax, 0xffffffff
jne 0x40c53a
push 0x63
push 0x4168a8
push ebx
mov ecx, esi
call fcn.0040cd26
mov eax, dword [esi + 0x40]
push 4
mov dword [ebp + 0xc], eax
lea eax, [ebp - 0x1c]
push eax
push 0x1005
push edi
push dword [esi + 0xc]
call sub.WSOCK32.dll_setsockopt
cmp eax, 0xffffffff
jne 0x40c568
push 0x63
push 0x416888
push ebx
mov ecx, esi
call fcn.0040cd26
xor esi, esi
and byte [ebp - 4], 0
lea ecx, [ebp - 0x10]
call fcn.0040d3c8
or dword [ebp - 4], 0xffffffff
lea ecx, [ebp + 8]
call fcn.0040d3c8
mov ecx, dword [ebp - 0xc]
mov eax, esi
pop edi
pop esi
pop ebx
mov dword fs:[0], ecx
leave
ret 8