4

If I do:

 try
        {
            try
            {
                Config.Register(
                    "anydescription",
                    "myprogram.exe",
                    "inject.dll");
            }
            catch (ApplicationException ex)
            {
            }

            RemoteHooking.IpcCreateServer<interfaceppp>(ref ChannelName, WellKnownObjectMode.SingleCall);
            RemoteHooking.Inject(pid, "inject.dll", "inject.dll", ChannelName);

        }
        catch (Exception ExtInfo)
        {
        } 

I get this error:

STATUS_INVALID_PARAMETER_4: The given 32-Bit library does not exist!

I'm using VS with admin rights. In the bin folder I have all needed files AFAIK:

EasyHookFilesNeeded

I have added easyhook.dll and easyload32 and 64 as reference (why these two new files? Haven't seen any documentation talking about them). THANKS!

PD: Have tried this with same result:

 System.EnterpriseServices.Internal.Publish publish = new System.EnterpriseServices.Internal.Publish();
            publish.GacInstall("EasyHook.dll");
            publish.GacInstall("EasyHook32.dll");
            publish.GacInstall("EasyHook64.dll");
            publish.GacInstall("EasyLoad32.dll");
            publish.GacInstall("EasyLoad64.dll");
сами J.D.
  • 483
  • 2
  • 5
  • 19

3 Answers3

3

I've had same issue but with 64 bit.

Removing my assemblies and EasyHook from GAC solved the issue.

gacutil /uf EasyHook
gacutil /uf EasyLoad64
gacutil /uf MyAssembly
Oleh Nechytailo
  • 2,155
  • 17
  • 26
1

I don't know exactly why it wasn't working before. Clearly the problem was that couldn't find some assemblies. After reading on the Internet I saw an example without the Config.Register function. Seems with the latest version (2.7) you don't need to register assemblies in the GAC. I just commented this function and it worked.

сами J.D.
  • 483
  • 2
  • 5
  • 19
0

If you are using easyhook 2.7 you don't need to call Config.Register. Therefore proceed as the other answers told you:

Remove following line from you code:

Config.Register(
    "anydescription",
    "myprogram.exe",
    "inject.dll");

remove previous registered assemblies from gac:

gacutil /uf EasyHook
gacutil /uf EasyLoad64
gacutil /uf inject

Thanks everyone. Took me quite some time to figure out you need to do both.

Onurhan
  • 36
  • 4