Binsec.Disasm_coreval register_decoder :
Machine.isa ->
(Lreader.t -> Virtual_address.t -> 'a * Dhunk.t) ->
('a -> Instruction.Generic.t) ->
unitmodule W : sig ... endmodule Successors : sig ... endval get_decode_replacement : unit -> Dhunk.t Virtual_address.Map.tval add_replacement : Virtual_address.t -> Dhunk.t -> unitval decode :
?img:Loader.Img.t ->
Virtual_address.t ->
Instruction.t * Virtual_address.t optiondecode addr decodes the contents of address addr
val decode_from :
Lreader.t ->
Virtual_address.t ->
Instruction.t * Virtual_address.t optiondecode_from reader addr decodes the contents of address addr
val fold :
('a -> W.t -> Instruction.t -> Virtual_address.Set.t -> 'a * W.t) ->
'a ->
W.t ->
'afold f wl v starts disassembly from worklist wl (i.e. an initial state) using function f to guide its choices to compute a value intialized to v.
In particular, f is called after each successful disassembly to compute a new worklist and a new value. It receives from the disassembly loop the current value, the current worklist, the decoded instruction, and a list of identified successors to this instruction.
The set of successors is computed according to the disassembly mode. The default is recursive as stated in Disasm_options.
If you want the linear successors only do:
Disasm_options.DisassemblyMode.set "linear";
before starting the fold functions.
val iter :
(W.t -> Instruction.t -> Virtual_address.Set.t -> W.t) ->
W.t ->
unititer f worklist iterates disassembles an executable with function f.
Given the signature of the function, all computations, except worklist management, must take place as imperative side-effects.
module type Iterable = sig ... endval decode_binstream :
?base:Virtual_address.t ->
Binstream.t ->
Instruction.t * Virtual_address.t optiondecode_binstream b decodes stream b and returns a tuple of the first instruction contained in b and its possible linear successor.