Function at 0x40bea0
Capabilities:
Act as tcp client
Connect socket
Connect tcp socket
Create tcp socket
Create thread
Get socket status
Resume thread
Set socket configuration

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x144
mov eax, dword [0x4395ec]
xor eax, ebp
mov dword [ebp - 4], eax
movdqu xmm0, xmmword [ebp + 0x10]
mov eax, dword [ebp + 0xc]
push ebx
push esi
push edi
push 6
push 1
push 2
mov dword [ebp - 0x12c], ecx
mov dword [ebp - 0x124], eax
movdqu xmmword [ebp - 0x18], xmm0
mov dword [ebp - 0x128], 1
mov dword [ebp - 0x13c], 4
call dword [sym.imp.WS2_32.dll_socket]
mov edi, dword [sym.imp.WS2_32.dll_ioctlsocket]
mov esi, eax
lea eax, [ebp - 0x128]
push eax
push 0x8004667e
push esi
call edi
test eax, eax
je 0x40bf26
push esi
call dword [sym.imp.WS2_32.dll_closesocket]
xor eax, eax
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00415b03
mov esp, ebp
pop ebp
ret 0x18
push 0x10
lea eax, [ebp - 0x18]
push eax
push esi
call dword [sym.imp.WS2_32.dll_connect]
mov dword [ebp - 0x130], eax
cmp eax, 0xffffffff
jne 0x40bfb0
lea eax, [ebp - 0x144]
mov dword [ebp - 0x11c], esi
push eax
push 0
lea eax, [ebp - 0x120]
mov dword [ebp - 0x120], 1
push eax
push 0
push 0
mov dword [ebp - 0x144], 1
mov dword [ebp - 0x140], 0
call dword [sym.imp.WS2_32.dll_select]
test eax, eax
jle 0x40bfac
lea eax, [ebp - 0x13c]
push eax
lea eax, [ebp - 0x130]
push eax
push 0x1007
push 0xffff
push esi
call dword [sym.imp.WS2_32.dll_getsockopt]
xor ebx, ebx
cmp dword [ebp - 0x130], ebx
sete bl
jmp 0x40bfb5
xor ebx, ebx
jmp 0x40bfb5
mov ebx, 1
lea eax, [ebp - 0x128]
mov dword [ebp - 0x128], 0
push eax
push 0x8004667e
push esi
call edi
cmp eax, 0xffffffff
jne 0x40bff1
xor ebx, ebx
push esi
call dword [sym.imp.WS2_32.dll_closesocket]
mov eax, ebx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00415b03
mov esp, ebp
pop ebp
ret 0x18
test ebx, ebx
je 0x40bfd5
push 0x10c
call fcn.0041626f
mov edi, eax
add esp, 4
test edi, edi
je 0x40c032
xor eax, eax
mov dword [edi], 0xffffffff
push 0x100
push eax
mov word [edi + 0x108], ax
lea eax, [edi + 8]
push eax
mov dword [edi + 4], 0xffffffff
call fcn.0041a0a0
add esp, 0xc
jmp 0x40c03d
push esi
xor edi, edi
call dword [sym.imp.WS2_32.dll_closesocket]
xor ebx, ebx
mov eax, dword [ebp + 8]
mov dword [edi], eax
lea eax, [ebp - 0x138]
push eax
push 4
push dword [ebp - 0x124]
mov dword [edi + 4], esi
push 0x40c0f0
push 0
push 0
call dword [sym.imp.KERNEL32.dll_CreateThread]
mov dword [ebp - 0x134], eax
test eax, eax
jne 0x40c092
push esi
call dword [sym.imp.WS2_32.dll_closesocket]
push edi
call fcn.00415bcd
mov ecx, dword [ebp - 4]
add esp, 4
xor ecx, ebp
xor eax, eax
pop edi
pop esi
pop ebx
call fcn.00415b03
mov esp, ebp
pop ebp
ret 0x18
mov esi, dword [ebp - 0x12c]
mov eax, dword [ebp - 0x138]
add esi, 8
push esi
mov dword [ebp - 0x124], eax
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov ecx, dword [ebp - 0x12c]
lea eax, [ebp - 0x124]
push eax
call fcn.0040c200
push esi
mov dword [eax], edi
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov esi, dword [ebp - 0x134]
push esi
call dword [sym.imp.KERNEL32.dll_ResumeThread]
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x40bfdc