package bap-std
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=a6e80853aaaa26b7ca564d9878891d7146ec1c83852541387c1bba1ad036b8ea
md5=13f2cb1e3b9d90348852252fb0f2d09f
doc/bap/Bap/Std/Image/index.html
Module Std.Image
Binary Image.
Type definitions
type t = imageimage
val sexp_of_t : t -> Ppx_sexp_conv_lib.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 -> Ppx_sexp_conv_lib.Sexp.tval segment_of_sexp : Ppx_sexp_conv_lib.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 -> Ppx_sexp_conv_lib.Sexp.tval symbol_of_sexp : Ppx_sexp_conv_lib.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 specified by the filename. If backend is equal to "auto", then all backends are tried in order. If only one backend can read this file (i.e., there is no ambiguity), then image is returned. If backend is not specified, then the LLVM backend is used.
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.