diff --git a/main.c b/main.c index 86a929c..3528f31 100644 --- a/main.c +++ b/main.c @@ -33,6 +33,7 @@ void usage(){ " -dc Dumps the Certificate\n" " -ds Dumps the Sections\n" " -dl Dumps the Library Sections\n\n" + " -gdb Dumps sections adresses, for use with gdb\n\n" " -vh Verifies the .xbe Header \n" " -wb Writes back the update to file out.xbe \n\n" @@ -82,11 +83,12 @@ int main (int argc, const char * argv[]) for (counter=2;counterSections - (int)header->BaseAddress); for (i = 0; i < header->NumSections; i++, sechdr++) { + if (option_flag & 0x00000100) { + char *name = ((char *)xbe)+(int)sechdr->SectionName-(int)header->BaseAddress; + if (!strcmp(name,".text")) { + printf("0x%08X ", sechdr->VirtualAddress); + }else if (!strcmp(name,".bss") || !strcmp(name,".data") || !strcmp(name,".rdata")) { + printf("-s %s 0x%08X ", name, sechdr->VirtualAddress); + } + if (i == header->NumSections-1) { + printf("\n"); + } + } + + if (option_flag & 0x00000004) { printf("\nSection Header %i\n~~~~~~~~~~~~~~~~~\n", i);