问题
I need to hook managed (C#,C++/CLI) processes, I need to find and send information about how many windows it has(its associated controls and their properties)to the target application which is written in C# managed code.
For that What I need to do? Do I need to explore IAT (Import Address Table) & EAT(Export address Table) of that managed process? Do I need to write injector DLL in C++? What else apart from changing IAT and EAT , do I need?
[EDIT] I need to attach managed running processes to application(which will host or attach other process). After attaching process I need to get the properties of all the controls associated with that process's windows.
One by one I will iterate the windows of that attached process ,will enumerate all the controls associated with that window(will get control's id,name,color,position,size etc), and will send this whole info to other app or the app which attached other apps(actually that app as host again need to redraw same controls with the usage of that information, Dont ask why I need to do this:-))
Regards Usman
回答1:
I believe the answers to this questions may be of help to you:
How to use reflection to create a "reflection machine"
回答2:
Please see this http://www.codeproject.com/Articles/463508/Net-CLR-Injection-Modify-IL-Codes-on-Run-time
You can do that by modifying the IL code on runtime
Also, Profiler interface is another way for you
来源:https://stackoverflow.com/questions/5290842/how-to-hook-managed-net-processes-and-collect-information-inside-that-process