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

Print address-looking numbers as Hex addresses #5

Open
gaasedelen opened this issue Nov 23, 2020 · 2 comments
Open

Print address-looking numbers as Hex addresses #5

gaasedelen opened this issue Nov 23, 2020 · 2 comments
Labels
enhancement New feature or request

Comments

@gaasedelen
Copy link
Collaborator

We should hook the iPython console output to print integers that fall within IDB segments as addresses.

eg:

In [4]: idaapi.get_screen_ea()
Out[4]: 5372018224

should print out 0x140327e30 instead.

It would also be nice to make these clickable, like the default IDA console.

@gaasedelen
Copy link
Collaborator Author

I made addresses clickable, but we should probably try to resolve #3 before implementing the other part of this issue (print integers as hex). It's possible fixing #3 may resolve this issue too.

@zerotypic
Copy link
Owner

I've gotten ints printed as hex using this line in my .ipyidarc:

get_ipython().display_formatter.formatters["text/plain"].for_type(
    int,
    lambda n, p, cycle: p.text("0x%x (%d)" % (n, n))
)

so it should be pretty simple to add. I'm wondering if it might be better to keep it as an optional thing, since not everybody might want ints be printed as hex by default.

Also, HTML rendering in the ipython console doesn't seem to work 100%. Same with images. We might want to fix those too. Agreed that we should look at #3 first though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants