cargo-sym [](https://travis-ci.org/m4b/cargo-sym)
November 22, 2016 ยท View on GitHub
Prints various binary symbols in your crate. Also experimentally disassembles.
This uses capstone for disassembly, so it will compile faster if you have capstone installed as a system library.
Usage
First install:
cargo install cargo-sym
or via git:
cargo install --git https://github.com/m4b/cargo-sym -f
Then:
cargo symwill print every debugging symbol it finds in the first valid binary target intarget/<target>/debug. This can be, for example:
a.target/debug (this is used if it doesn't find a special target, like the following)
b. target/x86_64-unknown-linux-musl/debug
cargo sym -Cwill print every debugging symbol demangledcargo sym -ewill print every exported symbol importable by other binariescargo sym -Cewill do-Cand-etogether :]cargo sym -dwill disassemble your binary, objdump style. experimentalcargo sym -d -C /bin/lswill disassemble the binarylsat/bin/(actually most distros strip/bin/lsso it actually won't)cargo sym -Cd --target=aarch64-linux-androidwill disassemble your crates binary attarget/aarch64-linux-android/debug/<crate_name>cargo sym -C --release -x examplewill print the symbols from the example binary you compiled in release mode (attarget/release/examples/example)cargo sym -Cd --target=debug -x mainwill disassemble the example binarymainin the regular debug locationtarget/debug/examples/main
Try cargo sym --help for more information!
TODO:
- Target selector is not. There are a few fixmes to make it nicer. (easy)
- ARM 32-byte printer not completely correct when in thumb mode, should reverse second 8 byte block. (easy)
- Need to properly print got, plt, and plt.got and iterate through sections in a more principled manner. (not to easy)
- When goblin gets a mach and PE backend (which I keep saying will be soon), update the various backends (tedious, hard, requires knowledge of backend formats)
PRs welcome of course :)