Function at 0x40df30
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:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x4265a9
mov eax, dword fs:[0]
push eax
sub esp, 0x540
mov eax, dword [0x435080]
xor eax, ebp
mov dword [ebp - 0x10], eax
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
cmp dword [ebp + 0xc], 0
jne 0x40e032
mov eax, dword [ebp + 0x10]
push eax
push str.SOCKET:_s:TCP:opening...
lea ecx, [ebp - 0x50]
push ecx
call fcn.00418d50
add esp, 0xc
mov dword [ebp - 0x4f8], eax
mov edx, dword [ebp - 0x4f8]
mov dword [ebp - 0x4fc], edx
mov dword [ebp - 4], 0
mov ecx, dword [ebp - 0x4fc]
call fcn.00404660
push eax
mov ecx, 0x438c48
call fcn.0041ff00
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x50]
call fcn.00406240
push 0
push 1
push 2
call sub.WS2_32.dll_socket
mov dword [ebp - 0x4b0], eax
cmp dword [ebp - 0x4b0], 0
jge 0x40e02d
mov eax, dword [ebp + 0x10]
push eax
push 0x429218
lea ecx, [ebp - 0x68]
push ecx
call fcn.00418d50
add esp, 0xc
mov dword [ebp - 0x500], eax
mov edx, dword [ebp - 0x500]
mov dword [ebp - 0x504], edx
mov dword [ebp - 4], 1
mov ecx, dword [ebp - 0x504]
call fcn.00404660
push eax
mov ecx, 0x438c48
call fcn.0041ff00
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x68]
call fcn.00406240
or eax, 0xffffffff
jmp 0x40e768
jmp 0x40e100
mov eax, dword [ebp + 0x10]
push eax
push str.SOCKET:_s:UDP:opening...
lea ecx, [ebp - 0x80]
push ecx
call fcn.00418d50
add esp, 0xc
mov dword [ebp - 0x508], eax
mov edx, dword [ebp - 0x508]
mov dword [ebp - 0x4d4], edx
mov dword [ebp - 4], 2
mov ecx, dword [ebp - 0x4d4]
call fcn.00404660
push eax
mov ecx, 0x438c48
call fcn.0041ff00
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x80]
call fcn.00406240
push 0
push 2
push 2
call sub.WS2_32.dll_socket
mov dword [ebp - 0x4b0], eax
cmp dword [ebp - 0x4b0], 0
jge 0x40e100
mov eax, dword [ebp + 0x10]
push eax
push str.SOCKET:_s:ERR:opening
lea ecx, [ebp - 0x98]
push ecx
call fcn.00418d50
add esp, 0xc
mov dword [ebp - 0x50c], eax
mov edx, dword [ebp - 0x50c]
mov dword [ebp - 0x510], edx
mov dword [ebp - 4], 3
mov ecx, dword [ebp - 0x510]
call fcn.00404660
push eax
mov ecx, 0x438c48
call fcn.0041ff00
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x98]
call fcn.00406240
or eax, 0xffffffff
jmp 0x40e768
mov eax, dword [ebp + 8]
mov ecx, dword [ebp - 0x4b0]
mov dword [eax], ecx
push 0x40
mov edx, dword [ebp + 8]
mov eax, dword [edx]
push eax
mov ecx, dword [ebp + 0x10]
push ecx
push str.SOCKET:_s:INFO:socket_descriptor_u__FD_SETSIZE_u
lea edx, [ebp - 0xb0]
push edx
call fcn.00418d50
add esp, 0x14
mov dword [ebp - 0x514], eax
mov eax, dword [ebp - 0x514]
mov dword [ebp - 0x518], eax
mov dword [ebp - 4], 4
mov ecx, dword [ebp - 0x518]
call fcn.00404660
push eax
mov ecx, 0x438c48
call fcn.0041ff00
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0xb0]
call fcn.00406240
push 0
push 0x10
lea ecx, [ebp - 0x20]
push ecx
call dword [sym.imp.api_ms_win_crt_string_l1_1_0.dll__strnset]
add esp, 0xc
mov edx, 2
mov word [ebp - 0x20], dx
mov eax, dword [ebp + 0x14]
push eax
call sub.WS2_32.dll_inet_addr
mov dword [ebp - 0x1c], eax
movzx ecx, word [ebp + 0x18]
push ecx
call sub.WS2_32.dll_htons
mov word [ebp - 0x1e], ax
mov edx, 1
test edx, edx
je 0x40e679
mov dword [ebp - 0x51c], 1
lea eax, [ebp - 0x51c]
push eax
push 0x8004667e
mov ecx, dword [ebp + 8]
mov edx, dword [ecx]
push edx
call sub.WS2_32.dll_ioctlsocket
mov eax, dword [ebp + 0x10]
push eax
push 0x429298
lea ecx, [ebp - 0xc8]
push ecx
call fcn.00418d50
add esp, 0xc
mov dword [ebp - 0x520], eax
mov edx, dword [ebp - 0x520]
mov dword [ebp - 0x524], edx
mov dword [ebp - 4], 5
mov ecx, dword [ebp - 0x524]
call fcn.00404660
push eax
mov ecx, 0x438c48
call fcn.0041ff00
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0xc8]
call fcn.00406240
push 0x10
lea eax, [ebp - 0x20]
push eax
mov ecx, dword [ebp + 8]
mov edx, dword [ecx]
push edx
call sub.WS2_32.dll_connect
mov dword [ebp - 0x52c], eax
mov eax, dword [ebp - 0x52c]
push eax
mov ecx, dword [ebp + 0x10]
push ecx
push str.SOCKET:_s:INFO:connected_res_d
lea edx, [ebp - 0xe0]
push edx
call fcn.00418d50
add esp, 0x10
mov dword [ebp - 0x530], eax
mov eax, dword [ebp - 0x530]
mov dword [ebp - 0x534], eax
mov dword [ebp - 4], 6
mov ecx, dword [ebp - 0x534]
call fcn.00404660
push eax
mov ecx, 0x438c48
call fcn.0041ff00
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0xe0]
call fcn.00406240
mov ecx, dword [ebp + 8]
mov edx, dword [ecx]
add edx, 1
mov dword [ebp - 0x538], edx
mov dword [ebp - 0x2a4], 0
cmp dword [ebp - 0x2a4], 0x40
jae 0x40e2e0
mov eax, dword [ebp - 0x2a4]
mov ecx, dword [ebp + 8]
mov edx, dword [ecx]
mov dword [ebp + eax*4 - 0x2a0], edx
mov eax, dword [ebp - 0x2a4]
add eax, 1
mov dword [ebp - 0x2a4], eax
xor ecx, ecx
jne 0x40e2b6
mov dword [ebp - 0x3a8], 0
cmp dword [ebp - 0x3a8], 0x40
jae 0x40e318
mov edx, dword [ebp - 0x3a8]
mov eax, dword [ebp + 8]
mov ecx, dword [eax]
mov dword [ebp + edx*4 - 0x3a4], ecx
mov edx, dword [ebp - 0x3a8]
add edx, 1
mov dword [ebp - 0x3a8], edx
xor eax, eax
jne 0x40e2ee
mov dword [ebp - 0x4ac], 0
cmp dword [ebp - 0x4ac], 0x40
jae 0x40e350
mov ecx, dword [ebp - 0x4ac]
mov edx, dword [ebp + 8]
mov eax, dword [edx]
mov dword [ebp + ecx*4 - 0x4a8], eax
mov ecx, dword [ebp - 0x4ac]
add ecx, 1
mov dword [ebp - 0x4ac], ecx
xor edx, edx
jne 0x40e326
mov dword [ebp - 0x54c], 0
mov dword [ebp - 0x548], 0x186a0
lea eax, [ebp - 0x54c]
push eax
lea ecx, [ebp - 0x4ac]
push ecx
lea edx, [ebp - 0x3a8]
push edx
lea eax, [ebp - 0x2a4]
push eax
mov ecx, dword [ebp - 0x538]
push ecx
call sub.WS2_32.dll_select
mov dword [ebp - 0x4b4], eax
mov edx, dword [ebp - 0x4b4]
push edx
mov eax, dword [ebp + 0x10]
push eax
push str.SOCKET:_s:select___d
lea ecx, [ebp - 0xf8]
push ecx
call fcn.00418d50
add esp, 0x10
mov dword [ebp - 0x53c], eax
mov edx, dword [ebp - 0x53c]
mov dword [ebp - 0x540], edx
mov dword [ebp - 4], 7
mov ecx, dword [ebp - 0x540]
call fcn.00404660
push eax
mov ecx, 0x438c48
call fcn.0041ff00
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0xf8]
call fcn.00406240
cmp dword [ebp - 0x4b4], 0xffffffff
jne 0x40e465
mov eax, dword [ebp + 0x10]
push eax
push str.SOCKET:_s:ERR:select_SOCKET_ERROR
lea ecx, [ebp - 0x110]
push ecx
call fcn.00418d50
add esp, 0xc
mov dword [ebp - 0x544], eax
mov edx, dword [ebp - 0x544]
mov dword [ebp - 0x4b8], edx
mov dword [ebp - 4], 8
mov ecx, dword [ebp - 0x4b8]
call fcn.00404660
push eax
mov ecx, 0x438c48
call fcn.0041ff00
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x110]
call fcn.00406240
or eax, 0xffffffff
jmp 0x40e768
cmp dword [ebp - 0x4b4], 0
jne 0x40e4d4
mov eax, dword [ebp + 0x10]
push eax
push str.SOCKET:_s:ERR:select_timeout
lea ecx, [ebp - 0x128]
push ecx
call fcn.00418d50
add esp, 0xc
mov dword [ebp - 0x4bc], eax
mov edx, dword [ebp - 0x4bc]
mov dword [ebp - 0x4c0], edx
mov dword [ebp - 4], 9
mov ecx, dword [ebp - 0x4c0]
call fcn.00404660
push eax
mov ecx, 0x438c48
call fcn.0041ff00
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x128]
call fcn.00406240
or eax, 0xffffffff
jmp 0x40e768
mov eax, dword [ebp + 0x10]
push eax
push str.SOCKET:_s:INFO:select_succeeded
lea ecx, [ebp - 0x140]
push ecx
call fcn.00418d50
add esp, 0xc
mov dword [ebp - 0x4c4], eax
mov edx, dword [ebp - 0x4c4]
mov dword [ebp - 0x4c8], edx
mov dword [ebp - 4], 0xa
mov ecx, dword [ebp - 0x4c8]
call fcn.00404660
push eax
mov ecx, 0x438c48
call fcn.0041ff00
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x140]
call fcn.00406240
lea eax, [ebp - 0x2a4]
push eax
mov ecx, dword [ebp + 8]
mov edx, dword [ecx]
push edx
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
je 0x40e596
mov eax, dword [ebp + 0x10]
push eax
push str.SOCKET:_s:INFO:is_ready_to_read
lea ecx, [ebp - 0x38]
push ecx
call fcn.00418d50
add esp, 0xc
mov dword [ebp - 0x4cc], eax
mov edx, dword [ebp - 0x4cc]
mov dword [ebp - 0x4d0], edx
mov dword [ebp - 4], 0xb
mov ecx, dword [ebp - 0x4d0]
call fcn.00404660
push eax
mov ecx, 0x438c48
call fcn.0041ff00
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x38]
call fcn.00406240
lea eax, [ebp - 0x3a8]
push eax
mov ecx, dword [ebp + 8]
mov edx, dword [ecx]
push edx
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
je 0x40e605
mov eax, dword [ebp + 0x10]
push eax
push str.SOCKET:_s:INFO:is_ready_to_write
lea ecx, [ebp - 0x158]
push ecx
call fcn.00418d50
add esp, 0xc
mov dword [ebp - 0x528], eax
mov edx, dword [ebp - 0x528]
mov dword [ebp - 0x4d8], edx
mov dword [ebp - 4], 0xc
mov ecx, dword [ebp - 0x4d8]
call fcn.00404660
push eax
mov ecx, 0x438c48
call fcn.0041ff00
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x158]
call fcn.00406240
lea eax, [ebp - 0x4ac]
push eax
mov ecx, dword [ebp + 8]
mov edx, dword [ecx]
push edx
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
je 0x40e674
mov eax, dword [ebp + 0x10]
push eax
push str.SOCKET:_s:ERR:has_error_pending
lea ecx, [ebp - 0x170]
push ecx
call fcn.00418d50
add esp, 0xc
mov dword [ebp - 0x4dc], eax
mov edx, dword [ebp - 0x4dc]
mov dword [ebp - 0x4e0], edx
mov dword [ebp - 4], 0xd
mov ecx, dword [ebp - 0x4e0]
call fcn.00404660
push eax
mov ecx, 0x438c48
call fcn.0041ff00
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x170]
call fcn.00406240
jmp 0x40e766
mov eax, dword [ebp + 0x10]
push eax
push str.SOCKET:_s:INFO:connecting...
lea ecx, [ebp - 0x188]
push ecx
call fcn.00418d50
add esp, 0xc
mov dword [ebp - 0x4e4], eax
mov edx, dword [ebp - 0x4e4]
mov dword [ebp - 0x4e8], edx
mov dword [ebp - 4], 0xe
mov ecx, dword [ebp - 0x4e8]
call fcn.00404660
push eax
mov ecx, 0x438c48
call fcn.0041ff00
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x188]
call fcn.00406240
push 0x10
lea eax, [ebp - 0x20]
push eax
mov ecx, dword [ebp + 8]
mov edx, dword [ecx]
push edx
call sub.WS2_32.dll_connect
test eax, eax
jge 0x40e745
mov eax, dword [ebp + 0x10]
push eax
push str.SOCKET:_s:ERR:connecting_to_server
lea ecx, [ebp - 0x1a0]
push ecx
call fcn.00418d50
add esp, 0xc
mov dword [ebp - 0x4ec], eax
mov edx, dword [ebp - 0x4ec]
mov dword [ebp - 0x4f0], edx
mov dword [ebp - 4], 0xf
mov ecx, dword [ebp - 0x4f0]
call fcn.00404660
push eax
mov ecx, 0x438c48
call fcn.0041ff00
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x1a0]
call fcn.00406240
or eax, 0xffffffff
jmp 0x40e768
mov dword [ebp - 0x4f4], 1
lea eax, [ebp - 0x4f4]
push eax
push 0x8004667e
mov ecx, dword [ebp + 8]
mov edx, dword [ecx]
push edx
call sub.WS2_32.dll_ioctlsocket
xor eax, eax
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.00424a63
mov esp, ebp
pop ebp
ret