package bap-std
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=9c126781385d2fa9b8edab22e62b25c70bf2f99f6ec78abb7e5e36d63cfa4174
md5=5abd9b3628b43f797326034f31ca574f
doc/bap/Bap/Std/Project/Input/index.html
Module Project.Input
Input information.
This module abstracts the input data necessary to create a project.
type t = inputval load :
?target:Bap_core_theory.Theory.Target.t ->
?loader:string ->
string ->
tload filename loads the file from the specified path. The file must be regular (i.e., not a pipe) and is expected to have the necessary meta information, i.e., not the raw code (use raw_file to load files that are raw code).
If loader is not specified then all image loaders are used and the information from the is merged, otherwise only the selected loaded is used. See Image.available_backend.
The target could be used to override the target information derived from the input file.
instead of the derived target, and the derivation itself is not performed.
val raw_file : ?base:addr -> Bap_core_theory.Theory.Target.t -> string -> traw_file ?base target ~filename creates an input from a binary file that is raw code for the given target, i.e., without any headers or meta information.
val from_string : ?base:addr -> Bap_core_theory.Theory.Target.t -> string -> tcreate ?base target code creates input from the binary code for the given target.
val from_bigstring :
?base:addr ->
Bap_core_theory.Theory.Target.t ->
Core_kernel.Bigstring.t ->
tcreate ?base target code creates input from the binary code for the given target.
val custom :
?finish:(project -> project) ->
?filename:string ->
?code:value memmap ->
?data:value memmap ->
Bap_core_theory.Theory.Target.t ->
tcustom target creates a custom input.
The target parameter denotes the target system of the input program. The code and data parameters are stored in the Project.memory and code is disassembled and lifted if the specified target has a disassembler and lifter.
The filename is used to communicate with external tools and will be broadcasted via Info.file stream and stored in the filename property of the project, otherwise it is not used when the project is created.
The finish project is the post-constructor that takes the nearly finished project (with code and data and potentially disassembled and lifted code) and constructs the final project.
val register_loader : string -> (string -> t) -> unitregister_loader name load register a loader under provided name. The load function will be called the filename, and it must return the input value.
available_loaders () returns a list of names of currently known loaders.
Deprecated Interface
The following functions are deprecated and better alternatives are provided. They might be removed in BAP 3.0.
binary ?base arch ~filename create an input from a binary file that is a pure code without any headers or meta information.
val file : ?loader:string -> filename:string -> tfile ?target ?loader ~filename input data from a file, using the specified loader. If loader is not specified, then some existing loader will be used. If it is specified, then it is first looked up in the available_loaders and if it is not found, then it will be looked up in the Image.available_backends.
val create :
?finish:(project -> project) ->
arch ->
string ->
code:value memmap ->
data:value memmap ->
tcreate arch filename ~code ~data creates an input from a file, using two memory maps. The code memmap spans the code in the file, and data spans the data. An optional finish function can be used to propagate to the project any additional information that is available to the loader. It defaults to Fn.id.