Function at 0x40b670
Capabilities:
Connect socket
Initialize winsock library
Receive data
Receive data on socket
Send data
Send data on socket
Set socket configuration
Terminate process

Disassembly:
push 0xffffffffffffffff
push 0x4178a3
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x9a4
push ebx
push ebp
push esi
push edi
mov ebx, ecx
lea eax, [esp + 0x424]
mov esi, 2
push eax
push 0x102
mov dword [esp + 0x9c4], esi
call sub.WSOCK32.dll_WSAStartup
test eax, eax
je 0x40b6ce
push 0x10
push 0x42128c
push 0x421298
mov ecx, ebx
call sub.MFC42.DLL_CWnd::MessageBoxA
push 0
call dword [sym.imp.MSVCRT.dll_exit]
push 0x421210
call sub.WSOCK32.dll_getprotobyname
movsx ecx, word [eax + 8]
push ecx
push 1
push esi
call sub.WSOCK32.dll_socket
mov ebp, eax
or edi, 0xffffffff
cmp ebp, edi
jne 0x40b706
push 0x10
push 0x42128c
push 0x421200
mov ecx, ebx
call sub.MFC42.DLL_CWnd::MessageBoxA
jmp 0x40b8e9
mov edx, dword [esp + 0x9c8]
mov word [esp + 0x14], si
push edx
call sub.WSOCK32.dll_htons
mov word [esp + 0x16], ax
mov eax, dword [esp + 0x9c4]
push eax
call sub.WSOCK32.dll_inet_addr
lea ecx, [esp + 0x14]
push 0x10
push ecx
push ebp
mov dword [esp + 0x24], eax
call sub.WSOCK32.dll_connect
test eax, eax
jne 0x40b832
mov ecx, 0xff
lea edi, [esp + 0x25]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
mov edi, dword [esp + 0x9cc]
mov al, 0xaa
mov byte [esp + 0x24], al
mov byte [esp + 0x25], al
mov ecx, dword [edi - 8]
mov edx, ecx
and edx, 0x800000ff
jns 0x40b777
dec edx
or edx, 0xffffff00
inc edx
mov eax, ecx
mov byte [esp + 0x28], dl
cdq
and edx, 0xff
add eax, edx
sar eax, 8
mov byte [esp + 0x29], al
xor eax, eax
test ecx, ecx
jle 0x40b7a7
lea edx, [esp + 0x2a]
sub edi, edx
lea esi, [esp + eax + 0x2a]
inc eax
cmp eax, ecx
mov dl, byte [edi + esi]
mov byte [esi], dl
jl 0x40b799
mov edi, dword [esp + 0x9d0]
mov esi, dword [edi - 8]
mov eax, esi
and eax, 0x800000ff
jns 0x40b7c1
dec eax
or eax, 0xffffff00
inc eax
mov byte [esp + ecx + 0x2a], al
mov eax, esi
cdq
and edx, 0xff
add eax, edx
sar eax, 8
mov byte [esp + ecx + 0x2b], al
xor eax, eax
test esi, esi
jle 0x40b7ec
lea edx, [esp + ecx + 0x2c]
mov cl, byte [eax + edi]
mov byte [edx + eax], cl
inc eax
cmp eax, esi
jl 0x40b7e1
xor cl, cl
xor eax, eax
mov edx, eax
and edx, 0x80000007
jns 0x40b7ff
dec edx
or edx, 0xfffffff8
inc edx
mov dl, byte [edx + 0x421764]
xor dl, cl
mov cl, byte [esp + eax + 0x28]
xor cl, dl
mov byte [esp + eax + 0x28], cl
inc eax
cmp eax, 0x3fa
jl 0x40b7f0
push 0
lea eax, [esp + 0x28]
push 0x400
push eax
push ebp
call sub.WSOCK32.dll_send
or edi, 0xffffffff
cmp eax, edi
jne 0x40b84a
push 0x10
push 0x42128c
push 0x4211f0
mov ecx, ebx
call sub.MFC42.DLL_CWnd::MessageBoxA
jmp 0x40b8e9
push 0
lea ecx, [esp + 0x5b8]
push 0x400
push ecx
push ebp
call sub.WSOCK32.dll_recv
test eax, eax
je 0x40b8e9
mov esi, dword [sym.imp.MSVCRT.dll__mbscmp]
je 0x40b8e9
cmp eax, edi
je 0x40b8e9
lea edx, [esp + 0x5b4]
lea ecx, [esp + 0x10]
push edx
call sub.MFC42.DLL_CString::CString_2
mov eax, dword [esp + 0x10]
push str.Rec_OK
push eax
mov byte [esp + 0x9c4], 3
call esi
add esp, 8
test eax, eax
jne 0x40b8ac
push eax
push 0x4211a0
push 0x4212f4
jmp 0x40b8b8
mov ecx, dword [esp + 0x10]
push 0x10
push 0x421184
push ecx
mov ecx, ebx
call sub.MFC42.DLL_CWnd::MessageBoxA
lea ecx, [esp + 0x10]
mov byte [esp + 0x9bc], 2
call fcn.00415c98
push 0
lea edx, [esp + 0x5b8]
push 0x400
push edx
push ebp
call sub.WSOCK32.dll_recv
test eax, eax
jne 0x40b86f
lea ecx, [esp + 0x9c4]
mov byte [esp + 0x9bc], 1
call fcn.00415c98
lea ecx, [esp + 0x9cc]
mov byte [esp + 0x9bc], 0
call fcn.00415c98
lea ecx, [esp + 0x9d0]
mov dword [esp + 0x9bc], edi
call fcn.00415c98
mov ecx, dword [esp + 0x9b4]
pop edi
pop esi
pop ebp
pop ebx
mov dword fs:[0], ecx
add esp, 0x9b0
ret 0x10