EasyHook 2.7 Alpha -- Injection Issue

May 15, 2012 at 3:14 AM

I'm having a problem injecting with EasyHook 2.7. I've played with a few settings and tutorials and various samples seem to work but my own project is not working all of the time. With hopefully not needing to get into too much detail, there is a strange occurance which I'm hoping will help you figure out what I may have done wrong.

If I run my program it crashes on the 

RemoteHooking.Inject() call.

However if I run Process Monitor and select my program so that it traces the activity. If I then call the injection it runs and works perfectly. If I shut down the program and run it again (without compiling), it crashes. Then if I use process monitor and check it again, it runs fine. Is this possibly a GAC issue? I was under the impression 2.7 could work without easyhook in the GAC, but it appears that my 2.7 dll is in fact registered in the GAC properly. Thanks for your assistance :)

May 15, 2012 at 6:40 AM

I seem to have solved this issue (I'm further along in another error, but much closer). I'm still not sure why it worked when I ran the Process Monitor tool, but my injection dll was not being compiled into the correct location. Perhaps the GAC version of it was working when process monitor was inspecting it, but that still doesn't make much sense. Either way, I'm beyond this point. Sorry for the wasted post.

May 15, 2012 at 11:46 AM

There are some things that work differently if you are passing objects that are defined in your assembly that is being injected, because they are no-longer registered in the GAC they cannot be resolved by the binary deserializer (also .NET remoting requires a work around also).

The documentation requires some updating to include this sort of information for the 2.7 release.

It is possible that you have hit something like this. If you want to explain your scenario in a little more detail perhaps I can help.

Cheers,

J