I'm using EasyHook to inject a DLL into a process (Duh!) However, when the Inject function is called, I get this error message:
"The given user library does not export a proper Run(EasyHook.InjectionLoader+REMOTE_ENTRY_INFO) method in the 'EasyHook.IEntryPoint' interface."
And I'm sure it does.
Here's the DLL code:
using System;
using EasyHook;
using System.Windows.Forms;
namespace EasyHookDLL
{
public class Main : IEntryPoint
{
public Main(RemoteHooking.IContext IContext, String InChannelName)
{
MessageBox.Show("Constructor called");
}
public void Run(RemoteHooking.IContext IContext, String InChannelName)
{
MessageBox.Show("Run method called");
}
}
}
And here's my Injector:
using System;
using EasyHook;
using System.Diagnostics;
using System.Threading;
namespace EasyHookInjector
{
class Program
{
static void Main(string[] args)
{
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");
Console.WriteLine("Waiting for process to start...");
Process[] processes;
while ((processes = Process.GetProcessesByName("Process name")).Length == 0)
{
Thread.Sleep(500);
}
Console.WriteLine("Injecting...");
RemoteHooking.Inject(processes[0].Id,
@"dll path.dll",
@"dll path.dll",
null);
}
}
}
I have also tried adding all EasyHook files into the debug folder, but that didn't help.