Function at 0x401560
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, 0x228
push ebx
push esi
mov esi, ecx
push edi
cmp byte [esi], 0
jne 0x401594
push 0xc6
push 0x48c1ac
push str.m_szIP_0_
push str.ASSERT
push 0x48c174
call fcn.00401000
add esp, 0x14
mov eax, dword [esi + 0x17f8]
cmp eax, 2
jne 0x4015aa
pop edi
pop esi
mov al, 1
pop ebx
mov esp, ebp
pop ebp
ret 4
test eax, eax
jne 0x4017ab
cmp dword [esi + 0x1c], 0xffffffff
je 0x4015d9
push 0xcd
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 eax, dword [ecx]
call dword [eax]
mov ecx, dword [esi + 0x1800]
mov edx, dword [ecx]
call dword [edx]
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 0x40161d
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 4
mov edi, dword [sym.imp.WS2_32.dll_setsockopt]
lea ecx, [ebp - 4]
push 4
push ecx
push 8
push 0xffff
push eax
mov dword [esi + 0x820], 0
mov dword [ebp - 4], ebx
call edi
test eax, eax
je 0x401666
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 4
mov eax, dword [esi + 0x14]
test eax, eax
mov dword [ebp - 4], eax
je 0x4016b0
mov ecx, dword [esi + 0x1c]
lea eax, [ebp - 4]
push 4
push eax
push 0x1001
push 0xffff
push ecx
call edi
test eax, eax
je 0x4016b0
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 4
mov eax, dword [esi + 0x18]
test eax, eax
mov dword [ebp - 4], eax
je 0x4016fa
mov eax, dword [esi + 0x1c]
lea edx, [ebp - 4]
push 4
push edx
push 0x1002
push 0xffff
push eax
call edi
test eax, eax
je 0x4016fa
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 4
mov edx, dword [esi + 0x1c]
lea ecx, [ebp - 8]
push ecx
push 0x8004667e
push edx
mov dword [ebp - 8], ebx
call dword [sym.imp.WS2_32.dll_ioctlsocket]
test eax, eax
je 0x401733
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 4
push esi
call dword [sym.imp.WS2_32.dll_inet_addr]
mov ebx, eax
cmp ebx, 0xffffffff
jne 0x40175a
push esi
call dword [sym.imp.WS2_32.dll_gethostbyname]
test eax, eax
jne 0x401753
push 0x48c200
jmp 0x401719
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 - 0x20]
mov word [ebp - 0x20], 2
call dword [sym.imp.WS2_32.dll_htons]
mov ecx, dword [esi + 0x1c]
mov word [ebp - 0x1e], ax
lea eax, [ebp - 0x20]
push 0x10
push eax
push ecx
mov dword [ebp - 0x1c], ebx
call dword [sym.imp.WS2_32.dll_connect]
cmp eax, 0xffffffff
jne 0x40179e
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
cmp eax, 0x2733
jne 0x401721
mov edi, 1
mov dword [esi + 0x17f8], edi
jmp 0x4017b0
mov edi, 1
cmp dword [esi + 0x17f8], edi
je 0x4017d9
push 0x127
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 + 8]
mov dword [ebp - 0x224], eax
mov dword [ebp - 0x120], eax
lea eax, [ebp - 0x10]
mov dword [ebp - 0x10], edx
lea ecx, [ebp - 0x124]
push eax
lea edx, [ebp - 0x228]
push ecx
push edx
push 0
push 0x40
mov dword [ebp - 0xc], 0
mov dword [ebp - 0x228], edi
mov dword [ebp - 0x124], edi
call dword [sym.imp.WS2_32.dll_select]
test eax, eax
jle 0x401728
mov ecx, dword [esi + 0x1c]
lea eax, [ebp - 0x124]
push eax
push ecx
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
jne 0x401721
mov eax, dword [esi + 0x1c]
lea edx, [ebp - 0x228]
push edx
push eax
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
je 0x401728
mov dword [esi + 0x17f8], 2
pop edi
pop esi
mov al, 1
pop ebx
mov esp, ebp
pop ebp
ret 4