Skip to content

Commit 5e79f72

Browse files
authored
Update/create READMEs for all examples (#56)
1 parent 90e7334 commit 5e79f72

File tree

24 files changed

+291
-19
lines changed

24 files changed

+291
-19
lines changed

CFGraph/README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Control Flow Graph
2+
3+
## Create a Graphviz file from the CFG
4+
5+
The following complete example uses ParseAPI to parse a binary and
6+
dump its control flow graph in the Graphviz file format.
7+
8+
---
9+
10+
## Usage
11+
12+
Run the mutator
13+
14+
$ ./CFGraph /path/to/binary >binary.dot
15+
16+
Convert the DOT file into an image
17+
18+
$ dot ./binary.dot binary.png
19+

DynC/README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# DynC
2+
3+
## The Dyninst C-like snippet language
4+
5+
Dyninst is a powerful instrumentation tool, but specifying
6+
instrumentation code (known as an Abstract Syntax Tree) in the
7+
BPatch snippet language can be cumbersome. DynC API enables a programmer to easily and quickly build
8+
snippets using a simple C-like language. Other advantages to
9+
specifying snippets using DynC include cleaner, more readable
10+
mutator code, automatic variable handling, and runtime-compiled
11+
snippets.

README.md

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,9 @@ To configure the build, you can use
1010

1111
NOTE: The last three parts of the `Dyninst_DIR` path *must* be the `lib/cmake/Dyninst` directory under your Dyninst installation.
1212

13-
The project can be built out-of-source using the usual `-B` and `-H` CMake flags.
14-
15-
The default CMake configure uses GNU Makefiles as the generator, so to build is just
16-
17-
make install
18-
1913
To build only specific examples, you can specify their names like so
2014

21-
make codeCoverage CFGraph
15+
cmake --build <build_dir> --target codeCoverage
2216

2317
## Running
2418

codeCoverage/README.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
1-
This directory contains a simple code coverage tool built with DyninstAPI. The
2-
tool uses Dyninst to instrument every function in a program binary as well as
1+
# Code Coverage
2+
3+
### A simple code coverage tool built with DyninstAPI
4+
5+
The tool uses Dyninst to instrument every function in a program binary as well as
36
optionally instrumenting every basic block to record code coverage data.
47

5-
The goal of this tool is to demonstrate some of the capabilities of DyninstAPI.
8+
The goal is to demonstrate some of the capabilities of DyninstAPI.
69
It does very little processing of the raw code coverage data, just some basic
710
sorting when outputting the data. This tool should serve as the basis for
811
creating a more feature-rich code coverage tool using Dyninst.

common/README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Common files
2+
3+
## Common files for the examples
4+
5+
These are not intended to demonstrate any particular purpose of Dyninst.

dataflowAPI/README.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# DataflowAPI
2+
3+
## Small code snippets showing ideas of dataflow analysis
4+
5+
These are not standalone programs. They only demonstrate the minimal code necessary
6+
to use a feature of DataflowAPI.
7+
8+
---
9+
10+
## Liveness
11+
12+
Query for live registers.
13+
14+
## Slicing
15+
16+
Perform a backward slice on an indirect jump instruction to determine the instructions that affect the
17+
calculation of the jump target.
18+
19+
## Stack Analysis
20+
21+
Use stack analysis to print out all defined stack heights at the first instruction in a block.
22+
23+
## Symbolic Evaluation
24+
25+
Expand a slice to ASTs and analyze them.

disassemble/README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Disassembly
2+
3+
## Use InstructionAPI to generate textual representations of instructions
4+
5+
---
6+
7+
## Function Disassembly
8+
9+
Uses InstructionAPI to disassemble the basic blocks in a function.
10+
11+
## Unknown Instructions
12+
13+
Implement a custom handler for instructions not known to Dyninst.

dyninstAPI/README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Dyninst API
2+
3+
## A toolkit for instrumentation
4+
5+
---
6+
7+
## Wrap Function
8+
9+
Wrapping malloc with fastMalloc while allowing functions to still access the original
10+
malloc function by calling origMalloc.

insertSnippet/README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Snippets
2+
3+
## Insert arbitrary code into a binary
4+
5+
---
6+
7+
## No-op Snippet
8+
9+
Insert a sequence of x86 nop instructions into the beginning of every function in a binary.
10+
This creates a "nop slide" that is sometimes seen in adversarial binaries.

instructionAPI/README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# InstructionAPI
2+
3+
## Small code snippets showing ideas of instruction parsing and analysis
4+
5+
---
6+
7+
## Stateless Visitor
8+
9+
Prints out the name of each type of AST visited.
10+
11+
## Stateful Visitor
12+
13+
Tracks the most-recently seen type of AST.

0 commit comments

Comments
 (0)