FeijiangHan / dead_code_analyzer

Using DynamoRIO and XED to find redundant executions (Dead code)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

license language linux release
If you are interested in This project, please kindly give Me a triple `Star`, `Fork` and `Watch`, Thanks!

DeadCode Detection Framework

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

  1. This tool aims to detect and analyze dead code (redundant executions) in binary files using DynamoRIO and XED.
  2. Here, I only implement a basic logic to detect dead writes and reads
  3. 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.
  4. You can also modify the code output logic to use CSV or any other file you want
  5. 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: poster-Feijiang Han

The process can be summarized as follows:

  1. Obtain the binary file (trace) that needs to be parsed.
  2. 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.
  3. Utilize Intel XED to decode register details and analyze fine-grained parameters.
  4. Modify the dead code detection logic in dead_code_analysis.cpp. The implementation includes detecting redundant reads and redundant writes.
  5. 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.

About

Using DynamoRIO and XED to find redundant executions (Dead code)


Languages

Language:C 92.3%Language:C++ 7.6%Language:CMake 0.1%