Using DynamoRIO and XED to find redundant executions (Dead code)
- This project can be used as a framework for dead code analysis.
- This project can also be seen as introductory training to help students or beginners explore some instruction-level programming work
Important
- This tool aims to detect and analyze dead code (redundant executions) in binary files using DynamoRIO and XED.
- Here, I only implement a basic logic to detect dead writes and reads
- You have the freedom to modify the detection logic in dead_code_analysis.cpp to achieve better dead code detection than what is currently implemented.
- You can also modify the code output logic to use CSV or any other file you want
- This project does not read files using C++, so you need to configure the compiler to specify the binary path in order to get the binary into the program. I feel that Clion is more convenient, VScode is slightly more complicated
Here is a poster of me showcasing my work during NCSU GEARE training:
The process can be summarized as follows:
- Obtain the binary file (trace) that needs to be parsed.
- Extract the necessary code from DynamoRIO for parsing the target binary. This step gathers detailed information about instructions, such as read/write operations and parameter details.
- Utilize Intel XED to decode register details and analyze fine-grained parameters.
- Modify the dead code detection logic in dead_code_analysis.cpp. The implementation includes detecting redundant reads and redundant writes.
- The analysis results will be output to the 'out' file, which can be further analyzed.
TODO:
- Optimize the output format for better readability.
- Implement more sophisticated dead code detection logic.
Please refer to the project repository for more information and access to the source code.