DBIDynamic Binary Instrumentation (DBI) is a process control and analysis technique that involves injecting instrumentation code into a running process.Dynamic binary analysis (DBA) tools such as profilers and checkers help programmers create better software.Dynamic binary instrumentation (DBI) frameworks make it easy to build new DBA tools.
Valgrind site: www.valgrind.orgDevelopment: Group of people from all over the world (GNU GPL v2)Features:- Intermediate Representation (VEX) Terminology: - Tool plug-inSoftware package:-Framework core- Several tools Start: ./valgrind [options] –tool=tool_name program [args]Remarks:- Valgrind controls every instruction- Self-modifying code won’t run correctly Linux Android Darwin (2.3.X) (Mac OS X 10.6 & 10.7)- Valgrind + Wine = Windows x86 + +- Interaction with source code amd64 + + ARM + +- Designed for heavyweight DBA tools ppc32 + ppc64 +
DynamoRIOExecution: dynamic binary compilation and cachingFeatures :• Multi client supporting• Adaptive Level of Granularity• IR support• Translation support Patch-based instrumentation: • code cache - Caching - Linking - Building tracesAPI:• DynamoRIO• Standalone (Static Binary Analyze)• Start/Stop (Source Code Instrumentation)
DynInstDevelopment: site: www.dyninst.org University of Wisconsin-Madison, University of MarylandFramework support:- Static Binary Instrumentation- Dynamic Binary InstrumentationAPI: Start:- DynInstAPI 1) Set up the mutatee (link app with RTI library)- SymtabAPI 2) Run the mutator- InstructionAPI- ParseAPI Linux BlueGene/P FreeBSD Windows- StackwalkerAPI x86 + + +- ProcControlAPI amd64 + + ppc32 + +- DynC ppc64 +
DynInst Abstractions Used in the APIInserting Code intoa Running Program
DynInstExecution: Normal execution with inline trampolines Terminology: • MutatorAbstractions: • Mutant• Basic Blocks (classic) • InstPoints • Snippets• Edges (Edges are labeled with an edge type)• Functions• Loops (natural)Patch-based instrumentation:• interception branches - selection - relocation - patching