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
> I don't know how you "patch" the methods, but I have used MethodRental class
> from System.Reflection.Emit.
[quoted text clipped - 23 lines]
>> Owasp .Net Project
>> www.owasp.net
cody - 25 Apr 2006 09:10 GMT
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.
> Hello Laura,
>
[quoted text clipped - 50 lines]
>>> Owasp .Net Project
>>> www.owasp.net
drjflam@gmail.com - 29 Apr 2006 01:26 GMT
Use ICorProfilerInfo::SetFunctionReJIT().
-John
http://www.iunknown.com
Dinis Cruz - 30 Apr 2006 00:48 GMT
Does this works on an application where the .Net Profiler is not activated?
I have used the .Net Profiler in the past (see the .NetMon tool I wrote
for Foundstone) and the biggest annoyance that I had, was the fact that
I could not use the Profiler functionality (for example the ability to
trace function flow execution) on projects that where not started with
the Profiler activated.
Dinis Cruz
Owasp .Net Project
www.owasp.net
> Use ICorProfilerInfo::SetFunctionReJIT().
>
> -John
> http://www.iunknown.com