diff options
-rw-r--r-- | src/tools/r2rdump/GCInfo.cs | 3 | ||||
-rw-r--r-- | src/tools/r2rdump/R2RDump.cs | 40 |
2 files changed, 30 insertions, 13 deletions
diff --git a/src/tools/r2rdump/GCInfo.cs b/src/tools/r2rdump/GCInfo.cs index cf51c8b181..c423eabf2a 100644 --- a/src/tools/r2rdump/GCInfo.cs +++ b/src/tools/r2rdump/GCInfo.cs @@ -127,8 +127,9 @@ namespace R2RDump public GcSlotTable SlotTable { get; set; } public int Size { get; set; } public int Offset { get; set; } + [XmlIgnore] - public Dictionary<int, GcTransition> Transitions { get; } + public Dictionary<int, GcTransition> Transitions { get; set; } public GcInfo() { } diff --git a/src/tools/r2rdump/R2RDump.cs b/src/tools/r2rdump/R2RDump.cs index 1e6ccf6b48..6606b49d2a 100644 --- a/src/tools/r2rdump/R2RDump.cs +++ b/src/tools/r2rdump/R2RDump.cs @@ -230,7 +230,10 @@ namespace R2RDump methodNode.AppendChild(gcNode); Serialize(method.GcInfo, gcNode); - Serialize(new List<GcInfo.GcTransition>(method.GcInfo.Transitions.Values), gcNode); + foreach (KeyValuePair<int, GcInfo.GcTransition> transition in method.GcInfo.Transitions) + { + Serialize(transition, gcNode); + } } else { @@ -407,21 +410,29 @@ namespace R2RDump } break; case R2RSection.SectionType.READYTORUN_SECTION_RUNTIME_FUNCTIONS: - if (!_xml) + int rtfOffset = r2r.GetOffset(section.RelativeVirtualAddress); + int rtfEndOffset = rtfOffset + section.Size; + int rtfIndex = 0; + while (rtfOffset < rtfEndOffset) { - int rtfOffset = r2r.GetOffset(section.RelativeVirtualAddress); - int rtfEndOffset = rtfOffset + section.Size; - int rtfIndex = 0; - while (rtfOffset < rtfEndOffset) + uint rva = NativeReader.ReadUInt32(r2r.Image, ref rtfOffset); + if (_xml) + { + AddXMLNode($"{rtfIndex}", $"0x{rva:X8}", contentsNode); + } + else { - uint rva = NativeReader.ReadUInt32(r2r.Image, ref rtfOffset); _writer.WriteLine($"{rtfIndex}: 0x{rva:X8}"); - rtfIndex++; } + rtfIndex++; } break; case R2RSection.SectionType.READYTORUN_SECTION_COMPILER_IDENTIFIER: - if (!_xml) + if(_xml) + { + AddXMLNode("CompileIdentifier", r2r.CompileIdentifier, contentsNode); + } + else { _writer.WriteLine(r2r.CompileIdentifier); } @@ -482,15 +493,20 @@ namespace R2RDump DumpBytes(r2r, importSection.AuxiliaryDataRVA, (uint)importSection.AuxiliaryData.Size, bytesNode); } } - if (!_xml) + foreach (R2RImportSection.ImportSectionEntry entry in importSection.Entries) { - foreach (R2RImportSection.ImportSectionEntry entry in importSection.Entries) + if (_xml) + { + Serialize(entry, contentsNode); + } + else { _writer.WriteLine(); _writer.WriteLine(entry.ToString()); } - _writer.WriteLine(); } + if (!_xml) + _writer.WriteLine(); } break; } |