Text utilities useful in Binary Analysis and Reverse Engineering
Library bap_strings
type +'a t


type +'a decision
val create : ?alpha:float -> ?beta:float -> ?p1:float -> ?ps:float -> ?len_pdf:( float -> float ) -> Core_kernel.Char.Set.t -> 'a t

create alphabet creates a detector.

  • parameter alpha

    a desired probability of the false positive error;

  • parameter beta

    a desired probability of the false negative error;

  • parameter p1

    posterior probability of the H1 hypothesis;

  • parameter ps

    probability of an alphabet character;

  • parameter len_pdf

    probability distribution function of textual values lengths.

run detector trace runs a detector on a sequence on a trace represented as a sequence of bytes accessed during an execution. Returns a sequence of char sequences, where each subsequence is represented as a string and contains characters that were assumed to belong to the textual data.

val run : 'a t -> ('a * char) Core_kernel.Sequence.t -> 'a decision Core_kernel.Sequence.t
val step : 'a t -> 'a -> char -> 'a t

step t data char performs one observation.

val decision : 'a t -> 'a decision option
val when_decided : 'a t -> f:( 'a decision -> 'b ) -> 'b -> 'b
val abort : 'a t -> 'a decision option
val result : 'a decision -> ('a * char) list
val chars : 'a decision -> string
val data : ?rev:bool -> 'a decision -> 'a list
val pp : Format.formatter -> 'a t -> unit
val pp_decision : Format.formatter -> 'a decision -> unit
val pp_stats : Format.formatter -> 'a t -> unit