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

Backport Elf / ElfInfoCommand updates #717

Merged
merged 6 commits into from
Sep 19, 2021
Merged

Backport Elf / ElfInfoCommand updates #717

merged 6 commits into from
Sep 19, 2021

Conversation

Kileak
Copy link
Contributor

@Kileak Kileak commented Sep 16, 2021

Backport Elf / ElfInfoCommand updates

Description/Motivation/Screenshots

This patch is a backport of the changes from bata24 for Elf parsing and ElfInfoCommand.

It will additionally parse Program and Section Header Tables and display them in ElfInfoCommand.

Also added is_qemu, is_qemu_usermode and is_qemu_system functions.

Apart from improving ElfInfoCommand these changes prepare further backports of qemu functionality (like ksymaddr-remote-apply, which will need Section Header Table parsing for adding symbols).

Screenshot from 2021-09-16 15-08-58

How Has This Been Tested?

Architecture Yes/No Comments
x86-32 ✔️
x86-64 ✔️
ARM ✖️
AARCH64 ✖️
MIPS ✖️
POWERPC ✖️
SPARC ✖️
RISC-V ✖️
make test ✔️

Checklist

  • My PR was done against the dev branch, not master.
  • My code follows the code style of this project.
  • My change includes a change to the documentation, if required.
  • My change adds tests as appropriate.
  • I have read and agree to the CONTRIBUTING document.

Credits

Credits to @bata24

Copy link
Collaborator

@Grazfather Grazfather left a comment

Choose a reason for hiding this comment

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

This is huge! Everything looks good here from a style perspective, but I haven't checked the actual proper parsing. I will compare it to readelf or similar.

gef.py Outdated Show resolved Hide resolved
gef.py Show resolved Hide resolved
gef.py Outdated Show resolved Hide resolved
gef.py Outdated Show resolved Hide resolved
Copy link
Collaborator

@theguy147 theguy147 left a comment

Choose a reason for hiding this comment

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

looks good

Copy link
Owner

@hugsy hugsy left a comment

Choose a reason for hiding this comment

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

I love that PR, this is something long overdue finally about to be part of GEF.

Just a couple of minor things to update, then we're good to merge. Thanks @Kileak !

gef.py Outdated Show resolved Hide resolved
gef.py Outdated Show resolved Hide resolved
gef.py Outdated Show resolved Hide resolved
gef.py Outdated Show resolved Hide resolved
gef.py Outdated Show resolved Hide resolved
gef.py Outdated Show resolved Hide resolved
@hugsy hugsy added this to the Release: next milestone Sep 18, 2021
@hugsy hugsy mentioned this pull request Sep 18, 2021
2 tasks
@hugsy hugsy linked an issue Sep 18, 2021 that may be closed by this pull request
2 tasks
@Kileak
Copy link
Contributor Author

Kileak commented Sep 19, 2021

Removed the memory parsing from Elf for now, since it will not be used anywhere atm.

Copy link
Owner

@hugsy hugsy left a comment

Choose a reason for hiding this comment

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

👍

@hugsy hugsy merged commit f37d0ff into hugsy:dev Sep 19, 2021
@Grazfather
Copy link
Collaborator

Maybe we should offer this code back to the bata fork as a show of good will? If you made some improvements?

@Kileak
Copy link
Contributor Author

Kileak commented Sep 20, 2021

It's only a backport from batas code (even without the ability of memory parsing).

Wouldn't make sense for him to include this.

Other than that, I think, it goes without saying, that bata can take any of the changes (his base is gef after all anyways).

@Grazfather
Copy link
Collaborator

Yep, but I meant the parts that you changed based on the PR review.

@bata24
Copy link

bata24 commented Sep 24, 2021

Thank you for your concern. I overlooked the notification email, but now I'm watching this PR :)

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

Successfully merging this pull request may close these issues.

New features from bata24/gef
5 participants