syntax.DefineOption("types", ref _types, "Dump available types");
syntax.DefineOption("unwind", ref _unwind, "Dump unwindInfo");
syntax.DefineOption("gc", ref _gc, "Dump gcInfo and slot table");
- syntax.DefineOption("v|verbose", ref verbose, "Dump raw bytes, disassembly, unwindInfo and gcInfo");
+ syntax.DefineOption("v|verbose", ref verbose, "Dump raw bytes, disassembly, unwindInfo, gcInfo and section contents");
syntax.DefineOption("diff", ref _diff, "Compare two R2R images (not yet implemented)");
});
_disasm = true;
_unwind = true;
_gc = true;
+ _types = true;
}
return argSyntax;
{
DumpBytes(r2r, section.RelativeVirtualAddress, (uint)section.Size);
}
+ if (_types)
+ {
+ _writer.WriteLine();
+ DumpAvailableTypes(r2r);
+ }
}
/// <summary>
private void DumpAvailableTypes(R2RReader r2r)
{
- WriteDivider("Available Types");
foreach (string name in r2r.AvailableTypes)
{
_writer.WriteLine(name);
{
DumpHeader(r2r, false);
}
+ if (_types)
+ {
+ DumpSection(r2r, r2r.R2RHeader.Sections[R2RSection.SectionType.READYTORUN_SECTION_AVAILABLE_TYPES]);
+ }
QuerySection(r2r, _sections);
QueryRuntimeFunction(r2r, _runtimeFunctions);
QueryMethod(r2r, "R2R Methods by Keyword", _keywords, false);
}
- if (_types)
- {
- DumpAvailableTypes(r2r);
- }
-
_writer.WriteLine("=============================================================");
_writer.WriteLine();
}
{
StringBuilder sb = new StringBuilder();
- sb.AppendLine($"\t\t{{");
- sb.AppendLine($"\t\t\tCodeOffset: {CodeOffset}");
- sb.AppendLine($"\t\t\tUnwindOp: {UnwindOp}");
- sb.AppendLine($"\t\t\tOpInfo: {OpInfo}");
- sb.AppendLine($"\t\t}}");
- sb.AppendLine($"\t\t{{");
- sb.AppendLine($"\t\t\tOffsetLow: {OffsetLow}");
- sb.AppendLine($"\t\t\tUnwindOp: {UnwindOp}");
- sb.AppendLine($"\t\t\tOffsetHigh: {OffsetHigh}");
- sb.AppendLine($"\t\t}}");
+ sb.AppendLine($"\t\tCodeOffset: {CodeOffset}");
+ sb.AppendLine($"\t\tUnwindOp: {UnwindOp}");
+ sb.AppendLine($"\t\tOpInfo: {OpInfo}");
+ sb.AppendLine();
+ sb.AppendLine($"\t\tOffsetLow: {OffsetLow}");
+ sb.AppendLine($"\t\tUnwindOp: {UnwindOp}");
+ sb.AppendLine($"\t\tOffsetHigh: {OffsetHigh}");
+ sb.AppendLine();
sb.AppendLine($"\t\tFrameOffset: {FrameOffset}");
- sb.AppendLine($"\t\t------------------");
+ sb.AppendLine($"\t\t--------------------");
return sb.ToString();
}