package bap-std

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type

Recursive Descent Disassembler. This disassembler is built on top of Basic disassembler. It uses the work list algorithm to implement recursive descent disassembly and reconstructs the whole program CFG.

This is an expert-level module, and it is suggested to use high-level Disasm interface, that is built ontop of this module.

type t
type error = [
  1. | `Failed_to_disasm of mem
  2. | `Failed_to_lift of mem * Basic.full_insn * Core_kernel.Error.t
]

error domain of errors.

val sexp_of_error : error -> Sexplib0.Sexp.t
val run : ?backend:string -> ?brancher:brancher -> ?rooter:rooter -> arch -> mem -> t Core_kernel.Or_error.t

run ?backend ?brancher ?rooter arch mem disassemble and reconstruct a CFG of the code in mem, assuming architecture arch.

  • parameter backend

    a backend name (default is implementation defined).

  • parameter rooter

    what rooter to use (defaults to Rooter.empty).

val cfg : t -> cfg

cfg t returns a control flow graph, representing the code in the input region of memory. Note, this is not a subroutine CFG, is is a whole segment graph.

val errors : t -> error list

errors disasm returns a list of non-critical errors, that happened during the disassembly (e.g., unknown opcodes and unlifted instructions.

OCaml

Innovation. Community. Security.