package bap-std
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=9c126781385d2fa9b8edab22e62b25c70bf2f99f6ec78abb7e5e36d63cfa4174
md5=5abd9b3628b43f797326034f31ca574f
doc/bap/Bap/Std/Image/index.html
Module Std.Image
Binary Image.
Type definitions
type t = imageimage
val sexp_of_t : t -> Sexplib0.Sexp.tval bin_size_segment : segment Core_kernel.Bin_prot.Size.sizerval bin_write_segment : segment Core_kernel.Bin_prot.Write.writerval bin_writer_segment : segment Core_kernel.Bin_prot.Type_class.writerval bin_read_segment : segment Core_kernel.Bin_prot.Read.readerval __bin_read_segment__ : (int -> segment) Core_kernel.Bin_prot.Read.readerval bin_reader_segment : segment Core_kernel.Bin_prot.Type_class.readerval bin_segment : segment Core_kernel.Bin_prot.Type_class.tval sexp_of_segment : segment -> Sexplib0.Sexp.tval segment_of_sexp : Sexplib0.Sexp.t -> segmentval bin_size_symbol : symbol Core_kernel.Bin_prot.Size.sizerval bin_write_symbol : symbol Core_kernel.Bin_prot.Write.writerval bin_writer_symbol : symbol Core_kernel.Bin_prot.Type_class.writerval bin_read_symbol : symbol Core_kernel.Bin_prot.Read.readerval __bin_read_symbol__ : (int -> symbol) Core_kernel.Bin_prot.Read.readerval bin_reader_symbol : symbol Core_kernel.Bin_prot.Type_class.readerval bin_symbol : symbol Core_kernel.Bin_prot.Type_class.tval sexp_of_symbol : symbol -> Sexplib0.Sexp.tval symbol_of_sexp : Sexplib0.Sexp.t -> symbolConstructing
type result = (t * Core_kernel.Error.t list) Core_kernel.Or_error.tconstructing an image can result in actual image and a set (hopefully empty) of errors occurred in a process of decoding an image, that do not prevent us from actually creating an image. So, this information messages can be considered as warnings.
create ?backend filename creates an image of the file specified by the filename. If backend is not specified, then all availabe backends are used and their information is merged. If the information provided by all backends agree (i.e., there's no conflicting information), then image is returned. If backend is an explicit file path, then it is read as an OGRE file and used for loading. Otherwise, backend should be a name of one of the backends registered either with register_backend or register_loader. See available_backends for the list of available backends.
note a file path is explicit if it exists and Fn.non Filename.is_implicit.
val of_string : ?backend:string -> string -> resultof_string ?backend ~data creates an image from the specified data. See create for backend parameter.
val of_bigstring : ?backend:string -> Core_kernel.Bigstring.t -> resultof_bigstring ?backend ~data creates an image from the specified data. See create for backend parameter.
Attributes
val filename : t -> string optionfilename image a name of file from which an image was loaded (if any)
Tables
words image size returns a mapping from addresses to words of the specified size. For example, Image.words img `r8 returns all bytes.
Tags
val symbol : string tagtags a symbol
val section : string tagtags a section
val code_region : unit tagtags a code region
Mappings
memory_of_segment img seg returns a memory region occupied by the segment seg.
memory_of_symbol sym returns a sequence of memory regions that belong to the sym symbol. The sequence is represented as a pair, where the first element is the starting memory region, and the second elemnt is (a possible empty) sequence of the rest memory regions (in case if a symbol occupies a non-contigious region of memory).
symbols_of_segment img seg all symbols that belong to the seg segment.
segment_of_symbol image sym a segment to which sym belongs.
module Spec : sig ... endInterface to the image specification.
module Segment : sig ... endImage Segments. Segment is a contiguous region of memory that has permissions. The same as segment in ELF.
module Symbol : sig ... endSymbol.
Backend Interface
module type Loader = sig ... endAn interface that a backend shall implement.
val register_loader : name:string -> (module Loader) -> unitregister_loader ~name backend registers new loader.
val find_loader : string -> (module Loader) optionfind_loader name lookups the loader registered under the given name.
val register_backend : name:string -> Backend.t -> [ `Ok | `Duplicate ]register_backend ~name backend tries to register backend under the specified name.
Internals
Access to the low-level internals.
val data : t -> Core_kernel.Bigstring.tdata image returns image data. Usually it is a memory mapped input file, or it is whatever was passed to of_[big]string.
module Scheme : sig ... endA scheme of image specification.