Function at 0x416650
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
add esp, 0xfffffec0
push ebx
push esi
push edi
xor ebx, ebx
mov dword [ebp - 0x10], ebx
mov ebx, ecx
mov dword [ebp - 8], edx
mov dword [ebp - 4], eax
xor eax, eax
push ebp
push 0x4168c8
push dword fs:[eax]
mov dword fs:[eax], esp
mov byte [ebp - 9], 0
push 0xffffffffffffffff
mov eax, dword [0x418580]
mov eax, dword [eax]
push eax
call sub.KERNEL32.DLL_UnhandledExceptionFilter
inc ebx
push ebx
lea eax, [ebp - 0x10]
mov ecx, 1
mov edx, dword [0x41663c]
call fcn.004046b4
add esp, 4
mov eax, dword [ebp - 0x10]
call fcn.00404500
mov esi, eax
test esi, esi
jl 0x416721
inc esi
xor ebx, ebx
mov edi, dword [ebp - 8]
push 0
push 1
push 2
call sub.wsock32.dll_socket
mov edx, dword [ebp - 0x10]
mov dword [edx + ebx*4], eax
mov dword [ebp - 0x14], 1
lea eax, [ebp - 0x14]
push eax
push 0x8004667e
mov eax, dword [ebp - 0x10]
mov eax, dword [eax + ebx*4]
push eax
call sub.wsock32.dll_ioctlsocket
mov word [ebp - 0x140], 2
mov ax, word [edi]
push eax
call sub.wsock32.dll_htons
mov word [ebp - 0x13e], ax
mov eax, dword [ebp - 4]
mov dword [ebp - 0x13c], eax
push 0x10
lea eax, [ebp - 0x140]
push eax
mov eax, dword [ebp - 0x10]
mov eax, dword [eax + ebx*4]
push eax
call sub.wsock32.dll_connect
inc ebx
add edi, 2
dec esi
jne 0x4166b6
call fcn.00405fd0
add eax, 0xbb8
mov dword [ebp - 0x18], eax
jmp 0x416875
call fcn.00405fd0
mov ecx, dword [ebp - 0x18]
sub ecx, eax
mov eax, ecx
mov ebx, 0x3e8
xor edx, edx
div ebx
mov dword [ebp - 0x28], eax
mov eax, ecx
mov ecx, 0x3e8
xor edx, edx
div ecx
imul eax, edx, 0x3e8
mov dword [ebp - 0x24], eax
lea eax, [ebp - 0x130]
call fcn.0040df64
mov eax, dword [ebp - 0x10]
call fcn.00404500
mov esi, eax
test esi, esi
jl 0x416798
inc esi
xor ebx, ebx
mov eax, dword [ebp - 0x10]
mov eax, dword [eax + ebx*4]
cmp eax, 0xffffffff
je 0x416794
lea edx, [ebp - 0x130]
mov ecx, dword [ebp - 0x10]
call fcn.0040df54
inc ebx
dec esi
jne 0x41677b
cmp dword [ebp - 0x130], 0
je 0x416883
lea eax, [ebp - 0x28]
push eax
push 0
lea eax, [ebp - 0x130]
push eax
push 0
push pe_nt_image_headers32
call sub.wsock32.dll_select
test eax, eax
jle 0x416875
mov eax, dword [ebp - 0x10]
call fcn.00404500
mov esi, eax
test esi, esi
jl 0x416875
inc esi
xor ebx, ebx
mov edi, dword [ebp + 0xc]
mov eax, dword [ebp - 8]
mov dword [ebp - 0x2c], eax
mov eax, dword [ebp - 0x10]
cmp dword [eax + ebx*4], 0xffffffff
je 0x416868
lea edx, [ebp - 0x130]
mov eax, dword [ebp - 0x10]
mov eax, dword [eax + ebx*4]
call fcn.0040df3c
test al, al
je 0x416868
mov eax, dword [ebp - 0x10]
mov eax, dword [eax + ebx*4]
push eax
call sub.wsock32.dll_closesocket
mov eax, dword [ebp - 0x10]
mov dword [eax + ebx*4], 0xffffffff
cmp byte [edi], 0xff
jne 0x416820
mov byte [ebp - 9], 1
jmp 0x416868
mov eax, 8
call fcn.004025a0
mov dword [ebp - 0x20], eax
mov eax, dword [ebp - 0x20]
mov edx, dword [ebp - 4]
mov dword [eax], edx
mov eax, dword [ebp - 0x2c]
mov ax, word [eax]
mov edx, dword [ebp - 0x20]
mov word [edx + 4], ax
mov al, byte [edi]
mov edx, dword [ebp - 0x20]
mov byte [edx + 6], al
mov eax, dword [ebp - 0x20]
push eax
push 0
lea eax, [ebp - 0x1c]
push eax
mov ecx, 0x4165cc
xor edx, edx
xor eax, eax
call fcn.00403488
push eax
call fcn.00405e90
inc ebx
add dword [ebp - 0x2c], 2
inc edi
dec esi
jne 0x4167e1
call fcn.00405fd0
cmp eax, dword [ebp - 0x18]
jb 0x416733
mov eax, dword [ebp - 0x10]
call fcn.00404500
mov esi, eax
test esi, esi
jl 0x4168ac
inc esi
xor ebx, ebx
mov eax, dword [ebp - 0x10]
mov eax, dword [eax + ebx*4]
cmp eax, 0xffffffff
je 0x4168a8
mov edx, dword [ebp - 0x10]
push eax
call sub.wsock32.dll_closesocket
inc ebx
dec esi
jne 0x416894
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x4168cf
lea eax, [ebp - 0x10]
mov edx, dword [0x41663c]
call fcn.004046c0
ret