This project is alpha (which is my excuse if something doesn't function accurately or correctly).
libsprinkles is both a library and has an accompanying example called vorhees
libsprinkles provides a simple API that can be used to disassemble binaries
using LLVM. The example program vorhees
uses libsprinkles and can be used to
disassemble a binary into a JSON representation.
The best example is to look at vorhees/main.cc which takes as input an object file and outputs a JSON representation of the executable code.
So you want to use the library?
- Include "sprinkles.hh"
- Instantiate a Sprinkles instance providing a path to an object file that is
to be disassembled:
sprinkles::Sprinkles S(filename);
- Initialize the Sprinkles instance (perform the disassembly):
S.initialize();
- Now you're ready to Sprinkle out some magical assembly!
Vorhees is an object file -to- JSON dumper. Give it a whirl!
build/vorhees/vorhees <object file>
- Create a build directory.
mkdir libsprinkles/build
- From the just created build directory, invoke cmake with the path to the
libsprinkles sources.
cd libsprinkles/build; cmake ../
- Invoke
make
to build the library and example programvorhees
.
- llvm: libsprinkles uses many of the libraries provided
by LLVM. Build and install LLVM, or use a package (
llvm
and/orllvm-dev
).
Matt Davis: https://github.com/enferex