package bap-std
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=63ada71fa4f602bd679174dc6bf780d54aeded40ad4ec20d256df15886e3d2d5
md5=b8b1aff8c6846f2213eafc54de07b304
doc/bap/Bap/Std/Disasm_expert/Backend/index.html
Module Disasm_expert.Backend
The interface for custom backends.
This is an OCaml interface for defining custom disassembling backends in pure OCaml. An alternative interface in C++ can be found at disasm.hpp and disasm.h.
The interface is pretty low-level and mimics one-to-one the existing C interface between OCaml and the C/C++ disassemblers backends, which, in turn, are optimized for performance.
The Basic.custom function wraps the backend interface and enables seamless integration with the existing Basic.t interface. To make the custom backend available for your encoding, use Basic.register encoding function to register a constructor that uses Basic.custom, e.g.,
let () = Basic.register encoding @@ fun target ->
let dis = create_custom target in
Ok (Basic.custom ?target encoding backend)where create_custom is a user function that creates the custom backend and target contains the detailed information about the target system.
The Basic.lookup function could be used then to lazily create the disassembler for the given encoding, target pair. The constructor will be called only once for each pair.
val sexp_of_predicate : predicate -> Ppx_sexp_conv_lib.Sexp.tval predicate_of_sexp : Ppx_sexp_conv_lib.Sexp.t -> predicateval sexp_of_op : op -> Ppx_sexp_conv_lib.Sexp.tval op_of_sexp : Ppx_sexp_conv_lib.Sexp.t -> opmodule type S = sig ... endThe backend interface.