dynamic-execution

Is there any way to trick the .net JIT compiler into running another method?

Ok, say that my application is emitting (x86) instructions into memory, making the page executable, etc. Is there any way of altering the method stub of an un-JITted method to point to my emitted instruction stream? E.g.: Suppose I have created an x86 instruction stream in memory, which does something arbitrary. Now, further suppose th...

How can you get a DLL to be deleted when its owner process exits?

I have a .NET assembly DLL that is created on-the-fly from pre-compiled code in a database. Is there a way to create the DLL file, put data into it, load it with the Assembly class, then when the process exits, have that DLL be deleted? My first thoughts were to open it with the FILE_SHARE_DELETE flag, load it with Assembly.LoadFrom, an...