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

Hex input #6

Open
glipner opened this issue Oct 5, 2021 · 4 comments
Open

Hex input #6

glipner opened this issue Oct 5, 2021 · 4 comments

Comments

@glipner
Copy link

glipner commented Oct 5, 2021

I'm working on a feature of possible hex input, currently working for iPython console.
Is this something you'd consider adding to the module?

In [23]: %hexinput on
In [24]: %hexon

In [25]: x = (12fce, 10)
In [26]: x
Out[26]: (0x12fce, 0x10)
@glipner glipner closed this as completed Oct 5, 2021
@glipner glipner reopened this Oct 5, 2021
@lipner
Copy link
Contributor

lipner commented Oct 5, 2021

Sorry, opened the issue from the wrong user.
Still the question remains.
Thanks

@rhelmot
Copy link
Owner

rhelmot commented Oct 5, 2021

I'm curious to see how you would pull this off, and would definitely offer your code a place in this module as sort of a pedestal in honor of whatever on earth you're doing to the poor python interpreter, but I would definitely want this feature to be off by default.

@lipner
Copy link
Contributor

lipner commented Oct 5, 2021

Actually turned out less intimidating than how I had feared.
All because IDA uses addresses without the 0x prefix, and I'm used to copying from there...
And of course, off by default is essential.

Please see WIP here:
https://github.com/lipner/monkeyhex/blob/hex_input/hexinput.py

Also, hex literals must begin with a number, otherwise they might be valid names, so I'm choosing not override those.

@rhelmot
Copy link
Owner

rhelmot commented Oct 5, 2021

I think this would be a good addition if there were a configuration option to aggressively convert tokens which could be valid names into hex literals. I'll take it :)

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

No branches or pull requests

3 participants