package binsec

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

Basic stream reader

type bytestream
type t
Constructors
val of_img : ?endianness:Machine.endianness -> ?cursor:int -> Loader.Img.t -> t
val of_nibbles : ?endianness:Machine.endianness -> ?cursor:int -> ?base:int -> string -> t
val of_bytes : ?endianness:Machine.endianness -> ?cursor:int -> ?base:int -> string -> t
val of_binstream : ?endianness:Machine.endianness -> ?cursor:int -> ?base:int -> Binstream.t -> t
Pretty-printer
val pp : Stdlib.Format.formatter -> t -> unit
Generic manipulation functions
val get_virtual_cursor : t -> int
val rewind : t -> int -> unit

rewind r n moves back the cursor n bytes.

val advance : t -> int -> unit

advance r n moves the cursor the cursor n bytes.

val set_endianness : t -> Machine.endianness -> unit

set_endianness e r sets reader to report value w.r.t to endianness r

Read functions
module type Accessor = sig ... end
module Read : Accessor with type t := t

Accessor functions of module Read read n=1, 2, 4, or 8 bytes and advance n bytes as well.

module Peek : sig ... end

Peek is like Read but does not advance

val get_slice : t -> int -> int -> int list

get_slice addr_start addr_end returns the list of bytes contained in the interval from addr_start included to addr_end excluded. @assert addr_start < addr_end

OCaml

Innovation. Community. Security.