Jump to content
Tuts 4 You

Resolve method handle with cecil?


high6

Recommended Posts

How do you do something like

ModuleHandle.ResolveMethodHandle(token);

in cecil?

Assembly.MainModule.MemberReferences doesn't contain all the references.

Only way I can think is by loading each referenced assembly and check it. Would be very very slow though... (also locating the assemblies...)

Link to comment

I think I might have a cheat way. Load the assembly with System.Reflection and use it to resolve the metadatatoken. Then with the MethodInfo it returns resolve it with cecil.

I might look more into Assembly.MainModule.LookupByToken to see if I can add member support.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...