Binsec.Loader_utilsLoader utility functions
val find_section_by_name : string -> Loader.Img.t -> Loader.Section.tval section_slice_by_name : string -> Loader.Img.t -> int * intsection_slice section_name img returns the interval lo, hi of virtual addresses defining the section section_name.
val find_section_by_address :
address:int ->
Loader.Img.t ->
Loader.Section.t optionval find_section_by_address_exn :
address:int ->
Loader.Img.t ->
Loader.Section.tval section_slice_by_address : address:int -> Loader.Img.t -> int * intval find_section :
p:(Loader.Section.t -> bool) ->
Loader.Img.t ->
Loader.Section.t option Manipulation of symbols *
Functions that are of the form f_by_name call the function symbol_by_name which is costly because it compares all the symbols in the image to the requested name. Use them with parcimony and cache the symbols if they are requested multiple times.
val symbol_by_name : name:String.t -> Loader.Img.t -> Loader.Symbol.t optionsymbol_by_name ~name img Returns Some symbol name in img. If img contains no symbol name, returns None.
val address_of_symbol : Loader.Symbol.t -> intaddress_of_symbol symbol finds Some address where the symbole is defined. Otherwise returns None.
val address_of_symbol_by_name : name:string -> Loader.Img.t -> int optionval size_of_symbol : Loader.Symbol.t -> intval size_of_symbol_by_name : name:string -> Loader.Img.t -> int optionval symbol_interval : Loader.Symbol.t -> Virtual_address.t * Virtual_address.tsymbol_interval symbol Returns the address range corresponding to symbol
val symbol_interval_by_name :
name:string ->
Loader.Img.t ->
(Virtual_address.t * Virtual_address.t) optionval belongs_to_symbol : Loader.Symbol.t -> Virtual_address.t -> boolbelongs_to_symbol symbol addr Returns true if the address addr is locate in the symbol (i.e. in the range address_of_symbol symbol (included) and address_of_symbol symbol + size_of_symbol symbol_interval (excluded)).
val belongs_to_symbol_by_name :
name:string ->
Loader.Img.t ->
Virtual_address.t ->
boolval address_of_symbol_or_section_by_name :
name:string ->
Loader.Img.t ->
int optionval size_of_symbol_or_section_by_name :
name:string ->
Loader.Img.t ->
int optionval interval_of_symbol_or_section_by_name :
name:string ->
Loader.Img.t ->
(Virtual_address.t * Virtual_address.t) optionval get_byte_at : Loader.Img.t -> Bitvector.t -> intval entry_point : Loader.Img.t -> Virtual_address.tmodule Binary_loc : sig ... end