Hey,
I'm attempting to create a basic packet monitoring project in C#. I started with an injected module using EasyHook, however ran into some issues. It's at that point I found Apoc's ExternalProcessHook class. Rather than necro'ing that thread to ask for help with it, I figured I'd ask here.
Code:
private static ExternalProcessHook _hook;
static void Main(string[] args)
{
Process[] procs = Process.GetProcessesByName("Wow");
Process wow = procs[0];
_hook = new ExternalProcessHook(wow, HookRegister.DR0, (IntPtr)0x2F3D4F, new ExternalProcessHook.HandleHookCallback(NetClient__ProcessMessage));
while (true) { }
}
////char __fastcall NetClient__ProcessMessage_Hook(void *This, int edx, int a1, int a2, UINT_PTR a3, int a4)
private static void NetClient__ProcessMessage(ref ExternalProcessHook.ThreadContext context)
{
Console.WriteLine("Callback invoked.");
}
As you can see, super-simple.. yet nothing happens. Everything compiles, and it runs without exception. 0x2F3D4F is the pointer to NetClient__ProcessMessage for 7.1.5.24015, which will be used to monitor incoming packets from the server. I've ensured that _hook is not being disposed at any point, and I've tried with a variety of other calls, none of which seem to trigger a callback.
Any advice to get this working would be appreciated! Thanks.
Apoc's post: http://www.ownedcore.com/forums/worl...clean-way.html ([Release] C# HWBP Hooks - The clean way)