public override void Write(IO.EndianWriter stream) { Compiler comp = stream.Owner as Compiler; TagBlock tb = new TagBlock((Import.TagBlock)tagGroup.Block); tb.Write(stream); comp.MarkLocationFixup(tagGroup.Name, stream, false); stream.Write(tagGroup.Name); stream.Write((int)0); stream.WriteTag(tagGroup.GroupTag); if (tagGroup.ParentTag != null) { stream.WriteTag(tagGroup.ParentTag); } else { stream.Write((int)-1); } stream.Write(tagGroup.Version); stream.Write((short)1); // init'd stream.Write((int)0); stream.Write((int)0); stream.Write((int)0); stream.Write((int)0); stream.WritePointer(tb.RuntimeAddress); for (int x = 0; x < 17; x++) { stream.Write((int)0); // child group tags } stream.Write((int)0); // we don't support that shit, gtfo stream.Write(comp.Strings.GetNull()); }
public override void Write(IO.EndianWriter stream) { const int k_alignment = Compiler.kDefaultAlignment; int align; using (var mem = InitializeMemoryStream()) { DynamicTagGroups.Write(MemoryStream); // write the data array to the stream MemoryStream.Write((int)0); MemoryStream.Write((int)0); // alignment StringPoolToMemoryStream(); Import import = OwnerState.Importer as Import; FixupsToMemoryStream(); ScriptingToStream(import); EnumerationsToMemoryStream(); TagReferencesToMemoryStream(); TagDataToMemoryStream(); #region TagBlock TagBlock tb = new TagBlock(); foreach (Import.TagBlock tagb in import.Blocks.Values) { tb.Reset(tagb); tb.Write(MemoryStream); } #endregion #region TagGroup TagGroup tg = new TagGroup(); foreach (Import.TagGroup tagg in import.Groups.Values) { tg.Reset(tagg); tg.Write(MemoryStream); } #endregion PostprocessWritebacks(); // Create header PostprocessHeaderThenStream(stream, CalculateStringPoolBaseAddress()); mem.WriteTo(stream.BaseStream); // write all the data that will be read into memory from a tool to the file } align = k_alignment - (stream.Length % k_alignment); if (align != k_alignment) { stream.Write(new byte[align]); } }
public override void Write(IO.EndianWriter stream) { Compiler comp = stream.Owner as Compiler; TagBlock tb = new TagBlock((Import.TagBlock)tagStruct.Block); tb.Write(stream); comp.MarkLocationFixup(tagStruct.Name, stream, false); stream.Write(tagStruct.Name); stream.WriteTag(tagStruct.GroupTag); stream.Write(tagStruct.Block.DisplayName); stream.WritePointer(tb.RuntimeAddress); }
public override void Write(IO.EndianWriter stream) { const int k_alignment = Compiler.kDefaultAlignment; int align; using (var mem = InitializeMemoryStream()) { DynamicTagGroups.Write(MemoryStream); // write the data array to the stream MemoryStream.Write((int)0); MemoryStream.Write((int)0); // alignment StringPoolToMemoryStream(); Import import = OwnerState.Importer as Import; FixupsToMemoryStream(); ScriptingToStream(import); EnumerationsToMemoryStream(); TagReferencesToMemoryStream(); TagDataToMemoryStream(); #region TagBlock TagBlock tb = new TagBlock(); foreach (Import.TagBlock tagb in import.Blocks.Values) { tb.Reset(tagb); tb.Write(MemoryStream); } #endregion #region TagGroup TagGroup tg = new TagGroup(); foreach (Import.TagGroup tagg in import.Groups.Values) { tg.Reset(tagg); tg.Write(MemoryStream); } #endregion PostprocessWritebacks(); // Create header PostprocessHeaderThenStream(stream, CalculateStringPoolBaseAddress()); mem.WriteTo(stream.BaseStream); // write all the data that will be read into memory from a tool to the file } align = k_alignment - (stream.Length % k_alignment); if (align != k_alignment) stream.Write(new byte[align]); }
public override void Write(IO.EndianWriter stream) { Compiler comp = stream.Owner as Compiler; TagBlock tb = new TagBlock((Import.TagBlock)tagGroup.Block); tb.Write(stream); comp.MarkLocationFixup(tagGroup.Name, stream, false); stream.Write(tagGroup.Name); stream.Write((int)0); stream.WriteTag(tagGroup.GroupTag); if (tagGroup.ParentTag != null) stream.WriteTag(tagGroup.ParentTag); else stream.Write((int)-1); stream.Write(tagGroup.Version); stream.Write((short)1); // init'd stream.Write((int)0); stream.Write((int)0); stream.Write((int)0); stream.Write((int)0); stream.WritePointer(tb.RuntimeAddress); for (int x = 0; x < 17; x++) stream.Write((int)0); // child group tags stream.Write((int)0); // we don't support that shit, gtfo stream.Write(comp.Strings.GetNull()); }
public override void Write(IO.EndianWriter stream) { Compiler comp = stream.Owner as Compiler; TagBlock tb = new TagBlock((Import.TagBlock)tagStruct.Block); tb.Write(stream); comp.MarkLocationFixup(tagStruct.Name, stream, false); stream.Write(tagStruct.Name); stream.WriteTag(tagStruct.GroupTag); stream.Write(tagStruct.Block.DisplayName); stream.WritePointer(tb.RuntimeAddress); }