package bap-std

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

Binary Image.

Type definitions

type t = image

image

include sig ... end
val sexp_of_t : t -> Sexplib.Sexp.t
type segment

segment

symbol

include sig ... end
val segment_of_sexp : Sexplib.Sexp.t -> segment
val sexp_of_segment : segment -> Sexplib.Sexp.t
val compare_segment : segment -> segment -> int
val bin_segment : segment Core_kernel.Std.Bin_prot.Type_class.t
val bin_read_segment : segment Core_kernel.Std.Bin_prot.Read.reader
val __bin_read_segment__ : (int -> segment) Core_kernel.Std.Bin_prot.Read.reader
val bin_reader_segment : segment Core_kernel.Std.Bin_prot.Type_class.reader
val bin_size_segment : segment Core_kernel.Std.Bin_prot.Size.sizer
val bin_write_segment : segment Core_kernel.Std.Bin_prot.Write.writer
val bin_writer_segment : segment Core_kernel.Std.Bin_prot.Type_class.writer
type symbol

symbol

include sig ... end
val symbol_of_sexp : Sexplib.Sexp.t -> symbol
val sexp_of_symbol : symbol -> Sexplib.Sexp.t
val compare_symbol : symbol -> symbol -> int
val bin_symbol : symbol Core_kernel.Std.Bin_prot.Type_class.t
val bin_read_symbol : symbol Core_kernel.Std.Bin_prot.Read.reader
val __bin_read_symbol__ : (int -> symbol) Core_kernel.Std.Bin_prot.Read.reader
val bin_reader_symbol : symbol Core_kernel.Std.Bin_prot.Type_class.reader
val bin_size_symbol : symbol Core_kernel.Std.Bin_prot.Size.sizer
val bin_write_symbol : symbol Core_kernel.Std.Bin_prot.Write.writer
val bin_writer_symbol : symbol Core_kernel.Std.Bin_prot.Type_class.writer
type path = string

Constructing

type result = (t * Core_kernel.Std.Error.t list) Core_kernel.Std.Or_error.t

constructing an image can result in actual image and a set (hopefully empty) of errors occured in a process of decoding an image, that do not prevent us from actually creating an image. So, this information messages can be considered as warnings.

val create : ?backend:string -> path -> result

create ?backend filename creates an image of the file specified specified by the filename. If backend is equal to "auto", then all backends are tried in order. If only one backend can read this file (i.e., there is no ambiguity), then image is returned. If backend is not specifed, then the LLVM backend is used.

val of_string : ?backend:string -> string -> result

of_string ?backend ~data creates an image from the specified data. See create for backend parameter.

val of_bigstring : ?backend:string -> Core_kernel.Std.Bigstring.t -> result

of_bigstring ?backend ~data creates an image from the specified data. See create for backend parameter.

Attributes

val entry_point : t -> addr
val filename : t -> string option
val arch : t -> arch
val addr_size : t -> addr_size
val endian : t -> endian
val data : t -> Core_kernel.Std.Bigstring.t
val words : t -> size -> word table

Tables

val segments : t -> segment table
val symbols : t -> symbol table
val segment : segment tag

Tags

val symbol : string tag
val section : string tag
val memory : t -> value memmap

returns memory, annotated with tags

val memory_of_segment : t -> segment -> mem

Mappings

memory_of_symbol sym: returns the memory of symbol in acending order.

val memory_of_symbol : t -> symbol -> mem * mem seq

memory_of_symbol sym: returns the memory of symbol in acending order.

val symbols_of_segment : t -> segment -> symbol seq
val segment_of_symbol : t -> symbol -> segment
module Segment : sig ... end

Image Segments. Segment is a contiguous region of memory that has permissions. The same as segment in ELF.

module Symbol : sig ... end

Symbol.

Backend Interface

val register_backend : name:string -> Backend.t -> [ `Ok | `Duplicate ]

register_backend ~name backend tries to register backend under the specified name.

val available_backends : unit -> string list

lists all registered backends

OCaml

Innovation. Community. Security.