A way to avoid GAC use.

Jan 31, 2011 at 3:35 PM

Hi,

I'm trying to figure out, how to don't use GAC during runtime.

Ok, injected Dll Must find easyhook, and probably that i'm missing something. But i would like to register Easyhook.dll once for all into gac (during installation), not during runtime.

Because if our software register something during runtime, then user must launch the software As administrator.

My goal would be this one :

During install (so only once):

register Easyhook into GAC

place additionnal requiered files (such as EasyHookXXSvc.exe) into System32

place my Inject.dll and all its dependances into target software's working directory

During runtime:

no need to use Register Method

When i call Inject, i give the full path to my inject.dll (witch is inside target software folder).

and that s all, no need to run as admin, no reference count into gac. You see??

I tried to gently modify easyhook source code in that way, but i have a FileLoadException while WaitForInjection is running.

Does anyone tried this too?

any tips?

thanks.

 
Feb 1, 2011 at 6:36 PM
Edited Feb 1, 2011 at 8:03 PM

I finnaly succeed to reach my goal.

now my application doesn't need to be run as admin anymore, doesn't need to be signed, and most important: i don't need to use Register method into my code.

all i have to do now, is:

at deployement :

1)register easyhook.dll with gacutil

2) build a dll containing the class used by WCF (eg:FilemonInterface) and register it into the gac.

 

2)place into system32 all easyhook.dll dependances (e.g:easyhook32.dll)

3) copy the dll i want to inject, and all its dependances into target software's working directory.

At runtime:

i simply use Inject Methode like this : 

RemoteHooking.Inject(pid, @"C:\TargetApp\MyDllToInject32.dll", @"C:\TargetApp\MyDllToInject64.dll",ChannelName);

To succeed, i had to gently change some code lines into easyhook.dll project to load assembly from there full path, instead of from gac.

And that's all !

Feb 7, 2011 at 7:37 PM

Could you provide what you needed to change in the easyhook.dll project?  Many thanks!

Jun 28, 2014 at 4:13 AM
I know this is an old post, but could you provide the modification you made? I'm very interested in passing around gac and admin mode...
Coordinator
Jun 28, 2014 at 9:41 AM
chemanel wrote:
I know this is an old post, but could you provide the modification you made? I'm very interested in passing around gac and admin mode...
2.7 already supports no GAC. Take a look at the updated FileMon and ProcessMonitor samples (uploaded) today.
Marked as answer by spazzarama on 6/28/2014 at 1:44 AM