private void method_1() { Class889 class889 = Class889.Create(this.stream_0, this.dxfVersion_0, this.encoding_0); this.class564_0.Header2Offset = (ulong)this.stream_0.Position; MemoryStream fileHeaderDataStream = new MemoryStream(); this.method_2(fileHeaderDataStream); this.stream_0.Write(fileHeaderDataStream.GetBuffer(), 0, (int)fileHeaderDataStream.Length); this.stream_0.Position = 0L; this.stream_0.Write(Encodings.Ascii.GetBytes(this.dxfModel_0.Header.AcadVersionString), 0, 6); this.stream_0.Write(new byte[5], 0, 5); if (this.dxfModel_0.Header.AcadVersion == DxfVersion.Dxf18 && this.dxfModel_0.Header.AcadMaintenanceVersion == 1) { throw new DxfException("Header.AcadMaintenanceVersion may not be 1 for R18 files."); } this.stream_0.WriteByte((byte)this.dxfModel_0.Header.AcadMaintenanceVersion); this.stream_0.WriteByte((byte)3); class889.vmethod_11((uint)this.class617_5.Pages[0].StreamOffset + 32U); this.stream_0.WriteByte((byte)Class885.smethod_3(DxfVersion.Dxf27)); this.stream_0.WriteByte((byte)8); ushort num = Class952.smethod_1(this.dxfModel_0.Header.DrawingCodePage); class889.vmethod_7(num); this.stream_0.Write(new byte[3], 0, 3); class889.vmethod_9((int)this.dxfModel_0.SecurityFlags); class889.vmethod_9(0); class889.vmethod_11((uint)this.class617_1.Pages[0].StreamOffset + 32U); class889.vmethod_11(0U); class889.vmethod_9(128); class889.vmethod_11((uint)this.class617_6.Pages[0].StreamOffset + 32U); this.stream_0.Write(new byte[80], 0, 80); this.stream_0.Write(fileHeaderDataStream.GetBuffer(), 0, (int)fileHeaderDataStream.Length); this.stream_0.Write(Class998.byte_0, 236, 20); }
private void method_18() { this.method_27(); Class615 page = new Class615(1097010747); this.method_19(page); int pageSize = this.list_1.Count * 8; page.StreamOffset = this.stream_0.Position; int num = pageSize + Class998.smethod_0(pageSize); page.Length = (long)num; MemoryStream sectionStream = new MemoryStream(); Class889 class889 = Class889.Create((Stream)sectionStream, this.dxfVersion_0, this.encoding_0); foreach (Class614 class614 in this.list_1) { if (class614 != null) { class889.vmethod_9(class614.PageNumber); class889.vmethod_9((int)class614.Length); } } this.method_21(page, sectionStream); Class614 class614_1 = this.list_1[this.list_1.Count - 1]; this.class564_0.LastPageId = class614_1.PageNumber; this.class564_0.LastPageEndOffset = (ulong)(class614_1.StreamOffset + (long)num - 256L); this.class564_0.GapCount = 0U; this.class564_0.PageCount = (uint)(this.list_1.Count - 1); this.class564_0.PagesMapOffset = (ulong)page.StreamOffset; }
private void method_14() { MemoryStream memoryStream = new MemoryStream(); Class612.Write(Class889.Create((Stream)memoryStream, this.dxfVersion_0, this.encoding_0), this.dxfModel_0, (uint)this.list_2.Count, 0U); this.method_23(this.class617_10, memoryStream, true); }
private void method_15() { MemoryStream memoryStream = new MemoryStream(); Class501.Write(Class889.Create((Stream)memoryStream, this.dxfVersion_0, this.encoding_0), this.dxfModel_0); this.method_23(this.class617_11, memoryStream, true); }
private void method_2() { Class889 class889 = Class889.Create(this.stream_0, this.dxfVersion_0, this.encoding_0); this.stream_0.Position = 0L; this.stream_0.Write(Encodings.Ascii.GetBytes(this.dxfModel_0.Header.AcadVersionString), 0, 6); this.stream_0.Write(new byte[5], 0, 5); int maintenanceVersion = this.dxfModel_0.Header.AcadMaintenanceVersion; this.stream_0.WriteByte((byte)this.dxfModel_0.Header.AcadMaintenanceVersion); this.stream_0.WriteByte((byte)3); class889.vmethod_11((uint)this.class504_2.Pages[0].StreamOffset + 1152U); this.stream_0.WriteByte((byte)Class885.smethod_3(DxfVersion.Dxf27)); this.stream_0.WriteByte((byte)8); ushort num = Class952.smethod_1(this.dxfModel_0.Header.DrawingCodePage); class889.vmethod_7(num); this.stream_0.Write(new byte[3], 0, 3); class889.vmethod_9((int)this.dxfModel_0.SecurityFlags); class889.vmethod_9(0); class889.vmethod_11((uint)this.class504_3.Pages[0].StreamOffset + 1152U); class889.vmethod_11(0U); class889.vmethod_9(128); class889.vmethod_11((uint)this.class504_1.Pages[0].StreamOffset + 1152U); for (int index = 0; index < 80; ++index) { this.stream_0.WriteByte((byte)0); } }
private void method_28() { MemoryStream memoryStream = new MemoryStream(); new Class741.Class742().Write(this.Model.method_13(), Class889.Create((Stream)memoryStream, this.Version, this.Encoding)); this.method_23(this.class617_13, memoryStream, true); }
private void method_5() { this.class617_1.MaxDecompressedPageSize = 256; MemoryStream memoryStream = new MemoryStream(); SummaryInfo summaryInfo = this.dxfModel_0.SummaryInfo; Class611.Write(Class889.Create((Stream)memoryStream, this.dxfVersion_0, this.encoding_0), summaryInfo); this.method_23(this.class617_1, memoryStream, false); }
private void method_11() { Class889 class889 = Class889.Create((Stream)this.class504_4.Stream, this.dxfVersion_0, this.encoding_0); class889.vmethod_11(0U); class889.vmethod_11(0U); class889.vmethod_11(1U); class889.vmethod_11(0U); }
private void method_12() { MemoryStream memoryStream = new MemoryStream(); Class889 class889 = Class889.Create((Stream)memoryStream, this.dxfVersion_0, this.encoding_0); class889.vmethod_11(0U); class889.vmethod_11(0U); class889.vmethod_11(0U); this.method_23(this.class617_8, memoryStream, true); }
private void method_22(Class615 page, Stream sectionHeaderStream) { Class889 class889 = Class889.Create(sectionHeaderStream, this.dxfVersion_0, this.encoding_0); class889.vmethod_9(page.SectionPageType); class889.vmethod_9(page.DecompressedSize); class889.vmethod_9(page.CompressedSize); class889.vmethod_9(page.CompressionType); class889.vmethod_11(page.Checksum); }
private void method_11() { this.class617_7.MaxDecompressedPageSize = 128; FileDependencyCollection dependencyCollection = new FileDependencyCollection(); if (dependencyCollection.Count > 1) { this.class617_7.MaxDecompressedPageSize = 128 * dependencyCollection.Count; } this.class617_7.Encrypted = 2; MemoryStream memoryStream = new MemoryStream(); Class889 class889 = Class889.Create((Stream)memoryStream, this.dxfVersion_0, this.encoding_0); List <string> stringList = new List <string>(); foreach (FileDependency.Key key in dependencyCollection.Keys) { if (!stringList.Contains(key.FeatureName)) { stringList.Add(key.FeatureName); } } class889.vmethod_9(stringList.Count); foreach (string str in stringList) { class889.vmethod_22(str); } class889.vmethod_9(dependencyCollection.Count); DateTime dateTime = new DateTime(1980, 1, 1); foreach (FileDependency.Key key in dependencyCollection.Keys) { FileDependency fileDependency = dependencyCollection[key]; if (fileDependency.FeatureName == "Acad:Text") { string str = DxfTextStyle.smethod_2(Class1043.smethod_2(this.dxfModel_0.Filename), fileDependency.FullFilename); if (!string.IsNullOrEmpty(str) && File.Exists(str)) { FileInfo fileInfo = new FileInfo(str); fileDependency.TimeStamp = fileInfo.LastWriteTime; fileDependency.FileSize = (int)fileInfo.Length; } } class889.vmethod_22(fileDependency.FullFilename); class889.vmethod_22(fileDependency.FoundPath); class889.vmethod_22(fileDependency.FingerPrintGuid); class889.vmethod_22(fileDependency.VersionGuid); class889.vmethod_9(stringList.IndexOf(fileDependency.FeatureName)); TimeSpan timeSpan = fileDependency.TimeStamp - dateTime; class889.vmethod_9((int)timeSpan.TotalSeconds); class889.vmethod_9(fileDependency.FileSize); class889.vmethod_5(fileDependency.AffectsGraphics ? (short)1 : (short)0); class889.vmethod_9(fileDependency.References.Count); } this.method_23(this.class617_7, memoryStream, false); }
private void method_25(Stream pageHeaderStream, Class617 section, Class616 page, int pageType) { Class889 class889 = Class889.Create(pageHeaderStream, this.dxfVersion_0, this.encoding_0); class889.vmethod_9(pageType); class889.vmethod_9(section.SectionId); class889.vmethod_9(page.CompressedSize); class889.vmethod_9(page.PageSize); class889.vmethod_13((long)page.StartOffset); class889.vmethod_11(page.HeaderChecksum); class889.vmethod_11(page.DataChecksum); }
private void method_17() { MemoryStream sectionStream = new MemoryStream(); Class889 class889 = Class889.Create((Stream)sectionStream, this.dxfVersion_0, this.encoding_0); class889.vmethod_9(this.list_0.Count); class889.vmethod_9(2); class889.vmethod_9(29696); class889.vmethod_9(0); class889.vmethod_9(this.list_0.Count); foreach (Class617 class617 in this.list_0) { class889.vmethod_15(class617.SectionSize); class889.vmethod_9(class617.PageCount); class889.vmethod_9(class617.MaxDecompressedPageSize); class889.vmethod_9(1); class889.vmethod_9(class617.Compressed); class889.vmethod_9(class617.SectionId); class889.vmethod_9(class617.Encrypted); byte[] buffer = new byte[64]; if (!string.IsNullOrEmpty(class617.Name)) { byte[] bytes = Encodings.Ascii.GetBytes(class617.Name); int num = Math.Min(bytes.Length, buffer.Length); for (int index = 0; index < num; ++index) { buffer[index] = bytes[index]; } } sectionStream.Write(buffer, 0, buffer.Length); foreach (Class616 page in class617.Pages) { if (page.PageNumber > 0) { class889.vmethod_9(page.PageNumber); class889.vmethod_9(page.CompressedSize); class889.vmethod_15(page.StartOffset); } } } Class615 page1 = this.method_20(1097007163, sectionStream); int count = Class998.smethod_0((int)(this.stream_0.Position - page1.StreamOffset)); this.stream_0.Write(Class998.byte_0, 0, count); page1.Length = this.stream_0.Position - page1.StreamOffset; this.method_19(page1); }
private void method_16() { MemoryStream sectionStream = new MemoryStream(); Class889 byteStream = Class889.Create((Stream)sectionStream, this.dxfVersion_0, this.encoding_0); foreach (Class504 section in this.list_0) { if (section.DataSize != 0UL) { this.method_17(section, byteStream); } } if (this.dxfVersion_0 == DxfVersion.Dxf21) { this.method_17(new Class504() { HashCode = 0UL, MaxDecompressedPageSize = 63488UL, Encrypted = 0UL, Encoding = 4UL }, byteStream); } Class442 page = new Class442(); ulong pageSize = Class996.smethod_2((ulong)sectionStream.Length); byte[] pageData; this.method_20(page, sectionStream, this.class954_0.SectionsMapCrcSeed, pageSize, out pageData); Class442 class442 = (Class442)page.Clone(); this.method_23((Class441)page, pageData, 0, pageData.Length); this.method_23((Class441)class442, pageData, 0, pageData.Length); this.class954_0.SectionsMapDataRepeatCount = page.DataRepeatCount; this.class954_0.SectionsMapSizeCompressed = page.CompressedSize; this.class954_0.SectionsMapSizeDecompressed = page.DecompressedSize; this.class954_0.SectionsMapCrcCompressed = page.CompressedCrc; this.class954_0.SectionsMapCrcDecompressed = page.DecompressedCrc; this.class954_0.SectionsMapId = (ulong)page.Id; this.class954_0.SectionsMap2Id = (ulong)class442.Id; }
private void method_2(MemoryStream fileHeaderDataStream) { Stream2 stream2 = new Stream2((Stream)fileHeaderDataStream, 0U); Class889 class889 = Class889.Create((Stream)stream2, this.dxfVersion_0, this.encoding_0); byte[] bytes = Class1045.encoding_0.GetBytes("AcFssFcAJMB"); stream2.Write(bytes, 0, 11); stream2.WriteByte((byte)0); class889.vmethod_9(0); class889.vmethod_9(108); class889.vmethod_9(4); class889.vmethod_9(this.class564_0.GapsRootId); class889.vmethod_9(this.class564_0.GapsLeftId); class889.vmethod_9(this.class564_0.GapsRightId); class889.vmethod_9(this.class564_0.GapsUnknown); class889.vmethod_9(this.class564_0.LastPageId); class889.vmethod_15(this.class564_0.LastPageEndOffset); class889.vmethod_15(this.class564_0.Header2Offset); class889.vmethod_11(this.class564_0.GapCount); class889.vmethod_11(this.class564_0.PageCount); class889.vmethod_9(32); class889.vmethod_9(128); class889.vmethod_9(64); class889.vmethod_11(this.class564_0.PagesMapId); class889.vmethod_15(this.class564_0.PagesMapOffset - 256UL); class889.vmethod_11(this.class564_0.SectionsMapId); class889.vmethod_11(this.class564_0.PagesMaxId); class889.vmethod_11(this.class564_0.GapsMaxId); long position = stream2.Position; class889.vmethod_11(0U); uint crc = stream2.Crc; stream2.Position = position; class889.vmethod_11(crc); stream2.Flush(); this.method_3(fileHeaderDataStream); }
private void method_5() { this.memoryStream_7 = new MemoryStream(); Class501.Write(Class889.Create((Stream)this.memoryStream_7, this.dxfVersion_0, this.encoding_0), this.dxfModel_0); this.class723_6.Stream = this.memoryStream_7; }
private void method_5() { this.memoryStream_2 = new MemoryStream(); Class501.Write(Class889.Create((Stream)this.memoryStream_2, this.dxfVersion_0, this.encoding_0), this.dxfModel_0); }
private void method_4() { Class611.Write(Class889.Create((Stream)this.class504_3.Stream, this.dxfVersion_0, this.encoding_0), this.dxfModel_0.SummaryInfo); }
private unsafe void method_1() { this.stream_0.Position = this.stream_0.Length; this.class954_0.FileSize = (ulong)(this.stream_0.Length + 1024L); this.class954_0.Header2Offset = (ulong)(this.stream_0.Position - 1152L); this.class954_0.SectionsMapCrcSeed = this.class995_0.method_2((uint)this.class954_0.SectionsMapCrcSeed); this.class954_0.PagesMapCrcSeed = this.class995_0.method_2((uint)this.class954_0.PagesMapCrcSeed); Class888 class888 = new Class888(); class888.method_0(this.class954_0.CrcSeed, this.class995_0); this.class954_0.CrcSeedEncoded = this.class995_0.method_2((uint)(this.class954_0.CrcSeed & (ulong)ushort.MaxValue)); MemoryStream memoryStream1 = new MemoryStream(); Class889 byteStream = Class889.Create((Stream)memoryStream1, this.dxfVersion_0, this.encoding_0); this.method_3(byteStream); ulong num1 = Class656.class656_0.method_0(memoryStream1.GetBuffer(), 0U, (uint)memoryStream1.Length, Class656.smethod_1(0UL, (uint)memoryStream1.Length)); memoryStream1.Position = 264L; byteStream.vmethod_15(num1); Class955 class955 = new Class955(); MemoryStream memoryStream2 = new MemoryStream(); class955.method_1(memoryStream1.GetBuffer(), 0, (int)memoryStream1.Length, (Stream)memoryStream2); if (memoryStream2.Length >= memoryStream1.Length) { memoryStream2 = memoryStream1; } ulong num2 = Class656.class656_0.method_0(memoryStream2.GetBuffer(), 0U, (uint)memoryStream2.Length, Class656.smethod_1(0UL, (uint)memoryStream2.Length)); MemoryStream memoryStream3 = new MemoryStream(12); Class889 class889_1 = Class889.Create((Stream)memoryStream3, this.dxfVersion_0, this.encoding_0); ulong control = this.class995_0.method_1(); class889_1.vmethod_15(control); class889_1.vmethod_15(Class888.smethod_0(control, control)); ulong num3 = Class656.class656_0.method_0(memoryStream3.GetBuffer(), 0U, (uint)memoryStream3.Length, Class656.smethod_0(0UL, (uint)memoryStream3.Length)); MemoryStream memoryStream4 = new MemoryStream(1024); Class889 class889_2 = Class889.Create((Stream)memoryStream4, this.dxfVersion_0, this.encoding_0); class889_2.vmethod_15(num3); class889_2.vmethod_15(control); class889_2.vmethod_15(num2); if (memoryStream2.Length < 272L) { class889_2.vmethod_13(memoryStream2.Length); } else { if (memoryStream2.Length != 272L) { throw new Exception(); } class889_2.vmethod_13(-272L); } memoryStream4.Write(memoryStream2.GetBuffer(), 0, (int)memoryStream2.Length); uint num4 = Class746.class746_0.K * 3U; uint length = (uint)class889_2.Stream.Length; uint num5 = (uint)((ulong)(uint)((int)length + 8 - 1) & 18446744073709551608UL); uint paddingSize1 = num5 - length; this.method_25((Stream)memoryStream4, paddingSize1); uint num6 = num4 / num5; for (int index = 1; (long)index < (long)num6; ++index) { memoryStream4.Write(memoryStream4.GetBuffer(), 0, (int)num5); } uint paddingSize2 = num4 - (uint)memoryStream4.Length; this.method_25((Stream)memoryStream4, paddingSize2); byte[] buffer = new byte[1024]; fixed(byte *source = memoryStream4.GetBuffer()) fixed(byte *destination = buffer) { this.method_28(destination, source, (int)num4, Class746.class746_0); this.method_24(destination + 765, 259U); } MemoryStream memoryStream5 = new MemoryStream(buffer, true); memoryStream5.Position = memoryStream5.Length - 40L; class888.Write((Stream)memoryStream5); if (memoryStream5.Length != 1024L) { throw new Exception(); } this.stream_0.Write(buffer, 0, buffer.Length); this.stream_0.Position = 128L; this.stream_0.Write(buffer, 0, buffer.Length); }
private void method_9() { Class889.Create((Stream)this.class504_1.Stream, this.dxfVersion_0, this.encoding_0); Class885.smethod_0(new Class949(), (Stream)this.class504_1.Stream, this.encoding_0); }
private void method_13() { Class612.Write(Class889.Create((Stream)this.class504_6.Stream, this.dxfVersion_0, this.encoding_0), this.dxfModel_0, (uint)this.list_2.Count, 0U); }
private void method_14() { Class501.Write(Class889.Create((Stream)this.class504_7.Stream, this.dxfVersion_0, this.encoding_0), this.dxfModel_0); }
private void method_18() { this.class442_0.StreamOffset = 0UL; ulong pageSize = this.method_19(this.list_1.Count); long num1 = (long)(this.list_1.Count + 1 + 2); if (pageSize <= 1024UL) { Class441 class441 = this.list_1[0]; long num2 = num1; long num3 = num2 + 1L; class441.Id = num2; this.list_1[1].Id = num3; this.class954_0.PagesMapId = (ulong)this.list_1[0].Id; this.class954_0.PagesMapOffset = this.list_1[0].StreamOffset; this.class954_0.PagesMap2Id = (ulong)this.list_1[1].Id; this.class954_0.PagesMap2Offset = this.list_1[1].StreamOffset; } else { Class441 class441_1 = this.list_1[0]; long num2 = num1; long num3 = num2 + 1L; long num4 = -num2; class441_1.Id = num4; Class441 class441_2 = this.list_1[1]; long num5 = num3; long num6 = num5 + 1L; long num7 = -num5; class441_2.Id = num7; uint num8 = (uint)(this.stream_0.Position - 1152L); Class442 class442_1 = new Class442(); Class442 class442_2 = class442_1; long num9 = num6; long num10 = num9 + 1L; class442_2.Id = num9; class442_1.StreamOffset = (ulong)(num8 - 1152U); this.list_1.Add((Class441)class442_1); Class442 class442_3 = new Class442(); class442_3.Id = num10; class442_3.StreamOffset = (ulong)((long)num8 + (long)pageSize - 1152L); this.list_1.Add((Class441)class442_3); } this.class954_0.PagesMaxId = 0UL; this.class954_0.PageCount = (ulong)(uint)this.list_1.Count; this.class954_0.PagesMapOffset = this.class442_0.StreamOffset; MemoryStream sectionStream = new MemoryStream(); Class889 class889 = Class889.Create((Stream)sectionStream, this.dxfVersion_0, this.encoding_0); foreach (Class441 class441 in this.list_1) { if (class441 != null) { class889.vmethod_13(class441.Length); class889.vmethod_13(class441.Id); if (class441.Id > (long)this.class954_0.PagesMaxId) { this.class954_0.PagesMaxId = (ulong)class441.Id; } } } byte[] pageData; this.method_20(this.class442_0, sectionStream, this.class954_0.PagesMapCrcSeed, pageSize, out pageData); this.class442_0.Length = (long)pageData.Length; long id = this.class442_1.Id; this.class442_1.CopyFrom(this.class442_0); this.class442_1.Id = id; this.class442_1.StreamOffset = 1024UL; this.stream_0.Position = (long)this.class954_0.PagesMapOffset + 1152L; this.stream_0.Write(pageData, 0, pageData.Length); this.stream_0.Position = (long)this.class954_0.PagesMap2Offset + 1152L; this.stream_0.Write(pageData, 0, pageData.Length); this.class954_0.PagesMapDataRepeatCount = this.class442_0.DataRepeatCount; this.class954_0.PagesMapSizeCompressed = this.class442_0.CompressedSize; this.class954_0.PagesMapSizeDecompressed = this.class442_0.DecompressedSize; this.class954_0.PagesMapCrcCompressed = this.class442_0.CompressedCrc; this.class954_0.PagesMapCrcDecompressed = this.class442_0.DecompressedCrc; }
public static void smethod_0(Class949 appInfo, Stream stream, Encoding encoding) { Class889 byteStream = Class889.Create(stream, DxfVersion.Dxf21, Encoding.Unicode); Class921.smethod_0(appInfo, byteStream); }