Study of Reflection Instrumentation in Reverse Engineering
Ping Chen · Chinese Journal of Computers · 2004
Dynamic analysis is an important approach for users to comprehend object-oriented software system. Run-time information of software system can be extracted by instrumentation mechanism. In conventional approaches, instrumented codes stand at the same level with source codes. Based on reflection principle and techniques, this paper provides the approach of reflection instrumentation, in which the instrumented codes and source codes are placed at different two levels. Through the approach, meta-object at meta-level can intervene compiling process, and thus change the behavior of object at base level. First, the algorithm of reflection instrumentation and the approach of identifying object ID are given. Second, the algorithm of instrumentation in front of the call statements of global function and system call is implemented by extending the open compiler. Finally, a case study is given to show the principle and effectiveness of reflection instrumentation. The results indicate that the reflection instrumentation mechanism can instrument codes into source codes of software system accurately and effectually, not destroying the business logic of the source system. The convergence of the algorithms for reflection instrumentation can also be proven by the data collected from multi-instrumentation.