Crates.io | llvm-ir-taint |
lib.rs | llvm-ir-taint |
version | 0.1.1 |
source | src |
created_at | 2022-04-05 03:26:38.983914 |
updated_at | 2022-04-05 06:12:24.128042 |
description | Taint tracking for LLVM IR |
homepage | |
repository | https://github.com/cdisselkoen/llvm-ir-taint |
max_upload_size | |
id | 562407 |
size | 192,697 |
llvm-ir-taint
: Taint tracking for LLVM IRThis crate provides static taint-tracking for LLVM IR.
llvm-ir-taint
is on crates.io,
so you can simply add it as a dependency in your Cargo.toml
, selecting the
feature corresponding to the LLVM version you want:
[dependencies]
llvm-ir-taint = { version = "0.1.1", features = ["llvm-13"] }
Currently, the supported LLVM versions are llvm-8
, llvm-9
, llvm-10
,
llvm-11
, llvm-12
, and llvm-13
.
The corresponding LLVM library must be available on your system; see the
llvm-sys
README for more details and instructions.
You'll also need some LLVM IR to analyze, in the form of one or more llvm-ir
Module
s.
This can be easily generated from an LLVM bitcode file; for more detailed
instructions, see llvm-ir
's README.
Once you have one or more Module
s, you can call
do_taint_analysis_on_function()
to analyze a single function (and all
functions it calls, including transitively), or
do_taint_analysis_on_module()
to analyze all the functions in an LLVM
module.
let module = Module::from_bc_path(...)?;
let taint_result = do_taint_analysis_on_function(&[module], ...);
Either of these functions return a TaintResult
, from which you can get
information about the result of an analysis, such as which variables are
tainted.
For more details, see the docs.