Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a -gdb option that dumps relevant sections in a gdb-friendly way #12

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sam-itt
Copy link

@sam-itt sam-itt commented Feb 4, 2020

$ xbe bin/default.xbe -gdb
XBE Dumper 0.5-BETA Release
0x00011000 -s .rdata 0x00071000 -s .data 0x0007B000

$ xbe bin/default.xbe -gdb
XBE Dumper 0.5-BETA Release
0x00011000 -s .rdata 0x00071000 -s .data 0x0007B000
@GXTX
Copy link

GXTX commented Apr 7, 2020

Doesn't seem to break anything and works as expected.

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")) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: space before else

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")) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would there ever be any reason why someone wouldn't want to map the rest of the sections?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants