Function at 0x401740
Capabilities:
Act as tcp client
Connect socket
Connect tcp socket
Connect udp socket
Create tcp socket
Create udp socket
Receive data
Receive data on socket
Send data
Send data on socket

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x4fc
push ebx
push esi
push edi
push ecx
lea edi, [ebp - 0x4fc]
mov ecx, 0x13f
mov eax, 0xcccccccc
rep stosd dword es:[edi], eax
pop ecx
mov eax, dword [0x12c9128]
xor eax, ebp
mov dword [ebp - 4], eax
mov dword [ebp - 0xc], ecx
mov esi, esp
push 0
push 1
push 2
call dword [sym.imp.WS2_32.dll_socket]
cmp esi, esp
call fcn.0050ef30
mov dword [ebp - 0x18], eax
cmp dword [ebp - 0x18], 0xffffffff
jne 0x4017a0
push 0
push 0
push str.Create_socket_error_
call fcn.00442410
xor eax, eax
jmp 0x40197e
mov eax, 2
mov word [ebp - 0x30], ax
mov eax, dword [ebp - 0xc]
add eax, 0xe0
mov esi, esp
push eax
call dword [sym.imp.WS2_32.dll_inet_addr]
cmp esi, esp
call fcn.0050ef30
mov dword [ebp - 0x2c], eax
mov esi, esp
push 0xfa1
call dword [sym.imp.WS2_32.dll_htons]
cmp esi, esp
call fcn.0050ef30
mov word [ebp - 0x2e], ax
mov esi, esp
push 0x10
lea eax, [ebp - 0x30]
push eax
mov ecx, dword [ebp - 0x18]
push ecx
call dword [sym.imp.WS2_32.dll_connect]
cmp esi, esp
call fcn.0050ef30
cmp eax, 0xffffffff
jne 0x401824
push 0
push 0
push 0x57f260
call fcn.00442410
mov esi, esp
mov eax, dword [ebp - 0x18]
push eax
call dword [sym.imp.WS2_32.dll_closesocket]
cmp esi, esp
call fcn.0050ef30
xor eax, eax
jmp 0x40197e
mov eax, dword [ebp - 0xc]
mov ecx, dword [ebp - 0x18]
mov dword [eax + 0xd0], ecx
mov eax, dword [ebp - 0xc]
mov ecx, dword [eax + 0x118]
push ecx
push str.CHAT__d_t_n
lea edx, [ebp - 0x438]
push edx
call fcn.0050f670
add esp, 0xc
mov esi, esp
push 0
push 0x400
lea eax, [ebp - 0x438]
push eax
mov ecx, dword [ebp - 0x18]
push ecx
call dword [sym.imp.WS2_32.dll_send]
cmp esi, esp
call fcn.0050ef30
push 0x400
push 0
lea eax, [ebp - 0x438]
push eax
call fcn.0050f3e0
add esp, 0xc
mov esi, esp
push 0
push 0x400
lea eax, [ebp - 0x438]
push eax
mov ecx, dword [ebp - 0x18]
push ecx
call dword [sym.imp.WS2_32.dll_recv]
cmp esi, esp
call fcn.0050ef30
cmp eax, 0xffffffff
jne 0x4018c5
mov esi, esp
mov eax, dword [ebp - 0x18]
push eax
call dword [sym.imp.WS2_32.dll_closesocket]
cmp esi, esp
call fcn.0050ef30
xor eax, eax
jmp 0x40197e
push 0x57f250
lea eax, [ebp - 0x438]
push eax
call fcn.0050f520
add esp, 8
test eax, eax
jne 0x401902
push 0
push 0
push 0x57f234
call fcn.00442410
mov esi, esp
mov eax, dword [ebp - 0x18]
push eax
call dword [sym.imp.WS2_32.dll_closesocket]
cmp esi, esp
call fcn.0050ef30
xor eax, eax
jmp 0x40197e
lea eax, [ebp - 0x438]
push eax
call fcn.0050f4a0
add esp, 4
cmp eax, 0xf1
jne 0x40193d
push 0
push 0
push 0x57f218
call fcn.00442410
mov esi, esp
mov eax, dword [ebp - 0x18]
push eax
call dword [sym.imp.WS2_32.dll_closesocket]
cmp esi, esp
call fcn.0050ef30
xor eax, eax
jmp 0x40197e
lea eax, [ebp - 0x438]
push eax
call fcn.0050f4a0
add esp, 4
cmp eax, 0xf0
jne 0x401969
mov eax, dword [ebp - 0xc]
mov dword [eax + 0xdc], 1
mov eax, 1
jmp 0x40197e
mov esi, esp
mov eax, dword [ebp - 0x18]
push eax
call dword [sym.imp.WS2_32.dll_closesocket]
cmp esi, esp
call fcn.0050ef30
xor eax, eax
push edx
mov ecx, ebp
push eax
lea edx, [0x4019b0]
call fcn.0050ef60
pop eax
pop edx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0050ef20
add esp, 0x4fc
cmp ebp, esp
call fcn.0050ef30
mov esp, ebp
pop ebp
ret