mirror of
https://github.com/wiiu-env/wut.git
synced 2025-01-07 23:40:44 +01:00
SoonTM
This commit is contained in:
parent
fd069526ab
commit
984d8c8db4
@ -620,6 +620,16 @@ bool readSection(std::ifstream &fh, elf::SectionHeader &header, std::vector<char
|
|||||||
|
|
||||||
int main(int argc, char **argv)
|
int main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
|
// TODO: Set this via command line args
|
||||||
|
bool dumpElfHeader = true;
|
||||||
|
bool dumpSectionSummary = true;
|
||||||
|
bool dumpSectionRela = true;
|
||||||
|
bool dumpSectionSymtab = true;
|
||||||
|
bool dumpSectionRplExports = true;
|
||||||
|
bool dumpSectionRplImports = true;
|
||||||
|
bool dumpSectionRplCrcs = true;
|
||||||
|
bool dumpSectionRplFileinfo = true;
|
||||||
|
|
||||||
if (argc < 2) {
|
if (argc < 2) {
|
||||||
std::cout << argv[0] << " <rpl/rpx file>" << std::endl;
|
std::cout << argv[0] << " <rpl/rpx file>" << std::endl;
|
||||||
return -1;
|
return -1;
|
||||||
@ -660,8 +670,13 @@ int main(int argc, char **argv)
|
|||||||
auto shStrTab = reinterpret_cast<const char *>(sections[header.shstrndx].data.data());
|
auto shStrTab = reinterpret_cast<const char *>(sections[header.shstrndx].data.data());
|
||||||
|
|
||||||
// Format shit
|
// Format shit
|
||||||
std::cout << formatHeader(header) << std::endl;
|
if (dumpElfHeader) {
|
||||||
std::cout << formatSectionSummary(sections, shStrTab) << std::endl;
|
std::cout << formatHeader(header) << std::endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (dumpSectionSummary) {
|
||||||
|
std::cout << formatSectionSummary(sections, shStrTab) << std::endl;
|
||||||
|
}
|
||||||
|
|
||||||
// Print section data
|
// Print section data
|
||||||
for (auto i = 0u; i < sections.size(); ++i) {
|
for (auto i = 0u; i < sections.size(); ++i) {
|
||||||
@ -676,9 +691,17 @@ int main(int argc, char **argv)
|
|||||||
// Print nothing
|
// Print nothing
|
||||||
break;
|
break;
|
||||||
case elf::SHT_RELA:
|
case elf::SHT_RELA:
|
||||||
|
if (!dumpSectionRela) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
formatRela(out, sections, shStrTab, section);
|
formatRela(out, sections, shStrTab, section);
|
||||||
break;
|
break;
|
||||||
case elf::SHT_SYMTAB:
|
case elf::SHT_SYMTAB:
|
||||||
|
if (!dumpSectionSymtab) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
formatSymTab(out, sections, section);
|
formatSymTab(out, sections, section);
|
||||||
break;
|
break;
|
||||||
case elf::SHT_STRTAB:
|
case elf::SHT_STRTAB:
|
||||||
@ -686,15 +709,31 @@ int main(int argc, char **argv)
|
|||||||
case elf::SHT_PROGBITS:
|
case elf::SHT_PROGBITS:
|
||||||
break;
|
break;
|
||||||
case elf::SHT_RPL_EXPORTS:
|
case elf::SHT_RPL_EXPORTS:
|
||||||
|
if (!dumpSectionRplExports) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
formatRplExports(out, section);
|
formatRplExports(out, section);
|
||||||
break;
|
break;
|
||||||
case elf::SHT_RPL_IMPORTS:
|
case elf::SHT_RPL_IMPORTS:
|
||||||
|
if (!dumpSectionRplImports) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
formatRplImports(out, sections, i, section);
|
formatRplImports(out, sections, i, section);
|
||||||
break;
|
break;
|
||||||
case elf::SHT_RPL_CRCS:
|
case elf::SHT_RPL_CRCS:
|
||||||
|
if (!dumpSectionRplCrcs) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
formatRplCrcs(out, sections, shStrTab, section);
|
formatRplCrcs(out, sections, shStrTab, section);
|
||||||
break;
|
break;
|
||||||
case elf::SHT_RPL_FILEINFO:
|
case elf::SHT_RPL_FILEINFO:
|
||||||
|
if (!dumpSectionRplFileinfo) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
formatFileInfo(out, section);
|
formatFileInfo(out, section);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user