Example #1
0
        private void method_17(Class504 section, Class889 byteStream)
        {
            byteStream.vmethod_15(section.DataSize);
            byteStream.vmethod_15(section.MaxDecompressedPageSize);
            byteStream.vmethod_15(section.Encrypted);
            byteStream.vmethod_15(section.HashCode);
            ulong num = (ulong)section.Name.Length;

            if (num > 0UL)
            {
                num = (ulong)((long)num + 1L << 1);
            }
            byteStream.vmethod_15(num);
            byteStream.vmethod_15(section.Unknown);
            byteStream.vmethod_15(section.Encoding);
            byteStream.vmethod_15(section.PageCount);
            if (num > 0UL)
            {
                byte[] bytes = Encoding.Unicode.GetBytes(section.Name);
                byteStream.Stream.Write(bytes, 0, bytes.Length);
                byteStream.vmethod_1((byte)0);
                byteStream.vmethod_1((byte)0);
            }
            foreach (Class443 page in section.Pages)
            {
                byteStream.vmethod_15(page.DataOffset);
                byteStream.vmethod_15(page.PageSize);
                byteStream.vmethod_13(page.Id);
                byteStream.vmethod_15(page.DecompressedSize);
                byteStream.vmethod_15(page.CompressedSize);
                byteStream.vmethod_15(page.CheckSum);
                byteStream.vmethod_15(page.Crc);
            }
        }
Example #2
0
        private void method_21(Class504 section)
        {
            section.DataSize = (ulong)section.Stream.Length;
            ulong num = (ulong)section.Stream.Length / section.MaxDecompressedPageSize;

            byte[] buffer = section.Stream.GetBuffer();
            section.Stream.Dispose();
            section.Stream = (MemoryStream)null;
            ulong position = 0;

            for (int index = 0; index < (int)num; ++index)
            {
                this.method_22(section, buffer, position, section.MaxDecompressedPageSize);
                position += section.MaxDecompressedPageSize;
            }
            ulong uncompressedLength = section.DataSize % section.MaxDecompressedPageSize;

            if (uncompressedLength > 0UL)
            {
                this.method_22(section, buffer, position, uncompressedLength);
                ++num;
            }
            section.PageCount = num;
        }
Example #3
0
        private unsafe void method_22(
            Class504 section,
            byte[] buffer,
            ulong position,
            ulong uncompressedLength)
        {
            Class443 class443 = new Class443();

            class443.PageSize         = section.MaxDecompressedPageSize;
            class443.DataOffset       = position;
            class443.DecompressedSize = uncompressedLength;
            class443.CheckSum         = (ulong)Class996.smethod_3((ulong)this.uint_0, buffer, (uint)position, (uint)uncompressedLength);
            Class746     class7461    = Class746.class746_1;
            MemoryStream memoryStream = new MemoryStream();

            if (section.Compressed)
            {
                new Class955().method_1(buffer, (int)position, (int)uncompressedLength, (Stream)memoryStream);
                if (memoryStream.Length >= (long)uncompressedLength)
                {
                    memoryStream = new MemoryStream();
                    memoryStream.Write(buffer, (int)position, (int)uncompressedLength);
                }
            }
            else
            {
                memoryStream.Write(buffer, (int)position, (int)uncompressedLength);
            }
            class443.CompressedSize = (ulong)memoryStream.Length;
            class443.Crc            = Class656.class656_1.method_0(memoryStream.GetBuffer(), 0U, (uint)memoryStream.Length, Class656.smethod_0((ulong)this.uint_0, (uint)memoryStream.Length));
            ulong num1 = (ulong)(memoryStream.Length + 8L - 1L & -8L);
            int   num2 = (int)((ulong)((long)num1 + (long)class7461.K - 1L) / (ulong)class7461.K);

            byte[] data;
            if (section.Encoding == 4UL)
            {
                data = new byte[(long)num2 * (long)class7461.N];
                int num3 = (int)((long)num1 - memoryStream.Length);
                for (int index = 0; index < num3; ++index)
                {
                    memoryStream.WriteByte((byte)0);
                    fixed(byte *destination = data)
                    fixed(byte *source = memoryStream.GetBuffer())
                    this.method_28(destination, source, (int)memoryStream.Length, class7461);
            }
            else
            {
                if (section.Encoding != 1UL)
                {
                    throw new Exception();
                }
                uint num3 = (uint)(num1 - (ulong)memoryStream.Length);
                for (uint index = 0; index < num3; ++index)
                {
                    memoryStream.WriteByte((byte)0);
                }
                data = new byte[num1 + (ulong)num2 * (ulong)(class7461.N - class7461.K)];

                fixed(byte *dataBufferPtr = data)
                fixed(byte *sourcePtr = memoryStream.GetBuffer())
                this.method_26(dataBufferPtr, dataBufferPtr + num1, sourcePtr, (int)memoryStream.Length, class7461);
            }
            this.method_23((Class441)class443, data, 0, data.Length);
            if (class443.Id > 0L)
            {
                ++section.PageCount;
            }
            section.Pages.Add(class443);
        }
Example #4
0
        private void method_0()
        {
            Class504 class504_1 = this.class504_0 = Class504.smethod_0("AcDb:FileDepList");

            class504_1.HashCode = 1816266186UL;
            if (this.dxfModel_0.FileDependencies.Count > 1)
            {
                int count = this.dxfModel_0.FileDependencies.Count;
                class504_1.MaxDecompressedPageSize = (ulong)(128 * (count + (count >> 1)));
            }
            else
            {
                class504_1.MaxDecompressedPageSize = 256UL;
            }
            class504_1.Encrypted = 2UL;
            class504_1.Encoding  = 1UL;
            this.list_0.Add(class504_1);
            Class504 class504_2 = this.class504_1 = Class504.smethod_0("AcDb:AppInfo");

            class504_2.HashCode = 1067451454UL;
            class504_2.MaxDecompressedPageSize = 768UL;
            class504_2.Encrypted = 0UL;
            class504_2.Encoding  = 1UL;
            this.list_0.Add(class504_2);
            Class504 class504_3 = this.class504_2 = Class504.smethod_0("AcDb:Preview");

            class504_3.HashCode = 1084884083UL;
            class504_3.MaxDecompressedPageSize = 1024UL;
            class504_3.Encrypted = 0UL;
            class504_3.Encoding  = 1UL;
            this.list_0.Add(class504_3);
            Class504 class504_4 = this.class504_3 = Class504.smethod_0("AcDb:SummaryInfo");

            class504_4.HashCode = 1903822351UL;
            class504_4.MaxDecompressedPageSize = 128UL;
            class504_4.Encrypted = 0UL;
            class504_4.Encoding  = 1UL;
            this.list_0.Add(class504_4);
            Class504 class504_5 = this.class504_4 = Class504.smethod_0("AcDb:RevHistory");

            class504_5.HashCode = 1621231027UL;
            class504_5.MaxDecompressedPageSize = 4096UL;
            class504_5.Encrypted  = 0UL;
            class504_5.Encoding   = 4UL;
            class504_5.Compressed = true;
            this.list_0.Add(class504_5);
            Class504 class504_6 = this.class504_5 = Class504.smethod_0("AcDb:AcDbObjects");

            class504_6.HashCode = 1733035433UL;
            class504_6.MaxDecompressedPageSize = 63488UL;
            class504_6.Encrypted  = 0UL;
            class504_6.Encoding   = 4UL;
            class504_6.Compressed = true;
            this.list_0.Add(class504_6);
            Class504 class504_7 = this.class504_6 = Class504.smethod_0("AcDb:ObjFreeSpace");

            class504_7.HashCode = 2011301407UL;
            class504_7.MaxDecompressedPageSize = 63488UL;
            class504_7.Encrypted  = 0UL;
            class504_7.Encoding   = 4UL;
            class504_7.Compressed = true;
            this.list_0.Add(class504_7);
            Class504 class504_8 = this.class504_7 = Class504.smethod_0("AcDb:Template");

            class504_8.HashCode = 1242825934UL;
            class504_8.MaxDecompressedPageSize = 1024UL;
            class504_8.Encrypted  = 0UL;
            class504_8.Encoding   = 4UL;
            class504_8.Compressed = true;
            this.list_0.Add(class504_8);
            Class504 class504_9 = this.class504_8 = Class504.smethod_0("AcDb:Handles");

            class504_9.HashCode = 1064174672UL;
            class504_9.MaxDecompressedPageSize = 63488UL;
            class504_9.Encrypted  = 0UL;
            class504_9.Encoding   = 4UL;
            class504_9.Compressed = true;
            this.list_0.Add(class504_9);
            Class504 class504_10 = this.class504_9 = Class504.smethod_0("AcDb:Classes");

            class504_10.HashCode = 1062470751UL;
            class504_10.MaxDecompressedPageSize = 63488UL;
            class504_10.Encrypted  = 0UL;
            class504_10.Encoding   = 4UL;
            class504_10.Compressed = true;
            this.list_0.Add(class504_10);
            Class504 class504_11 = this.class504_10 = Class504.smethod_0("AcDb:AuxHeader");

            class504_11.HashCode = 1425016074UL;
            class504_11.MaxDecompressedPageSize = 2048UL;
            class504_11.Encrypted  = 0UL;
            class504_11.Encoding   = 4UL;
            class504_11.Compressed = true;
            this.list_0.Add(class504_11);
            Class504 class504_12 = this.class504_11 = Class504.smethod_0("AcDb:Header");

            class504_12.HashCode = 850920409UL;
            class504_12.MaxDecompressedPageSize = 2048UL;
            class504_12.Encrypted  = 0UL;
            class504_12.Encoding   = 4UL;
            class504_12.Compressed = true;
            this.list_0.Add(class504_12);
            this.class954_0.SectionCount = (ulong)(this.list_0.Count + 1);
        }