Crate disassemble [] [src]


This crate provides basic functionality for working with disassembled code.

The actual disassembly with the implementation of Instruction and other elements of the system will be provided by other crates that integrate with other systems, such as the Capstone Engine.

It is possible (likely?) that some functionality from within this crate may move in the future to a separate crate for broader re-use. This might impact Symbol among other things.


This crate works with Cargo and is on Add it to your Cargo.toml like so:

disassemble = "0.0.1"

Then, let rustc know that you're going to use this crate at the top of your own crate:

extern crate disassemble;

Future Directions

In the future, we want to extend this library to support a number of additional features:

  • Actually implement building the CFG from the instructions.
  • Switch to using the petgraph crate for the CFG and store that on Function instead of having the Function be the CFG.
  • Implement DOT output for the CFG. This can probably be done with the help of petgraph.
  • HTML output modes?
  • Implement loop finding. (Havlak)
  • Implement the Capstone Engine backend as a separate crate.
  • Make Instruction aware of operands, registers
  • Data flow support. Memory SSA?
  • Should we deal with mangled symbols at this level?
  • So much more!


Contributions are welcome.



The location of something in an address space.


A basic block is a sequence of instructions with no inward-bound branches except to the entry point and no outward-bound branches except at the exit.


Information about an edge between 2 basic blocks.


A function within a program.


A symbol within an executable or library. This is a named address.



Which direction is this edge going? Inwards or outwards from this BasicBlock?


When is this edge taken? Conditionally or unconditionally?



An assembly instruction, bytecode operation, VM operation, etc.