Show HN: Bin-graph: Visualize binary files (github.com)
This program provides a simple way of visualizing the different regions of a binary file. Written in C, depends only on libpng.
Currently (commit 1dd42e3) it is able to generate PNG images that represent various aspects of the binary:
- Grayscale: Byte values, 00..FF. - Ascii: Printability of each byte. - Entropy: Of a "block", changed with --block-size. - Histogram: Bar graph of the byte frequencies. - Bigrams: Each point is determined by a pair of bytes. - Dotplot: Measure self-similarity. Image width/height is N^2.
In the future, I plan on adding an SDL version that allows the user to view a section of the file interactively (sections are currently supported with --offset-start and --offset-end).
More information on the README.
17 comments
[ 24.8 ms ] story [ 851 ms ] threadI am not sure if I should be shocked or impressed, but consider the following question: Would you download a random program of the internet because of the promise of it creating a useful visualization? You probably would if the visualization looked useful to you. But as you can't see it without downloading.. You get my point.
In this project in particular, I understand that it is important.
That website is more interactive, shows a hex dump of the binary and doesn't require you to download/compile anything. It's probably more practical for most users, but my project has some other modes that might be helpful for recognizing patterns in different file formats (look at the talks linked in the README for more information on what I mean). Also, as far as I know the source code for binvis.io is not public.
P.S. I added a link to binvis.io to the README as well.
https://alexshroyer.com/misc/digraphs.mp4
There are often bright spots in these kinds of visuals that you end up seeing over and over again (e.g. clusters of ASCII).
Indeed, this is specially true in the "bigrams" mode, where each point (X,Y) is set if the bytes X and Y (00..FF) appear in that order in the input. If you look at the bigrams example in the README, you can see that there is a bright zone where the lowercase ASCII characters are, since that graph is plotting the .rodata section of the binary (using the bin-graph-section.sh script). These patterns appear with other kinds of data, not just text (e.g. x86 instructions).
https://youtu.be/C8--cXwuuFQ?list=PLUyyOw61zxiJXMihb4PjYbGHE...
The 3d pan/tilt/zoom visualizations of the trigraphs are especially nice to look at.