Function at 0x4056ec
Capabilities:
Get socket status

Disassembly:
push ebp
mov ebp, esp
mov eax, 0x6024
call fcn.004bb490
push esi
push edi
push 1
mov esi, ecx
pop edi
cmp dword [esi + 8], edi
jne 0x40570c
xor al, al
jmp 0x40595d
mov eax, dword [ebp + 8]
mov ecx, 0x3e8
push ebx
mov ebx, ecx
cdq
idiv ebx
xor ebx, ebx
mov dword [ebp - 0x2020], ebx
mov dword [ebp - 0xc], eax
mov eax, dword [ebp + 8]
cdq
idiv ecx
mov eax, dword [esi + 0x134]
imul edx, edx, 0x3e8
cmp eax, 0xffffffff
mov dword [ebp - 8], edx
je 0x40574b
mov dword [ebp - 0x201c], eax
mov dword [ebp - 0x2020], edi
cmp dword [esi + 4], ebx
jne 0x4057d8
mov eax, dword [esi + 0x12c]
mov dword [ebp + 8], ebx
sub eax, dword [esi + 0x128]
test eax, 0xfffffffc
jle 0x4057d8
mov edi, dword [esi + 0x128]
mov ecx, dword [edi]
cmp ecx, 0xffffffff
je 0x4057be
xor eax, eax
cmp dword [ebp - 0x2020], ebx
jbe 0x40579d
lea edx, [ebp - 0x201c]
jmp 0x40578b
xor ebx, ebx
cmp dword [edx], ecx
je 0x40579d
inc eax
add edx, 4
cmp eax, dword [ebp - 0x2020]
jb 0x405789
xor ebx, ebx
cmp eax, dword [ebp - 0x2020]
jne 0x4057be
cmp dword [ebp - 0x2020], 0x800
jae 0x4057be
mov dword [ebp + eax*4 - 0x201c], ecx
inc dword [ebp - 0x2020]
mov eax, dword [esi + 0x12c]
inc dword [ebp + 8]
sub eax, dword [esi + 0x128]
add edi, 4
sar eax, 2
cmp dword [ebp + 8], eax
jl 0x405770
lea eax, [ebp - 0xc]
push eax
push ebx
lea eax, [ebp - 0x2020]
push ebx
push eax
push 0x800
call dword [sym.imp.ws2_32.dll_select]
test eax, eax
jle 0x40595a
cmp dword [esi + 4], ebx
jne 0x40592a
lea eax, [ebp - 0x2020]
push eax
push dword [esi + 0x134]
call sub.ws2_32.dll___WSAFDIsSet
test eax, eax
je 0x40586e
push 0x10
lea eax, [ebp - 0x1c]
pop edi
push edi
push ebx
push eax
call fcn.004bb4c0
add esp, 0xc
lea eax, [ebp + 8]
mov dword [ebp + 8], edi
push eax
lea eax, [ebp - 0x1c]
push eax
push dword [esi + 0x134]
call dword [sym.imp.ws2_32.dll_accept]
cmp eax, 0xffffffff
mov dword [ebp - 4], eax
je 0x40586e
lea eax, [ebp - 4]
lea ecx, [esi + 0x128]
push eax
call fcn.004159e1
lea eax, [ebp - 0x6024]
lea ecx, [esi + 0x138]
push eax
mov dword [ebp - 0x2024], ebx
call fcn.0040650b
mov eax, dword [esi + 0x12c]
lea edi, [esi + 0x128]
sub eax, dword [edi]
sar eax, 2
dec eax
mov dword [ebp + 8], eax
js 0x40595a
mov ecx, eax
imul ecx, ecx, 0x4004
mov dword [ebp - 4], ecx
mov ecx, dword [edi]
mov ebx, eax
shl ebx, 2
cmp dword [ebx + ecx], 0xffffffff
je 0x405915
lea eax, [ebp - 0x2020]
push eax
push dword [ebx + ecx]
call sub.ws2_32.dll___WSAFDIsSet
test eax, eax
je 0x405912
mov eax, dword [edi]
mov ecx, dword [esi + 0x138]
push dword [ebx + eax]
mov eax, dword [ebp - 4]
add eax, ecx
mov ecx, esi
push eax
call fcn.00405963
test al, al
je 0x4058dc
push dword [ebp + 8]
mov ecx, esi
call fcn.004059c8
jmp 0x405912
mov eax, dword [edi]
push dword [eax + ebx]
call dword [sym.imp.ws2_32.dll_closesocket]
mov eax, dword [edi]
or dword [eax + ebx], 0xffffffff
mov eax, dword [ebp + 8]
cmp eax, dword [esi + 0x10]
jl 0x405912
mov eax, dword [edi]
mov ecx, edi
add eax, ebx
push eax
call fcn.004565d6
mov eax, dword [ebp - 4]
lea ecx, [esi + 0x138]
add eax, dword [ecx]
push eax
call fcn.0040654a
mov eax, dword [ebp + 8]
sub dword [ebp - 4], 0x4004
dec eax
test eax, eax
mov dword [ebp + 8], eax
jge 0x405894
jmp 0x40595a
push dword [esi + 0x134]
mov eax, dword [esi + 0x138]
mov ecx, esi
push eax
call fcn.00405963
test al, al
je 0x40594c
push ebx
mov ecx, esi
call fcn.004059c8
jmp 0x40595a
mov eax, dword [esi]
mov ecx, esi
call dword [eax + 0x14]
mov eax, dword [esi]
mov ecx, esi
call dword [eax + 0x10]
mov al, 1
pop ebx
pop edi
pop esi
leave
ret 4