Binsec.Loader_bufGeneric representation of loader buffers
Thanks to def-lkb for the general idea: https://github.com/def-lkb/owee
module type S = sig ... endmodule type Bufferable = sig ... endmodule type W = sig ... endmodule type Writable = sig ... endinclude W
with type t =
(int, Bigarray.int8_unsigned_elt, Bigarray.c_layout) Bigarray.Array1.tinclude S
with type t =
(int, Bigarray.int8_unsigned_elt, Bigarray.c_layout) Bigarray.Array1.ttype t = (int, Bigarray.int8_unsigned_elt, Bigarray.c_layout) Bigarray.Array1.tval dim : t -> intSize of the buffer.
A mutable cursor, pointing to an arbitrary position of a buffer.
val cursor : ?at:int -> Machine.endianness -> t -> cursorval seek : cursor -> int -> unitval ensure : cursor -> int -> string -> unitval advance : cursor -> int -> unitval at_end : cursor -> boolmodule Peek : sig ... endmodule Read : sig ... endmodule Write : sig ... endsub t len returns a fresh cursor pointing to the beginning of a sub-buffer * of size len starting from t, and advances t by len.
val read : ?signed:bool -> [ `x32 | `x64 ] -> cursor -> int