Function at 0x410370
Capabilities:
Act as tcp client
Connect socket
Connect tcp socket
Create tcp socket
Set socket configuration

Disassembly:
push 0xffffffffffffffff
push 0x4762fb
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x38
push ebp
push esi
mov esi, ecx
push edi
lea ecx, [esp + 0xc]
call dword [0x47e138]
xor ebp, ebp
mov ecx, esi
mov dword [esp + 0x4c], ebp
call fcn.0040faf0
lea edi, [esi + 0xc]
mov eax, edi
mov ecx, 0x10
mov edi, edi
mov byte [eax], 0
inc eax
dec ecx
jne 0x4103b0
mov eax, dword [esp + 0x58]
push eax
mov word [edi], 2
call dword [sym.imp.WS2_32.dll_htons]
mov ecx, dword [esp + 0x54]
push ecx
mov word [esi + 0xe], ax
call dword [sym.imp.WS2_32.dll_inet_addr]
push 6
push 1
push 2
mov dword [esi + 0x10], eax
call dword [sym.imp.WS2_32.dll_socket]
cmp eax, 0xffffffff
mov dword [esi + 8], eax
jne 0x410432
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
push eax
lea edx, [esp + 0x10]
push str.socket_Error_Code__d
push edx
call dword [sym.imp.MFC71.DLL_ATL::CStringT::Format]
mov eax, dword [esp + 0x18]
push eax
call fcn.00417710
add esp, 0x10
lea ecx, [esp + 0xc]
call dword [sym.imp.MFC71.DLL_ATL::CStringT::CStringT]
pop edi
pop esi
or eax, 0xffffffff
pop ebp
mov ecx, dword [esp + 0x38]
mov dword fs:[0], ecx
add esp, 0x44
ret 0xc
lea ecx, [esp + 0x14]
push ecx
push 0x8004667e
push eax
mov dword [esp + 0x20], 1
call dword [sym.imp.WS2_32.dll_ioctlsocket]
cmp eax, 0xffffffff
jne 0x410492
lea edx, [esp + 0x58]
push ebp
push edx
call fcn.00411600
mov eax, dword [eax]
push eax
lea ecx, [esp + 0x18]
push str.ioctlsocket__s
push ecx
mov byte [esp + 0x60], 1
call dword [sym.imp.MFC71.DLL_ATL::CStringT::Format]
add esp, 0x14
lea ecx, [esp + 0x58]
mov byte [esp + 0x4c], 0
call dword [sym.imp.MFC71.DLL_ATL::CStringT::CStringT]
mov edx, dword [esp + 0xc]
push edx
call fcn.00417710
add esp, 4
call dword [sym.imp.WS2_32.dll_WSACreateEvent]
cmp eax, ebp
mov dword [esp + 0x10], eax
jne 0x4104f1
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
push eax
lea eax, [esp + 0x10]
push str.WSACreateEvent_Error_Code__d
push eax
call dword [sym.imp.MFC71.DLL_ATL::CStringT::Format]
mov ecx, dword [esp + 0x18]
push ecx
call fcn.00417710
mov edx, dword [esi + 8]
add esp, 0x10
push edx
call dword [sym.imp.WS2_32.dll_closesocket]
lea ecx, [esp + 0xc]
call dword [sym.imp.MFC71.DLL_ATL::CStringT::CStringT]
pop edi
pop esi
mov eax, 0xfffffffd
pop ebp
mov ecx, dword [esp + 0x38]
mov dword fs:[0], ecx
add esp, 0x44
ret 0xc
push 0x10
push eax
mov eax, dword [esi + 8]
push eax
call dword [sym.imp.WS2_32.dll_WSAEventSelect]
cmp eax, 0xffffffff
jne 0x41055f
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
push eax
lea ecx, [esp + 0x10]
push str.WSAEventSelect_Error_Code__d
push ecx
call dword [sym.imp.MFC71.DLL_ATL::CStringT::Format]
mov edx, dword [esp + 0x18]
push edx
call fcn.00417710
mov eax, dword [esi + 8]
add esp, 0x10
push eax
call dword [sym.imp.WS2_32.dll_closesocket]
mov ecx, dword [esp + 0x10]
push ecx
call dword [sym.imp.WS2_32.dll_WSACloseEvent]
lea ecx, [esp + 0xc]
call dword [sym.imp.MFC71.DLL_ATL::CStringT::CStringT]
pop edi
pop esi
mov eax, 0xfffffffc
pop ebp
mov ecx, dword [esp + 0x38]
mov dword fs:[0], ecx
add esp, 0x44
ret 0xc
mov edx, dword [esi + 8]
push 0x10
push edi
push edx
call dword [sym.imp.WS2_32.dll_connect]
cmp eax, 0xffffffff
jne 0x4105d9
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
cmp eax, 0x2733
je 0x4105d9
push eax
lea eax, [esp + 0x10]
push str.connect_error:Code__d
push eax
call dword [sym.imp.MFC71.DLL_ATL::CStringT::Format]
mov ecx, dword [esp + 0x18]
push ecx
call fcn.00417710
add esp, 0x10
push 0xffffffffffffffff
mov dword [esi + 8], 0xffffffff
call dword [sym.imp.WS2_32.dll_closesocket]
mov edx, dword [esp + 0x10]
push edx
call dword [sym.imp.WS2_32.dll_WSACloseEvent]
lea ecx, [esp + 0xc]
call dword [sym.imp.MFC71.DLL_ATL::CStringT::CStringT]
pop edi
pop esi
mov eax, 0xfffffffb
pop ebp
mov ecx, dword [esp + 0x38]
mov dword fs:[0], ecx
add esp, 0x44
ret 0xc
mov edi, dword [sym.imp.KERNEL32.dll_SleepEx]
push ebx
mov ebx, dword [sym.imp.WS2_32.dll_WSAWaitForMultipleEvents]
push 1
push 0
call edi
push 0
push 0x2710
push 0
lea eax, [esp + 0x20]
push eax
push 1
call ebx
cmp eax, 0xffffffff
jne 0x41064d
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
push eax
lea ecx, [esp + 0x60]
push ecx
call fcn.00411600
mov edx, dword [eax]
push edx
lea eax, [esp + 0x1c]
push str.WSAWaitForMultipleEvents__s
push eax
mov byte [esp + 0x64], 2
call dword [sym.imp.MFC71.DLL_ATL::CStringT::Format]
add esp, 0x14
lea ecx, [esp + 0x5c]
mov byte [esp + 0x50], 0
call dword [sym.imp.MFC71.DLL_ATL::CStringT::CStringT]
mov ecx, dword [esp + 0x10]
push ecx
call fcn.00417710
add esp, 4
jmp 0x410671
cmp eax, 0x102
jne 0x4106bb
lea edx, [esp + 0x10]
push str.WSAWaitForMultipleEvents_Error_Code_WSA_WAIT_TIMEOUT
push edx
call dword [sym.imp.MFC71.DLL_ATL::CStringT::Format]
mov eax, dword [esp + 0x18]
push eax
call fcn.00417710
add esp, 0xc
push 0
push 0x1f4
call edi
inc ebp
cmp ebp, 3
jl 0x4105e6
mov edx, dword [esi + 8]
push edx
call dword [sym.imp.WS2_32.dll_closesocket]
mov eax, dword [esp + 0x14]
push eax
call dword [sym.imp.WS2_32.dll_WSACloseEvent]
lea ecx, [esp + 0x10]
call dword [sym.imp.MFC71.DLL_ATL::CStringT::CStringT]
pop ebx
pop edi
pop esi
or eax, 0xffffffff
pop ebp
mov ecx, dword [esp + 0x38]
mov dword fs:[0], ecx
add esp, 0x44
ret 0xc
xor ebx, ebx
cmp eax, ebx
je 0x410718
push eax
lea ecx, [esp + 0x14]
push str.WSAWaitForMultipleEvents_Error_Code__d
push ecx
call dword [sym.imp.MFC71.DLL_ATL::CStringT::Format]
mov edx, dword [esp + 0x1c]
push edx
call fcn.00417710
mov eax, dword [esi + 8]
add esp, 0x10
push eax
call dword [sym.imp.WS2_32.dll_closesocket]
mov ecx, dword [esp + 0x14]
push ecx
call dword [sym.imp.WS2_32.dll_WSACloseEvent]
lea ecx, [esp + 0x10]
call dword [sym.imp.MFC71.DLL_ATL::CStringT::CStringT]
pop ebx
pop edi
pop esi
mov eax, 0xfffffffa
pop ebp
mov ecx, dword [esp + 0x38]
mov dword fs:[0], ecx
add esp, 0x44
ret 0xc
mov eax, dword [esp + 0x14]
mov ecx, dword [esi + 8]
lea edx, [esp + 0x1c]
push edx
push eax
push ecx
call dword [sym.imp.WS2_32.dll_WSAEnumNetworkEvents]
test byte [esp + 0x1c], 0x10
je 0x4107a7
cmp dword [esp + 0x30], ebx
jne 0x4107a7
mov edi, dword [esi + 0x484]
mov edx, dword [esp + 0x60]
xor eax, eax
mov ecx, 0x1000
rep stosd dword es:[edi], eax
mov eax, dword [esp + 0x14]
push eax
mov dword [esi + 0x488], ebx
mov dword [esi + 0x490], 8
mov dword [esi + 0x494], ebx
mov dword [esi + 0x480], edx
mov dword [esi + 0x47c], 1
call dword [sym.imp.WS2_32.dll_WSACloseEvent]
mov ecx, esi
call fcn.00410330
lea ecx, [esp + 0x10]
mov esi, eax
call dword [sym.imp.MFC71.DLL_ATL::CStringT::CStringT]
pop ebx
pop edi
mov eax, esi
pop esi
pop ebp
mov ecx, dword [esp + 0x38]
mov dword fs:[0], ecx
add esp, 0x44
ret 0xc
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov ecx, dword [esp + 0x30]
mov edx, dword [esp + 0x1c]
push ecx
push eax
push edx
push str.WSAEnumNetworkEvents___Contact_Event_Error__NetworkEvent_:__ld__nRetCode_:__d__iErrorCode_:__d
call fcn.00417710
mov eax, dword [esi + 8]
add esp, 0x10
push eax
call dword [sym.imp.WS2_32.dll_closesocket]
mov ecx, dword [esp + 0x14]
push ecx
call dword [sym.imp.WS2_32.dll_WSACloseEvent]
lea ecx, [esp + 0x10]
call dword [sym.imp.MFC71.DLL_ATL::CStringT::CStringT]
mov ecx, dword [esp + 0x48]
pop ebx
pop edi
pop esi
mov eax, 0xfffffff9
pop ebp
mov dword fs:[0], ecx
add esp, 0x44
ret 0xc