package binsec
Install
dune-project
Dependency
Authors
-
AAdel Djoudi
-
BBenjamin Farinier
-
CChakib Foulani
-
DDorian Lesbre
-
FFrédéric Recoules
-
GGuillaume Girol
-
JJosselin Feist
-
LLesly-Ann Daniel
-
MManh-Dung Nguyen
-
MMathéo Vergnolle
-
MMathilde Ollivier
-
MMatthieu Lemerre
-
OOlivier Nicole
-
RRichard Bonichon
-
RRobin David
-
SSébastien Bardin
-
SSoline Ducousso
-
TTa Thanh Dinh
-
YYaëlle Vinçont
Maintainers
Sources
sha256=2f990f80ebd06b71af4fde46c6a248eb74d52c6f46be63bdf97d99f72589db13
sha512=38d93ae20ae58e10027eb0f7669d3ab960ddc640526018fc94008ccd6cb63ec99030d0ee39dfb9cbd0d5e144db4615c9027bd2adcb197fc75676c45dbb54f836
doc/binsec/Binsec/Dhunk/index.html
Module Binsec.Dhunk
DBA hunks, aka dhunk
DBA blocks
A DBA block represents a set of DBA instructions with explicit links to the next one. The first instruction of the block always has id 0. Typically, DBA a block is the translation of one binary/assembly instruction.
val empty : tThe one and only empty DBA hunk. Get it here!
val stop : tA simple dhunk of one instruction stopping with an OK Dba.state
val is_empty : t -> boolval init : int -> (int -> Dba.Instr.t) -> tval singleton : Dba.Instr.t -> tval goto : Virtual_address.t -> tA simple dhunk of one instruction jumping to the virtual address.
val length : t -> intval inst : t -> int -> Dba.Instr.t optionval inst_exn : t -> int -> Dba.Instr.tval start : t -> intstart b is the first index of block b
val exits : t -> int listexits b are the instruction indexes which end the block b
val iter : f:(Dba.Instr.t -> unit) -> t -> unitval iteri : f:(int -> Dba.Instr.t -> unit) -> t -> unitval of_list : Dba.Instr.t list -> tof_list l assumes the list is sorted in increasing order inside the block
val of_labelled_list : (int * Dba.Instr.t) list -> tof_list l assumes the list is sorted in increasing order inside the block, i.e. the labels are contiguous starting from 0.
val mapi : f:(int -> Dba.Instr.t -> Dba.Instr.t) -> t -> tval flatten : t -> (int * Dba.Instr.t) listval to_list : t -> Dba.Instr.t listval fold : ('a -> Dba.Instr.t -> 'a) -> 'a -> t -> 'aval for_all : (Dba.Instr.t -> bool) -> t -> boolval unlink : t -> int -> unitunlink dh i skips the ith instruction. Its predecessors go to its successor.
val export_and_view : ?cmd:string -> t -> unitview dh Visualize dot-rendered DBA hunk dh using cmd.
Default value for cmd is firefox.
val pred : t -> int -> int listval succ : t -> int -> int listoptimize dh Performs some "compiler" optimizations and return the simplified block.
include Sigs.PRINTABLE with type t := t
val pp : Format.formatter -> t -> unitDhunk properties
module Check : sig ... endval to_stmts : t -> Virtual_address.t -> Dba_types.Statement.t listval outer_jumps : t -> Virtual_address.Set.touter_jumps b computes the set of jumps to external addresses in hunk b. Due to dynamic jumps, this represents a syntactic under-approximation of the possible jumps from this block.
val callees : t -> Virtual_address.Set.tcallees b computes the set of addresses this block may call
val is_return : t -> boolis_return d check if dhunk d encodes a return
val has_indirect_jump : t -> boolhas_indirect_jump d returns true if the hunk contains an indirect jump instruction
type conditional = {condition : Dba.Expr.t;consequent : Virtual_address.t;alternative : Virtual_address.t;
}val conditional : t -> conditional option