Function at 0x406810
Capabilities:
Get socket status

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x334
push ebx
mov ebx, edx
mov dword [ebp - 8], ecx
mov eax, 0x10624dd3
mov dword [ebp - 0x10], 0
imul ebx
mov ecx, ebx
mov dword [ebp - 0xc], 0
sar edx, 6
mov eax, edx
shr eax, 0x1f
add eax, edx
mov edx, dword [ebp - 8]
mov dword [ebp - 0x18], eax
imul eax, eax, 0x3e8
push esi
mov edx, dword [edx]
lea esi, [ebp - 0x18]
push edi
xor edi, edi
sub ecx, eax
mov dword [ebp - 0x228], edi
imul eax, ecx, 0x3e8
mov dword [ebp - 0x330], edi
mov dword [ebp - 0x120], edi
mov dword [ebp - 0x14], eax
xor eax, eax
test ebx, ebx
cmovs esi, eax
mov dword [ebp - 4], esi
test edx, edx
je 0x4069dd
jmp 0x406890
and dword [edx + 0xac], 0xfffcffff
mov ecx, dword [edx + 0xac]
test ecx, 0x2000
jne 0x4069d3
test cl, 8
jne 0x4069d3
mov esi, dword [edx + 0x30]
cmp esi, 0xffffffff
je 0x4069d0
mov eax, ecx
shr eax, 0xe
not al
test al, 1
jne 0x4068e3
test cl, 0x20
jne 0x4068e3
cmp dword [edx + 0x50], 0
jbe 0x4069d0
test cl, cl
js 0x4069d0
mov ecx, dword [ebp - 0x120]
xor eax, eax
test ecx, ecx
je 0x4068fe
nop
cmp dword [ebp + eax*4 - 0x11c], esi
je 0x4068fe
inc eax
cmp eax, ecx
jb 0x4068f0
cmp eax, ecx
jne 0x406914
cmp ecx, 0x40
jae 0x406914
mov dword [ebp + eax*4 - 0x11c], esi
inc dword [ebp - 0x120]
mov eax, dword [edx + 0xac]
shr eax, 0xe
not al
test al, 1
je 0x406959
mov eax, dword [ebp - 0x228]
xor ecx, ecx
test eax, eax
je 0x406940
mov esi, dword [edx + 0x30]
cmp dword [ebp + ecx*4 - 0x224], esi
je 0x406940
inc ecx
cmp ecx, eax
jb 0x406932
cmp ecx, eax
jne 0x406959
cmp eax, 0x40
jae 0x406959
mov eax, dword [edx + 0x30]
mov dword [ebp + ecx*4 - 0x224], eax
inc dword [ebp - 0x228]
mov eax, dword [edx + 0xac]
test al, 0x20
jne 0x40696d
cmp dword [edx + 0x50], 0
jbe 0x4069a7
test al, al
js 0x4069a7
mov eax, dword [ebp - 0x330]
xor ecx, ecx
test eax, eax
je 0x40698e
mov esi, dword [edx + 0x30]
lea esp, [esp]
cmp dword [ebp + ecx*4 - 0x32c], esi
je 0x40698e
inc ecx
cmp ecx, eax
jb 0x406980
cmp ecx, eax
jne 0x4069a7
cmp eax, 0x40
jae 0x4069a7
mov eax, dword [edx + 0x30]
mov dword [ebp + ecx*4 - 0x32c], eax
inc dword [ebp - 0x330]
cmp dword [edx + 0x70], 0
lea esi, [ebp - 0x10]
mov eax, 1
cmovbe esi, dword [ebp - 4]
cmp dword [edx + 0x30], edi
mov dword [ebp - 4], esi
cmova edi, dword [edx + 0x30]
test dword [edx + 0xac], 0x2000
cmovne ebx, eax
jmp 0x4069d3
mov esi, dword [ebp - 4]
mov edx, dword [edx]
test edx, edx
jne 0x406890
push esi
lea eax, [ebp - 0x120]
push eax
lea eax, [ebp - 0x330]
push eax
lea eax, [ebp - 0x228]
push eax
lea eax, [edi + 1]
push eax
call dword [sym.imp.WS2_32.dll_select]
test eax, eax
jns 0x406a2a
test edi, edi
jne 0x406a0c
push ebx
call dword [sym.imp.KERNEL32.dll_Sleep]
mov dword [ebp - 0x228], 0
mov dword [ebp - 0x330], 0
mov dword [ebp - 0x120], 0
mov eax, dword [ebp - 8]
mov esi, dword [eax]
test esi, esi
je 0x406ae6
mov edi, dword [sym.imp.WS2_32.dll___WSAFDIsSet]
lea ecx, [ecx]
mov eax, dword [esi + 0x30]
cmp eax, 0xffffffff
je 0x406a66
lea ecx, [ebp - 0x120]
push ecx
push eax
call edi
test eax, eax
je 0x406a66
push str.socket_error
push esi
call fcn.00402fd0
add esp, 8
jmp 0x406adc
mov eax, dword [esi + 0x30]
cmp eax, 0xffffffff
je 0x406a83
lea ecx, [ebp - 0x228]
push ecx
push eax
call edi
test eax, eax
je 0x406a83
mov eax, 1
jmp 0x406a85
xor eax, eax
shl eax, 0x10
xor eax, dword [esi + 0xac]
and eax, 0x10000
xor dword [esi + 0xac], eax
mov eax, dword [esi + 0x30]
cmp eax, 0xffffffff
je 0x406ab6
lea ecx, [ebp - 0x330]
push ecx
push eax
call edi
test eax, eax
je 0x406ab6
mov eax, 1
jmp 0x406ab8
xor eax, eax
shl eax, 0x11
xor eax, dword [esi + 0xac]
and eax, 0x20000
xor dword [esi + 0xac], eax
cmp dword [esi + 0x70], 0
jbe 0x406adc
or dword [esi + 0xac], 0x10000
mov esi, dword [esi]
test esi, esi
jne 0x406a40
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret