我想在c#中做一些鉤子(我寧願不使用Detours或C++),所以我一直在使用EasyHook。如何使用Easyhook與非託管可執行文件
但是當我這樣做
Config.Register("This description can be anything.", @"SomePathToAnExecutable.exe", "MyInjectionDll.dll");
我得到的錯誤:
There was an error while connecting to target: System.BadImageFormatException: Unable to load given assembly [SomePathToAnExecutable.exe] for reflection.
Is this a valid NET assembly? ---> System.BadImageFormatException: Could not load file or assembly [SomePathToAnExecutable.exe] or one of its dependencies. The module was expected to contain an assembly manifest.
問題1)我是正確的思維是SomePathToAnExecutable是過程,你想勾入?
問題2)可執行文件是否必須被託管代碼呢?
我也問過codeplex項目網站,但沒有迴應。
http://easyhook.codeplex.com/Thread/View.aspx?ThreadId=235616
你可以請我指向一些簡單的C#示例掛鉤託管程序集到非託管可執行文件的方向嗎? – 2010-12-05 03:06:12