How Moles Isolation framework is implemented?

Moles implements a CLR profiler (in particular the ICorProfilerCallback interface) that allows to rewrite MSIL method bodies before they are compiled into assembly code by the .NET runtime. This is done in particular through the JitCompileStarted callback. In each method, Moles introduces a detour that looks like this: static struct DateTime { static DateTime Now … Read more