Function at 0x41a020
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:
sub esp, 0x238
mov eax, dword [str.TrySocketConn__]
push ebx
push ebp
push esi
push edi
mov edi, ecx
mov ecx, dword [0x4e269c]
mov edx, dword [0x4e26a0]
mov dword [esp + 0x20], eax
mov eax, dword [0x4e26a4]
mov dword [esp + 0x24], ecx
mov ecx, dword [esp + 0x24c]
mov dword [esp + 0x2c], eax
mov dword [esp + 0x28], edx
mov eax, dword [ecx + 4]
mov dword [esp + 0x1c], 1
mov word [esp + 0x30], 2
mov ecx, dword [eax]
cmp ecx, eax
mov dword [esp + 0x10], ecx
je 0x41a12d
mov ebx, dword [sym.imp.WS2_32.dll_ioctlsocket]
mov ebp, dword [sym.imp.WS2_32.dll_htons]
push 0
push 1
push 2
call dword [sym.imp.WS2_32.dll_socket]
mov esi, eax
cmp esi, 0xffffffff
jne 0x41a0cf
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
push eax
push str.Create_socket_error__ErrorCode___d
lea edx, [edi + 0x55]
push 0xfff
push edx
call fcn.00466ca7
mov edx, dword [0x4d1bac]
mov eax, dword [edi]
add esp, 0x10
lea ecx, [esp + 0x20]
push 0x42f
push ecx
push edx
mov ecx, edi
call dword [eax + 0x10]
jmp 0x41a110
lea eax, [esp + 0x1c]
push eax
push 0x8004667e
push esi
call ebx
mov eax, dword [esp + 0x10]
mov ecx, dword [eax + 0x10]
mov dword [esp + 0x34], ecx
mov dx, word [eax + 0x18]
push edx
call ebp
mov word [esp + 0x32], ax
lea eax, [esp + 0x30]
push 0x10
push eax
push esi
call dword [sym.imp.WS2_32.dll_connect]
push 1
call dword [sym.imp.KERNEL32.dll_Sleep]
mov ecx, dword [esp + 0x10]
mov dword [ecx + 0x14], esi
lea ecx, [esp + 0x10]
call fcn.0041d070
mov eax, dword [esp + 0x24c]
mov edx, dword [esp + 0x10]
cmp edx, dword [eax + 4]
jne 0x41a085
mov esi, dword [esp + 0x24c]
xor ecx, ecx
xor edi, edi
mov dword [esp + 0x144], ecx
mov eax, dword [esi + 4]
mov dword [esp + 0x40], edi
mov ebx, dword [eax]
cmp ebx, eax
mov dword [esp + 0x10], ebx
je 0x41a1ee
jmp 0x41a161
mov ecx, dword [esp + 0x144]
mov edi, dword [esp + 0x40]
xor eax, eax
test ecx, ecx
jbe 0x41a17d
mov esi, dword [ebx + 0x14]
lea edx, [esp + 0x148]
cmp dword [edx], esi
je 0x41a17d
inc eax
add edx, 4
cmp eax, ecx
jb 0x41a171
cmp eax, ecx
jne 0x41a19f
cmp ecx, 0x40
jae 0x41a19f
mov ecx, dword [ebx + 0x14]
mov dword [esp + eax*4 + 0x148], ecx
mov eax, dword [esp + 0x144]
inc eax
mov dword [esp + 0x144], eax
xor eax, eax
test edi, edi
jbe 0x41a1b8
mov edx, dword [ebx + 0x14]
lea ecx, [esp + 0x44]
cmp dword [ecx], edx
je 0x41a1b8
inc eax
add ecx, 4
cmp eax, edi
jb 0x41a1ac
cmp eax, edi
jne 0x41a1d1
cmp edi, 0x40
jae 0x41a1d1
mov edx, dword [ebx + 0x14]
mov dword [esp + eax*4 + 0x44], edx
mov eax, dword [esp + 0x40]
inc eax
mov dword [esp + 0x40], eax
lea ecx, [esp + 0x10]
call fcn.0041d070
mov esi, dword [esp + 0x24c]
mov ebx, dword [esp + 0x10]
cmp ebx, dword [esi + 4]
jne 0x41a156
mov ebx, dword [sym.imp.WS2_32.dll_select]
lea eax, [esp + 0x14]
lea ecx, [esp + 0x40]
push eax
lea edx, [esp + 0x148]
push ecx
push edx
mov ebp, 3
push 0
push 0
mov dword [esp + 0x28], ebp
mov dword [esp + 0x2c], 0
call ebx
test eax, eax
je 0x41a404
cmp eax, 0xffffffff
je 0x41a404
mov ecx, dword [esi + 4]
mov eax, dword [ecx]
cmp eax, ecx
mov dword [esp + 0x10], eax
je 0x41a3d8
mov edx, dword [eax + 0x14]
lea ecx, [esp + 0x144]
push ecx
push edx
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
je 0x41a2c1
mov eax, dword [esp + 0x10]
mov dword [eax + 0x1c], 1
mov edx, dword [esp + 0x144]
xor eax, eax
test edx, edx
jbe 0x41a3bb
mov ecx, dword [esp + 0x10]
mov esi, dword [ecx + 0x14]
lea ecx, [esp + 0x148]
cmp dword [ecx], esi
je 0x41a28f
inc eax
add ecx, 4
cmp eax, edx
jb 0x41a27e
jmp 0x41a3bb
lea ecx, [edx - 1]
cmp eax, ecx
jae 0x41a2b4
lea ecx, [esp + eax*4 + 0x148]
mov edx, dword [ecx + 4]
inc eax
mov dword [ecx], edx
mov edx, dword [esp + 0x144]
add ecx, 4
lea esi, [edx - 1]
cmp eax, esi
jb 0x41a29d
dec edx
mov dword [esp + 0x144], edx
jmp 0x41a3bb
mov ecx, dword [esp + 0x10]
lea eax, [esp + 0x40]
push eax
mov edx, dword [ecx + 0x14]
push edx
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
je 0x41a335
mov eax, dword [esp + 0x10]
mov dword [eax + 0x1c], 0xffffffff
mov edx, dword [esp + 0x40]
xor eax, eax
test edx, edx
jbe 0x41a3bb
mov ecx, dword [esp + 0x10]
mov esi, dword [ecx + 0x14]
lea ecx, [esp + 0x44]
cmp dword [ecx], esi
je 0x41a30c
inc eax
add ecx, 4
cmp eax, edx
jb 0x41a2fb
jmp 0x41a3bb
lea ecx, [edx - 1]
cmp eax, ecx
jae 0x41a32b
lea ecx, [esp + eax*4 + 0x44]
mov edx, dword [ecx + 4]
inc eax
mov dword [ecx], edx
mov edx, dword [esp + 0x40]
add ecx, 4
lea esi, [edx - 1]
cmp eax, esi
jb 0x41a317
dec edx
mov dword [esp + 0x40], edx
jmp 0x41a3bb
mov edi, dword [esp + 0x10]
mov eax, dword [edi + 0x1c]
test eax, eax
jne 0x41a3bb
mov edx, dword [esp + 0x144]
xor eax, eax
test edx, edx
jbe 0x41a363
mov esi, dword [edi + 0x14]
lea ecx, [esp + 0x148]
cmp dword [ecx], esi
je 0x41a363
inc eax
add ecx, 4
cmp eax, edx
jb 0x41a357
cmp eax, edx
jne 0x41a385
cmp edx, 0x40
jae 0x41a385
mov ecx, dword [edi + 0x14]
mov dword [esp + eax*4 + 0x148], ecx
mov eax, dword [esp + 0x144]
inc eax
mov dword [esp + 0x144], eax
mov edx, dword [esp + 0x40]
xor eax, eax
test edx, edx
jbe 0x41a3a2
mov esi, dword [edi + 0x14]
lea ecx, [esp + 0x44]
cmp dword [ecx], esi
je 0x41a3a2
inc eax
add ecx, 4
cmp eax, edx
jb 0x41a396
cmp eax, edx
jne 0x41a3bb
cmp edx, 0x40
jae 0x41a3bb
mov edx, dword [edi + 0x14]
mov dword [esp + eax*4 + 0x44], edx
mov eax, dword [esp + 0x40]
inc eax
mov dword [esp + 0x40], eax
lea ecx, [esp + 0x10]
call fcn.0041d070
mov esi, dword [esp + 0x24c]
mov eax, dword [esp + 0x10]
cmp eax, dword [esi + 4]
jne 0x41a23f
lea eax, [esp + 0x14]
lea ecx, [esp + 0x40]
push eax
lea edx, [esp + 0x148]
push ecx
push edx
push 0
push 0
mov dword [esp + 0x28], ebp
mov dword [esp + 0x2c], 0
call ebx
test eax, eax
jne 0x41a225
mov ecx, dword [esi + 4]
mov eax, dword [ecx]
cmp eax, ecx
mov dword [esp + 0x10], eax
je 0x41a47e
mov esi, dword [sym.imp.WS2_32.dll_closesocket]
or edi, 0xffffffff
mov ecx, dword [eax + 0x1c]
test ecx, ecx
jne 0x41a428
mov dword [eax + 0x1c], edi
mov eax, dword [esp + 0x10]
mov eax, dword [eax + 0x14]
push eax
call esi
mov eax, dword [esp + 0x10]
mov edx, dword [0x4f61d0]
mov ecx, dword [eax + 8]
cmp ecx, edx
je 0x41a451
mov eax, ecx
mov ecx, dword [eax]
cmp ecx, edx
je 0x41a46e
mov eax, ecx
mov ecx, dword [eax]
cmp ecx, edx
jne 0x41a447
jmp 0x41a46e
mov ecx, dword [eax + 4]
cmp eax, dword [ecx + 8]
jne 0x41a467
mov eax, ecx
mov dword [esp + 0x10], eax
mov ecx, dword [ecx + 4]
cmp eax, dword [ecx + 8]
je 0x41a459
cmp dword [eax + 8], ecx
je 0x41a472
mov eax, ecx
mov dword [esp + 0x10], eax
mov ecx, dword [esp + 0x24c]
cmp eax, dword [ecx + 4]
jne 0x41a41a
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x238
ret 4