Function at 0x40e120
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 0xfffffffffffffffe
push 0x4161d0
push 0x408580
mov eax, dword fs:[0]
push eax
add esp, 0xfffffeb4
mov eax, dword [0x417084]
xor dword [ebp - 8], eax
xor eax, ebp
mov dword [ebp - 0x24], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0x10]
mov dword fs:[0], eax
mov dword [ebp - 0x144], 0
mov dword [ebp - 0x20], 0xffffffff
mov dword [ebp - 0x1c], 1
mov dword [ebp - 0x158], 1
mov dword [ebp - 0x14c], 0
mov dword [ebp - 0x148], 0
mov dword [ebp - 4], 0
mov eax, dword [ebp + 8]
mov dword [ebp - 0x13c], eax
mov ecx, 2
mov word [ebp - 0x140], cx
movzx edx, word [ebp + 0xc]
push edx
call dword [sym.imp.WS2_32.dll_htons]
mov word [ebp - 0x13e], ax
push 0
push 1
push 2
call dword [sym.imp.WS2_32.dll_socket]
mov dword [ebp - 0x20], eax
cmp dword [ebp - 0x20], 0xffffffff
jne 0x40e1e0
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov dword [ebp - 0x144], eax
jmp 0x40e3e4
lea eax, [ebp - 0x158]
push eax
push 0x8004667e
mov ecx, dword [ebp - 0x20]
push ecx
call dword [sym.imp.WS2_32.dll_ioctlsocket]
cmp eax, 0xffffffff
jne 0x40e20c
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov dword [ebp - 0x144], eax
jmp 0x40e3e4
push 0x10
lea edx, [ebp - 0x140]
push edx
mov eax, dword [ebp - 0x20]
push eax
call dword [sym.imp.WS2_32.dll_connect]
cmp eax, 0xffffffff
jne 0x40e315
mov dword [ebp - 0x130], 0
mov dword [ebp - 0x15c], 0
jmp 0x40e24d
mov ecx, dword [ebp - 0x15c]
add ecx, 1
mov dword [ebp - 0x15c], ecx
mov edx, dword [ebp - 0x15c]
cmp edx, dword [ebp - 0x130]
jae 0x40e271
mov eax, dword [ebp - 0x15c]
mov ecx, dword [ebp + eax*4 - 0x12c]
cmp ecx, dword [ebp - 0x20]
jne 0x40e26f
jmp 0x40e271
jmp 0x40e23e
mov edx, dword [ebp - 0x15c]
cmp edx, dword [ebp - 0x130]
jne 0x40e2a7
cmp dword [ebp - 0x130], 0x40
jae 0x40e2a7
mov eax, dword [ebp - 0x15c]
mov ecx, dword [ebp - 0x20]
mov dword [ebp + eax*4 - 0x12c], ecx
mov edx, dword [ebp - 0x130]
add edx, 1
mov dword [ebp - 0x130], edx
xor eax, eax
jne 0x40e232
mov ecx, dword [0x417e44]
mov dword [ebp - 0x154], ecx
mov dword [ebp - 0x150], 0
lea edx, [ebp - 0x154]
push edx
push 0
lea eax, [ebp - 0x130]
push eax
push 0
push 0
call dword [sym.imp.WS2_32.dll_select]
mov dword [ebp - 0x148], eax
cmp dword [ebp - 0x148], 0xffffffff
jne 0x40e2fd
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov dword [ebp - 0x144], eax
jmp 0x40e3e4
cmp dword [ebp - 0x148], 0
jne 0x40e315
mov dword [ebp - 0x144], 0x102
jmp 0x40e3e4
mov dword [ebp - 0x158], 0
lea ecx, [ebp - 0x158]
push ecx
push 0x8004667e
mov edx, dword [ebp - 0x20]
push edx
call dword [sym.imp.WS2_32.dll_ioctlsocket]
cmp eax, 0xffffffff
jne 0x40e34b
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov dword [ebp - 0x144], eax
jmp 0x40e3e4
push 4
lea eax, [ebp - 0x1c]
push eax
push 1
push 6
mov ecx, dword [ebp - 0x20]
push ecx
call dword [sym.imp.WS2_32.dll_setsockopt]
cmp eax, 0xffffffff
jne 0x40e372
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov dword [ebp - 0x144], eax
jmp 0x40e3e4
mov dword [ebp - 0x14c], 0x1388
push 4
lea edx, [ebp - 0x14c]
push edx
push 0x1006
push 0xffff
mov eax, dword [ebp - 0x20]
push eax
call dword [sym.imp.WS2_32.dll_setsockopt]
cmp eax, 0xffffffff
jne 0x40e3ac
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov dword [ebp - 0x144], eax
jmp 0x40e3e4
push 4
lea ecx, [ebp - 0x14c]
push ecx
push 0x1005
push 0xffff
mov edx, dword [ebp - 0x20]
push edx
call dword [sym.imp.WS2_32.dll_setsockopt]
cmp eax, 0xffffffff
jne 0x40e3dc
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov dword [ebp - 0x144], eax
jmp 0x40e3e4
mov eax, dword [ebp + 0x10]
mov ecx, dword [ebp - 0x20]
mov dword [eax], ecx
mov dword [ebp - 4], 0xfffffffe
call fcn.0040e3f2
jmp 0x40e40c
mov eax, dword [ebp - 0x144]
mov ecx, dword [ebp - 0x10]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x24]
xor ecx, ebp
call fcn.00402b6d
mov esp, ebp
pop ebp
ret