https://github.com/afa7789/dynamorio_instruction_count
Instruction tool to be used with DynamoRIO that counts the number of machine instructions in a application.
https://github.com/afa7789/dynamorio_instruction_count
c dbi dynamorio
Last synced: 3 months ago
JSON representation
Instruction tool to be used with DynamoRIO that counts the number of machine instructions in a application.
- Host: GitHub
- URL: https://github.com/afa7789/dynamorio_instruction_count
- Owner: afa7789
- Created: 2021-12-22T00:20:10.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2021-12-31T23:21:25.000Z (over 3 years ago)
- Last Synced: 2025-01-23T18:49:29.326Z (4 months ago)
- Topics: c, dbi, dynamorio
- Language: C
- Homepage:
- Size: 234 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README

# Dynamo Tool
## Block counter
Simple instrumentation for instruction counting made on c++ to be used with [dynamorio](https://dynamorio.org/).## Disclaimer
The instructions tool was made with the tutoring and help of [Andrei Rimsa](http://rimsa.com.br/page/). Andrei is my professor and thesis tutor from CEFET-MG.
## How to Install
### Install Dynamorio.
```bash
git clone https://github.com/DynamoRIO/dynamorio.git
cd dynamorio
DYNAMORIO_HOME=$(pwd);
```### This tool package
```bash
# go into the correct folder
cd api/samples
# clone to the here
git clone https://github.com/afa7789/dynamorio_instruction_count.git dynamo_tool
# extract it
cp ./{dyn.patch,bbl_count.cpp} .
# Add line to CMakeLists
patch < dyn.patch
```
## Running the tool### Make first
#### Make Dynamorio
make sure you have set DYNAMORIO_HOME env var at the root of the dynamorio folder.
```bash
cd $DYNAMORIO_HOME
mkdir build && cd build
cmake -DBUILD_DOCS=no ..
make -j
```#### make tool
```bash
cd build
make bbl_count
```
### Running it
Commands to run this code
#### bbl_count.c```bash
$DYNAMORIO_HOME/bin64/drrun -c bin/libbbl_count.so -- ls
# how to use to get the output to a file.
$DYNAMORIO_HOME/bin64/drrun -c bin/libbbl_count.so arquivo_test.txt -- ls
# Example on how to run it with a full path
# By doing like this you can from anywhere in your computer
$DYNAMORIO_HOME/build/bin64/drrun -c /home/afa/Documents/code/TCC/dynamorio/dynamorio/build/api/samples/../bin/libbbl_count.so -- ls
```