Good starting point for walking code

  • Thread starter Thread starter Keith Patrick
  • Start date Start date
K

Keith Patrick

I have a project where I want to programmatically analyze an assembly by
looking at every method of every class and recursively do the same for every
method called within. Am I going to have to manually decompile assemblies
from raw bytes to do this, or is there a set of classes in the framework
that already encapsulate some of this functionality?
 
Hi Keith

Have a look at the Reflection namespace, this namespace contains classes
like MethodInfo and PropertyInfo.
The Assembly.GetTypes() will return an array of all the types in a assembly.
Use Type.GetMethods() to get an array of MethodInfo.

Chris
 
But MethodInfo has no methods to return what methods calls are contained
within. That's the catch I have (right now, I can build the assembly method
list, but I also want to generate the entire call tree.
 
Hi,

There is a program called Anakrino that is written by a guy called Jay
Freeman(saurik). This program takes an assembly and shows all the functions,
events, properties etc with content in C# or Managed C++. Try contacting him
on how he did it. I imagine you would then have to parse the C#/MC++ code
that is infered from IL.

Here is the web address:
http://www.saurik.com/net/exemplar/

Chris
 
Back
Top