Question

I would like to intercept CLR function calls in a .net executable (3rd party executable which i do not have access to the source code) for debugging purposes. I have been looking at some hooking apis (deviare, easyhook, mhook) etc but i think they only support hooking into simple functions in a dll such as xxx.dll!functionname and not capable of logging constructor calls on objects etc. I would like to know if they are any libs that are capable of easily logging function calls in a .net executable such as if a process calls the function File.ReadAllText(@"C:\name.txt"); i would log the function File.ReadAllText with the arguments c:\name.txt.

Here are some things i have tried/looked at but didn't do what i wanted.

Deviare

Mhook

EasyHooks

Microsoft Moles

Redgate Ants Profiler (This one is really close. it logs all the clr functions calls , i just need it to log the arguments. If you know how that would pretty much solve my problem)

Était-ce utile?

La solution

If it's a .net executable and you have the legal rights to modify it, you can use reflector with a modifying plugin to change anything in the source code and recompile it.

Autres conseils

Deviare supports hooking by address. You can see this article: http://blog.nektra.com/main/2013/03/27/how-to-identify-virtual-table-functions-with-the-vtbl-ida-pro-plugin/

There we have done complete vtable hooking of a process without source code or any other information source such as PDF, RTTI, etc.

In the future we will add .NET hooking. It's in our plans but we didn't have time to implement it.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top