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

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x22c
mov eax, dword [0x44a008]
xor eax, esp
mov dword [esp + 0x228], eax
push ebx
push esi
push edi
mov edi, dword [ebp + 8]
mov esi, ecx
test edi, edi
je 0x406068
mov eax, dword [esi + 4]
test eax, eax
jle 0x405e4f
push eax
call dword [sym.imp.WS2_32.dll_closesocket]
mov dword [esi + 4], 0xffffffff
push edi
push 0x446db0
lea eax, [esi + 0x24]
push 0x3f
push eax
mov dword [esp + 0x20], eax
call fcn.00401af0
movzx eax, word [ebp + 0xc]
add esp, 0x10
xorps xmm0, xmm0
mov dword [esi + 0xc], eax
mov dword [esi + 8], 1
mov ecx, 2
movups xmmword [esi + 0x14], xmm0
push eax
mov word [esi + 0x14], cx
call dword [sym.imp.WS2_32.dll_htons]
push edi
mov word [esi + 0x16], ax
call dword [sym.imp.WS2_32.dll_inet_addr]
push 0
push 1
push 2
mov dword [esi + 0x18], eax
call dword [sym.imp.WS2_32.dll_socket]
mov dword [esi + 4], eax
test eax, eax
js 0x406068
mov byte [esi + 0x10], 0
jle 0x405ed0
lea ecx, [esp + 0xc]
mov dword [esp + 0xc], 1
push ecx
push 0x8004667e
push eax
call dword [sym.imp.WS2_32.dll_ioctlsocket]
mov edi, dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__errno]
mov ebx, dword [sym.imp.WS2_32.dll_connect]
nop dword [eax]
call edi
push 0x10
mov dword [eax], 0
lea eax, [esi + 0x14]
push eax
push dword [esi + 4]
call ebx
cmp eax, 0xffffffff
jne 0x4060c1
call edi
cmp dword [eax], 4
je 0x405ee0
call edi
cmp dword [eax], 0
je 0x4060c1
call edi
cmp dword [eax], 0x70
jne 0x406111
mov eax, dword [ebp + 0x10]
lea ecx, [esp + 0x18]
push ecx
push 0
lea ecx, [esp + 0x28]
mov dword [esp + 0x20], eax
mov eax, dword [esi + 4]
push ecx
lea ecx, [esp + 0x134]
mov dword [esp + 0x30], eax
mov dword [esp + 0x138], eax
inc eax
push ecx
push eax
mov dword [esp + 0x30], 0
mov dword [esp + 0x34], 1
mov dword [esp + 0x13c], 1
call dword [sym.imp.WS2_32.dll_select]
test eax, eax
jns 0x405f92
push 0x89
push str.JCSocket::Connect
push str._s_:_d
call fcn.00401070
add esp, 0xc
push str.client_:_network_error_in_connect_n
call fcn.00401070
add esp, 4
jmp 0x406068
je 0x406068
cmp eax, 1
jne 0x406068
lea eax, [esp + 0x20]
push eax
push dword [esi + 4]
call dword [sym.imp.WS2_32.dll___WSAFDIsSet]
test eax, eax
je 0x4060da
mov edx, dword [esp + 0x20]
xor ecx, ecx
test edx, edx
je 0x405ff9
mov eax, dword [esi + 4]
cmp dword [esp + ecx*4 + 0x24], eax
je 0x405fd1
inc ecx
cmp ecx, edx
jb 0x405fc4
jmp 0x405ff9
lea eax, [edx - 1]
cmp ecx, eax
jae 0x405ff4
nop dword [eax + eax]
mov eax, dword [esp + ecx*4 + 0x28]
mov dword [esp + ecx*4 + 0x24], eax
inc ecx
mov edx, dword [esp + 0x20]
lea eax, [edx - 1]
cmp ecx, eax
jb 0x405fe0
dec edx
mov dword [esp + 0x20], edx
lea eax, [esp + 0x14]
mov dword [esp + 0xc], 0xffffffff
push eax
lea eax, [esp + 0x10]
mov dword [esp + 0x18], 4
push eax
push 0x1007
push 0xffff
push dword [esi + 4]
call dword [sym.imp.WS2_32.dll_getsockopt]
test eax, eax
jns 0x406082
push 0x9f
push str.JCSocket::Connect
push str._s_:_d
call fcn.00401070
mov esi, dword [esi + 0xc]
add esp, 0xc
call edi
push esi
push dword [esp + 0x14]
push dword [esp + 0x14]
push dword [eax]
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll_strerror]
add esp, 4
push eax
push str.client_getsockopt_err__s__d___s___d__n
call fcn.00401070
add esp, 0x14
or eax, 0xffffffff
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x228]
xor ecx, esp
call fcn.0043ffd8
mov esp, ebp
pop ebp
ret 0xc
cmp dword [esp + 0xc], 0
je 0x4060c1
push 0xa3
push str.JCSocket::Connect
push str._s_:_d
call fcn.00401070
mov esi, dword [esi + 0xc]
add esp, 0xc
call edi
push esi
push dword [esp + 0x14]
push dword [esp + 0x14]
push dword [eax]
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll_strerror]
add esp, 4
push eax
push str.client_:_connect_err__s__d___s___d__n
jmp 0x406060
mov ecx, dword [esp + 0x234]
xor eax, eax
pop edi
pop esi
pop ebx
xor ecx, esp
call fcn.0043ffd8
mov esp, ebp
pop ebp
ret 0xc
push 0xad
push str.JCSocket::Connect
push str._s_:_d
call fcn.00401070
add esp, 0xc
call edi
push dword [eax]
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll_strerror]
add esp, 4
push eax
push str.other_error_when_select:_s_n
call fcn.00401070
add esp, 8
jmp 0x406068
push 0xb7
push str.JCSocket::Connect
push str._s_:_d
call fcn.00401070
mov esi, dword [esi + 0xc]
add esp, 0xc
call edi
push esi
push dword [esp + 0x14]
push dword [eax]
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll_strerror]
add esp, 4
push eax
push str.client_:_connect_error_:_s_with_ip:__s__port:__d_n
call fcn.00401070
add esp, 0x10
jmp 0x406068