Function at 0x403fd0
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, 0x134
push ebx
push esi
push edi
push 0
mov edi, 2
push 1
push edi
xor bl, bl
call sub.WSOCK32.dll_socket
mov esi, dword [esp + 0x144]
cmp eax, 0xffffffff
mov dword [esi + 0x1c], eax
jne 0x404012
push str.TCP_Link_Error_opening_socket
call sym.Sure_XLite.exe_xLogMsg
add esp, 4
xor al, al
pop edi
pop esi
pop ebx
add esp, 0x134
ret
lea ecx, [esp + 0x20]
push 4
push ecx
push 4
push 0xffff
push eax
mov dword [esp + 0x34], 1
call sub.WSOCK32.dll_setsockopt
cmp eax, 0xffffffff
jne 0x40405e
mov edx, dword [esi + 0x1c]
push edx
call sub.WSOCK32.dll_closesocket
push str.TCP_Out___Error_sharing_socket_port
call sym.Sure_XLite.exe_xLogMsg
mov eax, dword [esi + 0x1c]
add esp, 4
push eax
call sub.WSOCK32.dll_closesocket
pop edi
pop esi
xor al, al
pop ebx
add esp, 0x134
ret
mov edx, dword [esi + 0x1c]
lea ecx, [esp + 0xc]
push 4
push ecx
push 0x1001
push 0xffff
push edx
mov dword [esp + 0x20], 0xffff
call sub.WSOCK32.dll_setsockopt
cmp eax, 0xffffffff
jne 0x4040b0
mov eax, dword [esi + 0x1c]
push eax
call sub.WSOCK32.dll_closesocket
push str.TCP_Out___Error_setting_socket_buffer
call sym.Sure_XLite.exe_xLogMsg
mov ecx, dword [esi + 0x1c]
add esp, 4
push ecx
call sub.WSOCK32.dll_closesocket
pop edi
pop esi
xor al, al
pop ebx
add esp, 0x134
ret
push 0
mov word [esp + 0x30], di
call sub.WSOCK32.dll_htons
mov ecx, dword [esi + 0x1c]
mov edx, dword [esi + 0x10]
mov word [esp + 0x2e], ax
lea eax, [esp + 0x2c]
push 0x10
push eax
push ecx
mov dword [esp + 0x3c], edx
call sub.WSOCK32.dll_bind
cmp eax, 0xffffffff
jne 0x404110
call sub.WSOCK32.dll_WSAGetLastError
mov edx, dword [esi + 0x1c]
mov edi, eax
push edx
call sub.WSOCK32.dll_closesocket
push edi
push str.Rprt_TCP_Link___Error_binding_socket_Err_d
call sym.Sure_XLite.exe_xLogMsg
mov eax, dword [esi + 0x1c]
add esp, 8
push eax
call sub.WSOCK32.dll_closesocket
pop edi
pop esi
xor al, al
pop ebx
add esp, 0x134
ret
mov cx, word [esi + 6]
mov word [esp + 0x10], di
push ecx
call sub.WSOCK32.dll_htons
mov word [esp + 0x12], ax
mov ecx, dword [esp + 0x10]
mov eax, dword [esi + 0xc]
lea edx, [esi + 0x28]
mov dword [esp + 0x14], eax
push 0x10
mov dword [edx], ecx
mov ecx, dword [esp + 0x20]
mov dword [edx + 4], eax
mov eax, dword [esp + 0x1c]
mov dword [edx + 8], eax
mov eax, dword [esi + 0x1c]
mov dword [edx + 0xc], ecx
lea edx, [esp + 0x14]
push edx
push eax
call sub.WSOCK32.dll_connect
test eax, eax
je 0x404193
call sub.WSOCK32.dll_WSAGetLastError
mov edx, dword [esp + 0x14]
xor ecx, ecx
mov cx, word [esi + 6]
push eax
push ecx
push edx
call sub.WSOCK32.dll_inet_ntoa
push eax
push str.TCP_Link_failure_to__s:_d_err_d
call sym.Sure_XLite.exe_xLogMsg
mov eax, dword [esi + 0x1c]
add esp, 0x10
push eax
call sub.WSOCK32.dll_closesocket
pop edi
pop esi
xor al, al
pop ebx
add esp, 0x134
ret
mov al, byte [esp + 0x148]
test al, al
je 0x404212
mov ecx, dword [esi + 0x1c]
lea edx, [esp + 0x24]
push edx
lea eax, [esp + 0x40]
push 0
push eax
push 0
push 1
mov dword [esp + 0x50], 1
mov dword [esp + 0x54], ecx
mov dword [esp + 0x38], 0xa
mov dword [esp + 0x3c], 0
call sub.WSOCK32.dll_select
cmp eax, 0xffffffff
jne 0x4041ff
call sub.WSOCK32.dll_WSAGetLastError
push eax
push str.Agent_Connect_Socket_Err_d
call sym.Sure_XLite.exe_xLogMsg
add esp, 8
mov ecx, dword [esi + 0x1c]
push ecx
call sub.WSOCK32.dll_closesocket
pop edi
mov al, bl
pop esi
pop ebx
add esp, 0x134
ret
test eax, eax
jne 0x404212
push str.Agent_Connect_Timeout__
call sym.Sure_XLite.exe_xLogMsg
add esp, 4
jmp 0x4041ea
mov bl, 1
pop edi
mov al, bl
pop esi
pop ebx
add esp, 0x134
ret