From 984d8c8db4d7fb0ccaca55c7215fe744c81eb726 Mon Sep 17 00:00:00 2001 From: James Benton Date: Mon, 11 Jan 2016 01:40:55 +0000 Subject: [PATCH] SoonTM --- tools/readrpl/main.cpp | 43 ++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 41 insertions(+), 2 deletions(-) diff --git a/tools/readrpl/main.cpp b/tools/readrpl/main.cpp index 7501217..0f71875 100644 --- a/tools/readrpl/main.cpp +++ b/tools/readrpl/main.cpp @@ -620,6 +620,16 @@ bool readSection(std::ifstream &fh, elf::SectionHeader &header, std::vector" << std::endl; return -1; @@ -660,8 +670,13 @@ int main(int argc, char **argv) auto shStrTab = reinterpret_cast(sections[header.shstrndx].data.data()); // Format shit - std::cout << formatHeader(header) << std::endl; - std::cout << formatSectionSummary(sections, shStrTab) << std::endl; + if (dumpElfHeader) { + std::cout << formatHeader(header) << std::endl; + } + + if (dumpSectionSummary) { + std::cout << formatSectionSummary(sections, shStrTab) << std::endl; + } // Print section data for (auto i = 0u; i < sections.size(); ++i) { @@ -676,9 +691,17 @@ int main(int argc, char **argv) // Print nothing break; case elf::SHT_RELA: + if (!dumpSectionRela) { + continue; + } + formatRela(out, sections, shStrTab, section); break; case elf::SHT_SYMTAB: + if (!dumpSectionSymtab) { + continue; + } + formatSymTab(out, sections, section); break; case elf::SHT_STRTAB: @@ -686,15 +709,31 @@ int main(int argc, char **argv) case elf::SHT_PROGBITS: break; case elf::SHT_RPL_EXPORTS: + if (!dumpSectionRplExports) { + continue; + } + formatRplExports(out, section); break; case elf::SHT_RPL_IMPORTS: + if (!dumpSectionRplImports) { + continue; + } + formatRplImports(out, sections, i, section); break; case elf::SHT_RPL_CRCS: + if (!dumpSectionRplCrcs) { + continue; + } + formatRplCrcs(out, sections, shStrTab, section); break; case elf::SHT_RPL_FILEINFO: + if (!dumpSectionRplFileinfo) { + continue; + } + formatFileInfo(out, section); break; }