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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x220
push ebx
push esi
mov esi, ecx
push edi
mov eax, dword [esi + 0x17f8]
test eax, eax
je 0x401266
push 0x43
push 0x48c1ac
push str.m_nState__STATE_CLOSED
push str.ASSERT
push 0x48c174
call fcn.00401000
add esp, 0x14
mov eax, dword [ebp + 8]
push 0x10
push eax
push esi
call fcn.00404950
mov eax, dword [ebp + 0x18]
mov ecx, dword [ebp + 0xc]
mov edx, dword [ebp + 0x14]
mov dword [esi + 0x18], eax
mov eax, dword [esi + 0x17f8]
add esp, 0xc
cmp eax, 2
mov dword [esi + 0x10], ecx
mov dword [esi + 0x14], edx
jne 0x40129d
pop edi
pop esi
mov al, 1
pop ebx
mov esp, ebp
pop ebp
ret 0x14
test eax, eax
jne 0x40149b
cmp dword [esi + 0x1c], 0xffffffff
je 0x4012c9
push 0x4f
push 0x48c1ac
push str.m_sock__INVALID_SOCKET
push str.ASSERT
push 0x48c174
call fcn.00401000
add esp, 0x14
mov ecx, dword [esi + 0x17fc]
mov edx, dword [ecx]
call dword [edx]
mov ecx, dword [esi + 0x1800]
mov eax, dword [ecx]
call dword [eax]
mov ebx, 1
push 0
push ebx
push 2
call dword [sym.imp.WS2_32.dll_socket]
cmp eax, 0xffffffff
mov dword [esi + 0x1c], eax
jne 0x40130d
push str.Init_socket___failed.
call fcn.00401000
add esp, 4
xor al, al
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0x14
mov edi, dword [sym.imp.WS2_32.dll_setsockopt]
lea ecx, [ebp + 8]
push 4
push ecx
push 8
push 0xffff
push eax
mov dword [esi + 0x820], 0
mov dword [ebp + 8], ebx
call edi
test eax, eax
je 0x401356
mov edx, dword [esi + 0x1c]
push edx
call dword [sym.imp.WS2_32.dll_closesocket]
push str.setsockopt___set_SO_KEEPALIVE_failed.
call fcn.00401000
add esp, 4
xor al, al
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0x14
mov eax, dword [esi + 0x14]
test eax, eax
mov dword [ebp + 8], eax
je 0x4013a0
mov ecx, dword [esi + 0x1c]
lea eax, [ebp + 8]
push 4
push eax
push 0x1001
push 0xffff
push ecx
call edi
test eax, eax
je 0x4013a0
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
push eax
push str.setsockopt___set_SO_SNDBUF_failed__d_.
call fcn.00401000
add esp, 8
mov ecx, esi
call fcn.00401a40
pop edi
pop esi
xor al, al
pop ebx
mov esp, ebp
pop ebp
ret 0x14
mov eax, dword [esi + 0x18]
test eax, eax
mov dword [ebp + 8], eax
je 0x4013ea
mov eax, dword [esi + 0x1c]
lea edx, [ebp + 8]
push 4
push edx
push 0x1002
push 0xffff
push eax
call edi
test eax, eax
je 0x4013ea
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
push eax
push str.setsockopt___set_SO_RCVBUF_failed__d_.
call fcn.00401000
add esp, 8
mov ecx, esi
call fcn.00401a40
pop edi
pop esi
xor al, al
pop ebx
mov esp, ebp
pop ebp
ret 0x14
mov edx, dword [esi + 0x1c]
lea ecx, [ebp + 0xc]
push ecx
push 0x8004667e
push edx
mov dword [ebp + 0xc], ebx
call dword [sym.imp.WS2_32.dll_ioctlsocket]
test eax, eax
je 0x401423
push str.Init_ioctlsocket___failed.
call fcn.00401000
add esp, 4
mov ecx, esi
call fcn.00401a40
pop edi
pop esi
xor al, al
pop ebx
mov esp, ebp
pop ebp
ret 0x14
push esi
call dword [sym.imp.WS2_32.dll_inet_addr]
mov ebx, eax
cmp ebx, 0xffffffff
jne 0x40144a
push esi
call dword [sym.imp.WS2_32.dll_gethostbyname]
test eax, eax
jne 0x401443
push 0x48c200
jmp 0x401409
mov eax, dword [eax + 0xc]
mov ecx, dword [eax]
mov ebx, dword [ecx]
mov dx, word [esi + 0x10]
xor ecx, ecx
mov eax, 0x10
push edx
lea edi, [ebp - 0x18]
mov word [ebp - 0x18], 2
call dword [sym.imp.WS2_32.dll_htons]
mov ecx, dword [esi + 0x1c]
mov word [ebp - 0x16], ax
lea eax, [ebp - 0x18]
push 0x10
push eax
push ecx
mov dword [ebp - 0x14], ebx
call dword [sym.imp.WS2_32.dll_connect]
cmp eax, 0xffffffff
jne 0x40148e
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
cmp eax, 0x2733
jne 0x401411
mov edi, 1
mov dword [esi + 0x17f8], edi
jmp 0x4014a0
mov edi, 1
cmp dword [esi + 0x17f8], edi
je 0x4014c9
push 0xa9
push 0x48c1ac
push str.m_nState__STATE_CONNECT
push str.ASSERT
push 0x48c174
call fcn.00401000
add esp, 0x14
mov eax, dword [esi + 0x1c]
mov edx, dword [ebp + 0x10]
mov dword [ebp - 0x21c], eax
mov dword [ebp - 0x118], eax
lea eax, [ebp - 8]
mov dword [ebp - 8], edx
lea ecx, [ebp - 0x11c]
push eax
lea edx, [ebp - 0x220]
push ecx
push edx
push 0
push 0x40
mov dword [ebp - 4], 0
mov dword [ebp - 0x220], edi
mov dword [ebp - 0x11c], edi
call dword [sym.imp.WS2_32.dll_select]
test eax, eax
jle 0x401418
mov ecx, dword [esi + 0x1c]
lea eax, [ebp - 0x11c]
push eax
push ecx
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
jne 0x401411
mov eax, dword [esi + 0x1c]
lea edx, [ebp - 0x220]
push edx
push eax
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
je 0x401418
mov dword [esi + 0x17f8], 2
pop edi
pop esi
mov al, 1
pop ebx
mov esp, ebp
pop ebp
ret 0x14