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 support for hex strings to print-format #758

Merged
merged 5 commits into from Nov 30, 2021

Conversation

tsheinen
Copy link
Contributor

add support for hex strings to print-format

Description/Motivation/Screenshots

This patch adds an additional format to the command print-format -- a hex string like "00112233" instead of [0x00, 0x11, 0x22, 0x33]. I end up printing memory in another format and manually adjusting it often enough to be worth writing the code for me and I thought it was generally useful enough to PR back. I also adjusted phrasing in the documentation a little bit to signify that print format can output memory in a number of different formats, only some of which are byte array literals.

image

How Has This Been Tested?

Architecture Yes/No Comments
x86-32 ✖️ Replace with ✔️ if tested
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.

gef.py Outdated Show resolved Hide resolved
…upport

Co-authored-by: hugsy <hugsy@users.noreply.github.com>
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.

Forgot to submit my review.

gef.py Outdated Show resolved Hide resolved
docs/commands.md Outdated Show resolved Hide resolved
gef.py Outdated Show resolved Hide resolved
@tsheinen
Copy link
Contributor Author

using hexlify like this also is better bc it means the endianness is correct for bit lengths of not 8

tests/runtests.py Outdated Show resolved Hide resolved
@Grazfather Grazfather merged commit 5b91420 into hugsy:dev Nov 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants