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

More floating values features #980

Open
1 task done
Nemoumbra opened this issue Mar 17, 2023 · 1 comment
Open
1 task done

More floating values features #980

Nemoumbra opened this issue Mar 17, 2023 · 1 comment

Comments

@Nemoumbra
Copy link
Contributor

Nemoumbra commented Mar 17, 2023

What feature would you like to see?

I've thought of 3 floating value support improvements.
First of all, I suggest bringing the https://gregstoll.com/~gregstoll/floattohex/ functionality to ImHex. In my opinion, the most logical thing will be to put it into the IEEE754 floating point decoder tool or maybe next to it.

The next suggestion is an option to look for floats with (insert math operation) N decimal places after the point.

Example:

If N == 0, ImHex will find all integer floats, like 1.0 or -50.0
If N == 1, ImHex will find things like 0.5, -8.2 or -10.0
(Here the operation is "<=")

Finally, I've noticed that the numeric value search doesn't account for floats having special numbers (for instance, +inf or -inf). Please either add that special values support or make the user use the float -> hex converter from the second paragraph here.

How will this feature be useful to you and others?

  1. Floating values often appear in various programs, but ImHex doesn't currently support hex to float conversions to aid with the reverse-engineering.
  2. Floats are hard to recognize just by looking at them. If a certain group of consecutive bytes forms an integer float or "almost an integer float", that's suspicious. Right now it's impossible to automate that search.
  3. What if a user decides to find all NaN values? I guess, they'd have to Google the hex version of the value (based on what exact floating type they expect to find) and use a normal binary pattern search. Maybe we can speed this up a little?

Request Type

  • I can provide a PoC for this feature or am willing to work on it myself and submit a PR

Additional context?

No response

@paxcut
Copy link
Contributor

paxcut commented Apr 27, 2023

I just added a pr #1047 that I believe addresses one of the additions you mention. The changes allow you to create hex from decimal representation. To create decimal from hex you still need to translate hex to binary which should be easy.

Nemoumbra added a commit to Nemoumbra/ImHex that referenced this issue Nov 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants