Function at 0x4071bf
Capabilities:
Act as tcp client
Connect socket
Connect tcp socket
Connect udp socket
Create tcp socket
Create udp socket
Get socket status

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x12c
mov dword [ebp - 0x12c], ecx
mov eax, dword [ebp - 0x12c]
mov ecx, dword [ebp + 0xc]
mov dword [eax + 0x390], ecx
cmp dword [ebp + 0x10], 0
jg 0x4071ea
xor al, al
jmp 0x4074e9
push 0x10
push 0
lea edx, [ebp - 0x10]
push edx
call sub.MSVCRT.dll_memset
add esp, 0xc
mov word [ebp - 0x10], 2
mov ax, word [ebp + 0xc]
push eax
call dword [sym.imp.WS2_32.dll_htons]
mov word [ebp - 0xe], ax
mov ecx, dword [ebp + 8]
mov dword [ebp - 0xc], ecx
mov edx, dword [ebp - 0x12c]
mov eax, dword [ebp + 0xc]
mov dword [edx + 0x390], eax
mov ecx, dword [ebp - 0x12c]
mov edx, dword [ebp + 0x10]
mov dword [ecx + 0x394], edx
mov eax, dword [ebp + 0x10]
and eax, 0x80000001
jns 0x407242
dec eax
or eax, 0xfffffffe
inc eax
cmp eax, 1
jne 0x407250
mov dword [ebp - 0x14], 1
jmp 0x407257
mov dword [ebp - 0x14], 0
push 0x10
push 0
lea ecx, [ebp - 0x10]
push ecx
call sub.MSVCRT.dll_memset
add esp, 0xc
mov word [ebp - 0x10], 2
mov dx, word [ebp + 0xc]
push edx
call dword [sym.imp.WS2_32.dll_htons]
mov word [ebp - 0xe], ax
mov eax, dword [ebp + 8]
mov dword [ebp - 0xc], eax
mov ecx, dword [ebp - 0x12c]
mov edx, dword [ebp + 0xc]
mov dword [ecx + 0x390], edx
cmp dword [ebp - 0x14], 1
jne 0x40744c
push 6
push 1
push 2
call dword [sym.imp.WS2_32.dll_socket]
mov ecx, dword [ebp - 0x12c]
mov dword [ecx + 0x18c], eax
mov edx, dword [ebp - 0x12c]
cmp dword [edx + 0x18c], 0xffffffff
jne 0x4072c9
xor al, al
jmp 0x4074e9
push 0x10
lea eax, [ebp - 0x10]
push eax
mov ecx, dword [ebp - 0x12c]
mov edx, dword [ecx + 0x18c]
push edx
call dword [sym.imp.WS2_32.dll_connect]
cmp eax, 0xffffffff
jne 0x4072ee
xor al, al
jmp 0x4074e9
mov dword [ebp - 0x20], 0x14
push 8
push 0
lea eax, [ebp - 0x1c]
push eax
call sub.MSVCRT.dll_memset
add esp, 0xc
mov ecx, dword [ebp - 0x20]
mov dword [ebp - 0x1c], ecx
mov dword [ebp - 0x124], 0
mov dword [ebp - 0x128], 0
jmp 0x407330
mov edx, dword [ebp - 0x128]
add edx, 1
mov dword [ebp - 0x128], edx
mov eax, dword [ebp - 0x128]
cmp eax, dword [ebp - 0x124]
jae 0x40735d
mov ecx, dword [ebp - 0x128]
mov edx, dword [ebp - 0x12c]
mov eax, dword [ebp + ecx*4 - 0x120]
cmp eax, dword [edx + 0x18c]
jne 0x40735b
jmp 0x40735d
jmp 0x407321
mov ecx, dword [ebp - 0x128]
cmp ecx, dword [ebp - 0x124]
jne 0x40739c
cmp dword [ebp - 0x124], 0x40
jae 0x40739c
mov edx, dword [ebp - 0x128]
mov eax, dword [ebp - 0x12c]
mov ecx, dword [eax + 0x18c]
mov dword [ebp + edx*4 - 0x120], ecx
mov edx, dword [ebp - 0x124]
add edx, 1
mov dword [ebp - 0x124], edx
xor eax, eax
test eax, eax
jne 0x407315
lea ecx, [ebp - 0x1c]
push ecx
push 0
lea edx, [ebp - 0x124]
push edx
push 0
mov eax, dword [ebp - 0x12c]
mov ecx, dword [eax + 0x18c]
add ecx, 1
push ecx
call dword [sym.imp.WS2_32.dll_select]
cmp eax, 0xffffffff
jne 0x4073e2
mov ecx, dword [ebp - 0x12c]
call fcn.004076da
xor al, al
jmp 0x4074e9
mov edx, dword [ebp - 0x12c]
mov eax, dword [ebp - 0x12c]
mov ecx, dword [eax + 0x394]
mov dword [edx + 0x3c8], ecx
mov edx, dword [ebp - 0x12c]
add edx, 0x3b8
mov eax, dword [ebp - 0x10]
mov dword [edx], eax
mov ecx, dword [ebp - 0xc]
mov dword [edx + 4], ecx
mov eax, dword [ebp - 8]
mov dword [edx + 8], eax
mov ecx, dword [ebp - 4]
mov dword [edx + 0xc], ecx
mov edx, dword [ebp - 0x12c]
mov eax, dword [ebp - 0x12c]
mov ecx, dword [eax + 0x18c]
mov dword [edx + 0x3a4], ecx
mov edx, dword [ebp - 0x12c]
mov dword [edx + 0x3cc], 0x10
mov al, 1
jmp 0x4074e9
cmp dword [ebp - 0x14], 0
jne 0x4074e7
push 0
push 2
push 2
call dword [sym.imp.WS2_32.dll_socket]
mov ecx, dword [ebp - 0x12c]
mov dword [ecx + 0x18c], eax
mov edx, dword [ebp - 0x12c]
cmp dword [edx + 0x18c], 0xffffffff
jne 0x407481
xor al, al
jmp 0x4074e9
mov eax, dword [ebp - 0x12c]
mov ecx, dword [ebp - 0x12c]
mov edx, dword [ecx + 0x394]
mov dword [eax + 0x3c8], edx
mov eax, dword [ebp - 0x12c]
add eax, 0x3b8
mov ecx, dword [ebp - 0x10]
mov dword [eax], ecx
mov edx, dword [ebp - 0xc]
mov dword [eax + 4], edx
mov ecx, dword [ebp - 8]
mov dword [eax + 8], ecx
mov edx, dword [ebp - 4]
mov dword [eax + 0xc], edx
mov eax, dword [ebp - 0x12c]
mov ecx, dword [ebp - 0x12c]
mov edx, dword [ecx + 0x18c]
mov dword [eax + 0x3a4], edx
mov eax, dword [ebp - 0x12c]
mov dword [eax + 0x3cc], 0x10
mov al, 1
jmp 0x4074e9
mov al, 1
mov esp, ebp
pop ebp
ret 0xc