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

Hexdump color highlighting #1945

Open
hexpwn opened this issue Dec 19, 2019 · 6 comments
Open

Hexdump color highlighting #1945

hexpwn opened this issue Dec 19, 2019 · 6 comments
Labels
Enhancement Label requests for new features or to improve existing ones good first issue Easy issues for new comers. HacktoberFest Any easy issue that is proper for Hacktober Fest contribution

Comments

@hexpwn
Copy link

hexpwn commented Dec 19, 2019

Describe the solution you'd like
Add the option to color code highlights in the hexdumps (like it is possible to highlight blocks in the graph view).

Additional context
This is a helpful tool for RE.

@ITAYC0HEN
Copy link
Member

Hi! thanks for the suggestion :)
Can you share more information about how you want it to look? If you'll find some examples and share screenshots from other applications it will be great!

@hexpwn
Copy link
Author

hexpwn commented Dec 24, 2019

I'm not the best with UI design but I tried showing what I was thinking about...

If you select a portion of the hexdump you can right click and be presented with the color picker.

This would set the background of the font in the hexdump to the chosen color.
image

@XVilka
Copy link
Member

XVilka commented Dec 24, 2019

What I think that hexdump should support multilevel/nested highlights. Basically to allow the multiple parts of the hexdump to be highlighted, these areas can overlap and be nested, and the colors should be mixed properly whenever these areas overlap.
Long time ago I was working on the bvi fork called bvim with the ability to be scripted with Lua and programmatic highlight/selection creation:

@ITAYC0HEN ITAYC0HEN added the Enhancement Label requests for new features or to improve existing ones label Dec 26, 2019
@ITAYC0HEN
Copy link
Member

Thank you. This is a nice idea :)
And thanks for taking the time to be creatve :P

@XVilka XVilka added the good first issue Easy issues for new comers. label Mar 12, 2020
@XVilka
Copy link
Member

XVilka commented Mar 12, 2020

I think the feature to highlight (an un-highlight) with different colors should be also available from the plugins and Python API.

image

image

@karliss
Copy link
Member

karliss commented Mar 12, 2020

Having a mechanism for visually displaying ranges and reacting to interactions with them would be useful for many features so it would be valuable to create good reusable infrastructure for that. Here is a rough proposal of the code for that could be structured.

  • HexdumpHighlighter - interface for module which can provide the highlighted ranges to hexdump widget and reacts to events
    • method: getHilightRanges(memoryRange) -> [HighlightRange] mehtod which returns list of HighlightRanges which intersect with requested memory range. Called by hexdump widget when position changes. Returns info about memoryRange instead of all executable becuse they could be dynamically calculated.
    • signal: highlightsChanged indicates when the highlights changed without change in position.
    • method: onRangeClicked(hilightRange, mouseEvent) called by hexdumpWidget when a hilightRange returned by this HexdumpHighlighter is clicked. Allows implementing interaction.
    • method: onRangeContextMenu(highlightRange, contextMenuEvent) called when a range is right clicked or context menu is triggered using keyboard, similar to onRangeClicked
    • method: onRangeXXX called for other kind of events if necesarry
  • HighlightRange - structure describes single highlight range
    • memoryRange
    • id - can simplify highlighter code for reacting to onRangeClicked and other events
    • visual style
    • tooltip

Ideas for highlight style properties

  • background color
  • font color
  • colored underline
  • corner marker

Multiple instances of HexdumpHighlighter could be added to hexdump widget.

Ideas for uses of this mechanism

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement Label requests for new features or to improve existing ones good first issue Easy issues for new comers. HacktoberFest Any easy issue that is proper for Hacktober Fest contribution
Projects
Status: No status
Development

No branches or pull requests

4 participants