package binsec

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

The empty patch map

val load_file : string -> t

load_file filename loads patches contained in filename

The patches can be given in the following format, defined in file parser/parser.mly:

  • (address "....")
  • (address (i_1 ... i_n))

i.e. the file contains a list of small S-expressions where:

  • the first element is an address (hexadecimal or decimal integer);
  • the second element is either

    • a string (interpreted as a sequence of bytes);
    • or a (non-empty) list of integers, where each integer corresponds to a byte (0 <= n <= 255).
val of_list : (Virtual_address.t * Binstream.t) list -> t

of_list l converts an association list l of addresses to opcodes to a patch map

val add_bytes : Virtual_address.t -> Binstream.t -> t -> t

add_bytes address bytes patchmap writes the opcode bytes to address in the patchmap. The full length of the byte sequence is writtent starting at address.

OCaml

Innovation. Community. Security.