c++ simple code for source code analysis

i need to write simple code that can be used for static analysis for c++ programs.
the code should revive the c++ code for any program. then extract input variables and output variables and any assignment statement in program. can any one help me to write this code.
Is this an academic exercise? Or would you be happy with a commercial solution such as IDA Pro EDIT: I meant Hex-Ray's by IDA Pro?

By the way, there is no such thing as a "simple code" to do this. With all due respect, the fact that you phrased your question this way proves that you're in over your head. If this is academic then don't even bother. It's theoretically possible with C, but compiling C++ is pretty much a destructive process as far as the original code goes.
Last edited on
for your replay ... i need this code for academic purpose.. i think to use compiler code to do that .. any other idea??
I guess step one is knowing for sure that the code is actually written in C++. If it's anything else, including CLI then you have better options then building it back up from assembly. Are you familiar with any assembly code? You'll probably need to know most of it.
Topic archived. No new replies allowed.