Function at 0x40d010
Capabilities:
Act as tcp client
Connect socket
Connect tcp socket
Connect udp socket
Create tcp socket
Create udp socket
Get socket status
Resolve function by parsing pe exports
Set socket configuration

Disassembly:
push 0xffffffffffffffff
push 0x4291e9
mov eax, dword fs:[0]
push eax
sub esp, 0x398
mov eax, dword [0x43bca0]
xor eax, esp
mov dword [esp + 0x390], eax
push ebx
push ebp
push esi
push edi
mov eax, dword [0x43bca0]
xor eax, esp
push eax
lea eax, [esp + 0x3ac]
mov dword fs:[0], eax
mov eax, dword [esp + 0x3bc]
mov esi, dword [esp + 0x3c0]
xor ebx, ebx
push ebx
mov ebp, 1
mov dword [esp + 0x1c], eax
mov eax, dword [esp + 0x3d0]
push ebp
mov dword [esp + 0x34], ebx
push 2
mov dword [esp + 0x20], eax
mov dword [eax], ebx
call dword [sym.imp.WS2_32.dll_socket]
mov edi, eax
cmp edi, 0xffffffff
jne 0x40d112
mov ecx, dword [esp + 0x14]
mov dword [ecx], ebp
push str.socket_create_fail
lea ecx, [esp + 0xe8]
call dword [sym.imp.MSVCP80.dll_public:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::constructor_char_const__]
lea edx, [esp + 0x120]
push edx
mov dword [esp + 0x3b8], ebp
call fcn.0040daf0
mov esi, eax
mov byte [esp + 0x3b4], 2
lea ecx, [esp + 0x34]
mov dword [esp + 0x30], vtable.Catalyst::Exception.0
call dword [sym.imp.MSVCP80.dll_public:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::constructor_void_]
lea eax, [esp + 0xe4]
push eax
lea ecx, [esp + 0x38]
call dword [0x42c508]
cmp dword [esi + 0x14], ebx
je 0x40d103
push str.____
lea ecx, [esp + 0x38]
call dword [sym.imp.MSVCP80.dll_public:_class_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char______thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::operator_char_const__]
push esi
lea ecx, [esp + 0x38]
call dword [sym.imp.MSVCP80.dll_public:_class_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char______thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::operator_class_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char___const__]
push 0x434428
lea ecx, [esp + 0x34]
push ecx
call sub.MSVCR80.dll__CxxThrowException
lea edx, [esp + 0x1c]
push edx
push 0x8004667e
push edi
mov dword [esp + 0x28], ebp
call dword [sym.imp.WS2_32.dll_ioctlsocket]
push 0x10
add esi, 0x38
push esi
push edi
call dword [sym.imp.WS2_32.dll_connect]
cmp eax, 0xffffffff
jne 0x40d40a
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
cmp eax, 0x2733
jne 0x40d39a
mov eax, dword [esp + 0x3c4]
mov cl, byte [eax]
xor esi, esi
test cl, cl
je 0x40d1fc
add esi, ebp
cmp esi, 0xa
jge 0x40d1fc
lea edx, [esp + 0x24]
push edx
lea eax, [esp + 0x140]
push eax
lea ecx, [esp + 0x24c]
push ecx
push ebx
lea edx, [edi + 1]
push edx
mov dword [esp + 0x25c], edi
mov dword [esp + 0x258], ebp
mov dword [esp + 0x154], edi
mov dword [esp + 0x150], ebp
mov dword [esp + 0x38], ebx
mov dword [esp + 0x3c], 0xc350
call dword [sym.imp.WS2_32.dll_select]
test eax, eax
jle 0x40d1e4
lea eax, [esp + 0x244]
push eax
push edi
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
jne 0x40d2a1
lea ecx, [esp + 0x13c]
push ecx
push edi
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
jne 0x40d2f5
push ebp
call dword [sym.imp.KERNEL32.dll_Sleep]
mov edx, dword [esp + 0x3c4]
mov al, byte [edx]
test al, al
jne 0x40d161
lea ecx, [esp + 0x350]
push ecx
call fcn.0040daf0
cmp edi, 0xffffffff
mov dword [esp + 0x3b4], 5
je 0x40d220
push edi
call dword [sym.imp.WS2_32.dll_closesocket]
mov edx, dword [esp + 0x14]
push str.socket_connect_timeout
lea ecx, [esp + 0xb0]
mov dword [edx], 3
call dword [sym.imp.MSVCP80.dll_public:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::constructor_char_const__]
mov byte [esp + 0x3b4], 6
lea ecx, [esp + 0x54]
mov dword [esp + 0x50], vtable.Catalyst::Exception.0
call dword [sym.imp.MSVCP80.dll_public:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::constructor_void_]
lea eax, [esp + 0xac]
push eax
lea ecx, [esp + 0x58]
call dword [0x42c508]
cmp dword [esp + 0x364], ebx
je 0x40d292
push str.____
lea ecx, [esp + 0x58]
call dword [sym.imp.MSVCP80.dll_public:_class_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char______thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::operator_char_const__]
lea ecx, [esp + 0x350]
push ecx
lea ecx, [esp + 0x58]
call dword [sym.imp.MSVCP80.dll_public:_class_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char______thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::operator_class_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char___const__]
push 0x434428
lea edx, [esp + 0x54]
push edx
call sub.MSVCR80.dll__CxxThrowException
push 0x10
call sub.MFC80U.DLL_Ordinal_762
mov esi, eax
add esp, 4
cmp esi, ebx
je 0x40d2e8
lea ecx, [esp + 0x20]
mov dword [esi + 4], vtable.fund::noncopyable.0
push ecx
push 0x8004667e
push edi
mov dword [esi], vtable.Catalyst::Socket.0
mov dword [esi + 4], vtable.Catalyst::Socket.1.0
mov dword [esi + 8], edi
mov byte [esi + 0xc], bl
mov byte [esi + 0xd], bl
mov byte [esi + 0xe], bl
mov dword [esp + 0x2c], ebp
call dword [sym.imp.WS2_32.dll_ioctlsocket]
jmp 0x40d2ea
xor esi, esi
mov eax, dword [esp + 0x18]
mov dword [eax], esi
jmp 0x40d42d
lea edx, [esp + 0x36c]
push edx
call fcn.0040daf0
cmp edi, 0xffffffff
mov dword [esp + 0x3b4], 3
je 0x40d319
push edi
call dword [sym.imp.WS2_32.dll_closesocket]
mov eax, dword [esp + 0x14]
push str.socket_connect_exception
lea ecx, [esp + 0x94]
mov dword [eax], 2
call dword [sym.imp.MSVCP80.dll_public:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::constructor_char_const__]
mov byte [esp + 0x3b4], 4
lea ecx, [esp + 0x74]
mov dword [esp + 0x70], vtable.Catalyst::Exception.0
call dword [sym.imp.MSVCP80.dll_public:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::constructor_void_]
lea ecx, [esp + 0x90]
push ecx
lea ecx, [esp + 0x78]
call dword [0x42c508]
cmp dword [esp + 0x380], ebx
je 0x40d38b
push str.____
lea ecx, [esp + 0x78]
call dword [sym.imp.MSVCP80.dll_public:_class_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char______thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::operator_char_const__]
lea edx, [esp + 0x36c]
push edx
lea ecx, [esp + 0x78]
call dword [sym.imp.MSVCP80.dll_public:_class_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char______thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::operator_class_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char___const__]
push 0x434428
lea eax, [esp + 0x74]
push eax
call sub.MSVCR80.dll__CxxThrowException
lea eax, [esp + 0x388]
push eax
call fcn.0040daf0
cmp edi, 0xffffffff
mov dword [esp + 0x3b4], 7
je 0x40d3be
push edi
call dword [sym.imp.WS2_32.dll_closesocket]
mov ecx, dword [esp + 0x14]
mov dword [ecx], 4
push str.socket_connect_fail
lea ecx, [esp + 0xcc]
call dword [sym.imp.MSVCP80.dll_public:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::constructor_char_const__]
lea edx, [esp + 0xc8]
push edx
lea ebx, [esp + 0x38c]
lea edi, [esp + 0x104]
mov byte [esp + 0x3b8], 8
call fcn.0040ce10
push 0x434428
mov eax, edi
push eax
call sub.MSVCR80.dll__CxxThrowException
push 0x10
call sub.MFC80U.DLL_Ordinal_762
mov esi, eax
add esp, 4
cmp esi, ebx
je 0x40d423
mov eax, edi
call fcn.0040cf90
jmp 0x40d425
xor eax, eax
mov ecx, dword [esp + 0x18]
mov dword [ecx], eax
mov eax, ecx
mov ecx, dword [esp + 0x3ac]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebp
pop ebx
mov ecx, dword [esp + 0x390]
xor ecx, esp
call fcn.00426052
add esp, 0x3a4
ret 0x14