[C#] [Question] OOP Hooking with Apoc's ExternalProcessHook menu

User Tag List

Results 1 to 2 of 2
  1. #1
    Renyei's Avatar Contributor Hand of God
    Reputation
    112
    Join Date
    Sep 2008
    Posts
    127
    Thanks G/R
    0/8
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    [C#] [Question] OOP Hooking with Apoc's ExternalProcessHook

    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)

    [C#] [Question] OOP Hooking with Apoc's ExternalProcessHook
  2. #2
    Renyei's Avatar Contributor Hand of God
    Reputation
    112
    Join Date
    Sep 2008
    Posts
    127
    Thanks G/R
    0/8
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Urgh, thank you @maclone for pointing out my stupid mistake. Completely forgot to add the base address for the process to the pointer; too accustomed to using MemorySharp which does it automatically for most calls.

Similar Threads

  1. [Question] Draenei horn with helm possible?
    By rykaerdoe in forum WoW ME Questions and Requests
    Replies: 2
    Last Post: 10-14-2007, 06:43 PM
  2. [Question] Camera Issue with Model Editing.
    By Frombehind in forum WoW ME Questions and Requests
    Replies: 0
    Last Post: 10-12-2007, 03:57 PM
  3. [Question] weapon editing with itemcache.
    By Daimao in forum WoW ME Questions and Requests
    Replies: 2
    Last Post: 10-03-2007, 07:42 PM
  4. [Question] Need help with Editing...
    By Gerudion in forum WoW ME Questions and Requests
    Replies: 9
    Last Post: 10-01-2007, 07:38 PM
  5. Question: Fly mode with WoWemuhacker on Emu servers
    By Bareno in forum World of Warcraft Emulator Servers
    Replies: 10
    Last Post: 09-30-2007, 03:37 PM
All times are GMT -5. The time now is 05:35 AM. Powered by vBulletin® Version 4.2.3
Copyright © 2024 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search