Beispiel #1
0
        internal void SetBinaryForm(byte[] binaryForm, int offset)
        {
            int count;
            int length;

            RawAcl.VerifyHeader(binaryForm, offset, out this._revision, out count, out length);
            int num1 = length + offset;

            offset    += 8;
            this._aces = new ArrayList(count);
            int num2 = 8;

            for (int index = 0; index < count; ++index)
            {
                GenericAce fromBinaryForm = GenericAce.CreateFromBinaryForm(binaryForm, offset);
                int        binaryLength   = fromBinaryForm.BinaryLength;
                if (num2 + binaryLength > GenericAcl.MaxBinaryLength)
                {
                    throw new ArgumentException(Environment.GetResourceString("ArgumentException_InvalidAclBinaryForm"), "binaryForm");
                }
                this._aces.Add((object)fromBinaryForm);
                if (binaryLength % 4 != 0)
                {
                    throw new SystemException();
                }
                num2 += binaryLength;
                if ((int)this._revision == (int)GenericAcl.AclRevisionDS)
                {
                    offset += (int)binaryForm[offset + 2] + ((int)binaryForm[offset + 3] << 8);
                }
                else
                {
                    offset += binaryLength;
                }
                if (offset > num1)
                {
                    throw new ArgumentException(Environment.GetResourceString("ArgumentException_InvalidAclBinaryForm"), "binaryForm");
                }
            }
        }
Beispiel #2
0
        // Token: 0x06001E9B RID: 7835 RVA: 0x0006AEC8 File Offset: 0x000690C8
        internal void SetBinaryForm(byte[] binaryForm, int offset)
        {
            int num;
            int num2;

            RawAcl.VerifyHeader(binaryForm, offset, out this._revision, out num, out num2);
            num2      += offset;
            offset    += 8;
            this._aces = new ArrayList(num);
            int num3 = 8;

            for (int i = 0; i < num; i++)
            {
                GenericAce genericAce   = GenericAce.CreateFromBinaryForm(binaryForm, offset);
                int        binaryLength = genericAce.BinaryLength;
                if (num3 + binaryLength > GenericAcl.MaxBinaryLength)
                {
                    throw new ArgumentException(Environment.GetResourceString("ArgumentException_InvalidAclBinaryForm"), "binaryForm");
                }
                this._aces.Add(genericAce);
                if (binaryLength % 4 != 0)
                {
                    throw new SystemException();
                }
                num3 += binaryLength;
                if (this._revision == GenericAcl.AclRevisionDS)
                {
                    offset += (int)binaryForm[offset + 2] + ((int)binaryForm[offset + 3] << 8);
                }
                else
                {
                    offset += binaryLength;
                }
                if (offset > num2)
                {
                    throw new ArgumentException(Environment.GetResourceString("ArgumentException_InvalidAclBinaryForm"), "binaryForm");
                }
            }
        }