bin graph
1.0.0
該程序提供了一種可視化二進製文件不同區域的簡單方法。
這些是一些啟發該項目的參考文獻:
如果您對更專業的方法感興趣,請查看以下鏈接:
該程序取決於libpng用於導出圖像。從您的軟件包管理器中安裝它。
# Arch-based distros
pacman -S libpng
# Gentoo
emerge media-libs/libpng一旦安裝了所有依賴項,請編譯程序。
git clone https://github.com/8dcc/bin-graph
cd bin-graph
make如果要在系統上安裝它,請運行以下命令。
sudo make install有多種不同的圖模式確定輸入二進制於輸出圖像中的表示。可以使用程序的help命令找到及其描述的完整模式列表。
bin-graph --help
# Usage:
# ./bin-graph [OPTION...] INPUT OUTPUT.png
#
# ...該項目還包括一個bin-graphSection.sh腳本。它使用readelf和grep來查找指定區域的偏移和大小,並將其用作bin-graph的--offset-*參數。該部分名稱後的其他選項將傳遞給bin-graph 。
./bin-graph-section.sh SECTION [OPTION...] INPUT OUTPUT.png
# ...我試圖使程序的每個部分盡可能地模塊化和獨立,以獲得更大的可維護性和更容易的擴展。
這是從二進制生成圖像的基本過程。
read_file函數從輸入文件中讀取數據。Image結構,該圖像結構只是RGB Color結構及其尺寸的數組。程序模式(可能已被--mode參數覆蓋)確定使用了哪些image_*函數。這些image_*函數在圖像中定義。有關可用模式的更多信息,請參見使用和模式。Image結構通過image2png函數(在Image.C中定義)轉換為PNG文件。./bin-graph --mode grayscale bin-graph examples/grayscale.png
./bin-graph --mode ascii bin-graph examples/ascii.png
./bin-graph --mode entropy --transform-squares 16 bin-graph examples/entropy-squared.png
# Only the .text section of the ELF file
./bin-graph-section.sh .text --mode histogram bin-graph examples/histogram.png
# Only the .rodata section of the ELF file
./bin-graph-section.sh .rodata --mode bigrams bin-graph examples/rodata-bigrams.png
./bin-graph --mode dotplot --zoom 1 --offset-start 5000 --offset-end 5500 input.wav examples/dotplot.png