|
Novel approach to binary analysis on UNIX
I had been thinking about the power of UNIX when processing data on the command line. Find, grep, awk, etc. are all well designed for this purpose. With that in mind I came up with a novel approach to representing a binary in unix. Since all binaries can be effectively broken down into functions, basic blocks, and instructions I wrote a script that takes a Paimei pida file and writes it in a UNIX directory structure. This allows for a user to navigate a binary with whatever UNIX environment they prefer using the powerful command line utilities. The way in which the script works is it creates a directory for each function, and a directory for each basic block in the function containing a file for each instruction. Each file/directory is named by address and the instruction files contain the disassembly of that instruction. For instance You can also print the contents of a basic block or function like so. Also I create symlinks for any call inside of a basic block, linking it to the functions directory. Like below, where a directory with an "_" is the call address and its destination function. Here is another simple example to look for interesting library calls. Kinda funny. The script can be gotten from the link below, and it take a Paimei pida file and output directory. https://www.openrce.org/repositories/users/codypierce/module2dir.py Paimei Comments
| ||||||