Skip to main content
edited title
Link
bernd feinman
  • 463
  • 1
  • 3
  • 10

.NET: How to debug or decompile a DanamicMethoDanamicMethod with dnSpy?

Source Link
bernd feinman
  • 463
  • 1
  • 3
  • 10

.NET: How to debug or decompile a DanamicMetho with dnSpy?

I have a managed .NET executable that supplies the msil bytecode of a function as raw bytes. It constructs a DynamicMethod object, sets the bytecode with DynamicMethod.DynamicILInfo.SetCode() and invokes it with DynamicMetho.Invoke().

What is the best way to decompile or step into this DynamicMethod thing? How do I reverse it?

DnSyp doc has this to say:

Dynamic modules can be debugged (but not dynamic methods due to CLR limitations)

But there has to be a way to deal with it.

I am new to .NET debugging so there might be a simple solution I am missing.