Module Bap_wp.Utils

This module contains various utility functions.

module Option_let : sig ... end
val varset_to_string : Bap.Std.Var.Set.t -> string

Convert a set of variables to a string for printing debug logs.

val find_func_err : Bap.Std.sub Bap.Std.term Bap.Std.seq -> string -> Bap.Std.Sub.t

Find a subroutine by name within a sequence. Raises Not_found_s if there is no such function.

val get_mod_func_name : (string * string) list -> string -> string option

get_mod_func_name [(in_re, out_re),...] name Determines the name of a modified subroutine based on whether name matches one of the in_re regexps, returning the corresponding Some out_re for that regexp, and None if no in_re expressions match.

e.g. get_mod_func_name [("\\(.*\\)", "\\1_mod")] "foo" will return Some "foo_mod".

val match_inline : string option -> Bap.Std.sub Bap.Std.term Bap.Std.seq -> Bap.Std.sub Bap.Std.term Bap.Std.seq

Find a sequence of subroutines to inline based on the regex from the user. Retunrs the empty sequence if given None.

val init_mem : ?ogre:string option -> ?init_mem:bool -> Bap.Std.Image.path -> Bap.Std.value Bap.Std.memmap

If init_mem is true (true by default) load the memory image of a binary based on the filepath. Re-raises any encountered (fatal) errors. Returns empty memory if init_mem = false.

module Code_addrs : sig ... end