package binsec

  1. Overview
  2. Docs

doc/binsec_sse_loader/Binsec_sse_loader/Image/index.html

Module Binsec_sse_loader.ImageSource

Sourcetype buffer =
  1. | Zero
  2. | Data of {
    1. offset : int;
    2. len : int;
    3. value : Binsec_kernel.Loader_types.buffer;
    }
Sourceval crop_buffer : lo:Z.t -> hi:Z.t -> buffer -> buffer

crop_buffer ~lo ~hi buf creates a new buffer view containing the buf bytes from lo to hi.

content_reader addr size ~endianness content returns a new Reader of size bytes of content starting from addr.

Sequential accesses are optimized with a cache.

  • raises Not_found

    if the reader tries to access a non-mapped address.

Sourcetype protection =
  1. | R
  2. | RW
  3. | RX
  4. | RWX
Sourcetype symbol = {
  1. base : Binsec_kernel.Virtual_address.t;
  2. name : string;
  3. origin : string;
}
Sourcetype section = {
  1. base : Binsec_kernel.Virtual_address.t;
  2. name : string;
  3. origin : string;
  4. symbols : symbol Binsec_kernel.Zmap.t;
}
Sourcetype t = private {
  1. content : buffer Binsec_kernel.Zmap.t;
    (*

    set of initialized data

    *)
  2. protection : protection Binsec_kernel.Zmap.t;
    (*

    set of mappings

    *)
  3. symbols : (Z.t * string) list Binsec_kernel.Dba.Var.Tag.Attribute.Map.t Binsec_kernel.Basic_types.String.Map.t;
    (*

    set of symbol attributes

    *)
  4. layout : section Binsec_kernel.Zmap.t;
    (*

    reverse memory paving

    *)
}
Sourceval load : fs:(string -> Binsec_kernel.Loader_types.buffer) -> string -> Binsec_kernel.Loader.Img.t -> t

load ~fs filename img builds a process image for the file filename with the content, permission and symbols from the loader image img.

It uses the virtual file system fs to access extra file contents (e.g. for separated debug or coredump).

layout_with_cache image returns two mapping functions. The first one maps an address to a section while the second maps an address to the symbol it belongs.

Sequential accesses are optimized with a cache.

  • raises Not_found

    if the address is not mapped.