Re: Force Rejit of a method
- From: "cody" <deutronium@xxxxxx>
- Date: Tue, 25 Apr 2006 10:11:56 +0200
IMO you cannot jit a method with is already loaded you first have to unload
the assembly where the code belongs to and then reload it with
assembly.load.
"Dinis Cruz" <dinis.cruz@xxxxxxxxx> schrieb im Newsbeitrag
news:444D45C6.20506@xxxxxxxxxxxx
Hello Laura,
There are two types of patches that I do in my demos (both using direct
memory writes (after unlocking the relevant memory pages)).
1) Unmanaged patch - Re-Writing Assembly code directly on the method's
code. Used for example to patch the CLR so that you can load 'corrupted
Strong Named Assemblies'
2) MSIL patch - Re-Write MSIL on .Net methods. If you know the exact
location of the method this is a simple case of replacing the existing
MSIL code with the new one (although at the moment I am limited to the
size of the original MSIL code (there are some guys who did a very
interesting research on 'self healing code' which had a solution for
this problem))
Regarding JitImmediate and JitOnDemand, I have not looked at them, but I
don't think they will allow me to do what I want to do (which is to
patch managed methods that are already loaded in memory)
Best Regards
Dinis Cruz
Owasp .Net Project
www.owasp.net
Laura T. wrote:
I don't know how you "patch" the methods, but I have used MethodRental
class
from System.Reflection.Emit.
It has JitImmediate and JitOnDemand methods to recompile methods.
Laura.
"Dinis Cruz" <dinis.cruz@xxxxxxxxx> ha scritto nel messaggio
news:%23qqAogAZGHA.3752@xxxxxxxxxxxxxxxxxxxxxxx
Hello, Is there a way to force the ReJit of a method?
One of the demos that I do in my 'Rooting the CLR' presentation is to do
real time MSIL patching.
The problem is that I need to apply the 'patches' before the JIT has
occurred, unless (hence my question) I am able to dynamically either:
- ReJit a method
- Mark a method as not Jitted (whereby it is Jitted the next time that
method is invoked)
Looking at the symbols of a CLR dll (can't remember the name now) I
know that there is a internal way to do this on the CLR (after all (if I
remember correctly) that is one of the methods available to the GC to
reclaim memory).
Thanks,
Dinis Cruz
Owasp .Net Project
www.owasp.net
.
- References:
- Force Rejit of a method
- From: Dinis Cruz
- Re: Force Rejit of a method
- From: Laura T.
- Re: Force Rejit of a method
- From: Dinis Cruz
- Force Rejit of a method
- Prev by Date: RE: Major memory leak in sos.dll under .NET Framework 2.0
- Next by Date: Using GACUTIL for patches to report failures and not successes
- Previous by thread: Re: Force Rejit of a method
- Next by thread: Re: Force Rejit of a method
- Index(es):
Relevant Pages
|