Hook all events menu

Shout-Out

User Tag List

Page 1 of 2 12 LastLast
Results 1 to 15 of 21
  1. #1
    amadmonk's Avatar Active Member
    Reputation
    124
    Join Date
    Apr 2008
    Posts
    772
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Hook all events

    So, I'm wondering if anyone has a clean(er) way to hook all events (specifically framescript events, but I wouldn't complain about glue events either). I did some reversing on this myself a long while ago (like pre 3.0) and it wasn't realistically possible because of the way the event handler worked; there wasn't a single call point that got called with every raw event. Rather it looked like there were a bestiary of event object types which got routed through a half dozen or so functions, and reversing/hooking/maintaining this would be prohibitive.

    Right now, I capture all framescript events natively through a bit of injected Lua that hooks all events and pingpongs them back into the bot code. However, this is fragile and hacky and you need very special case handling for things like ReloadUI() and PLAYER_ENTERING_WORLD.

    Is there a better way? Or am I to be stuck with my hack...
    Don't believe everything you think.

    Hook all events
  2. #2
    Apoc's Avatar Angry Penguin
    Reputation
    1388
    Join Date
    Jan 2008
    Posts
    2,750
    Thanks G/R
    0/13
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What you're doing is the most stable way to deal with it.

    Just keep checking every 'pulse' if your frame is available; if not, recreate it, and re-hook all the events. That's how its done in quite a few bots, and it works without issues. (You may miss an event or two, but usually nothing terribly important.)

    Edit: Stay on topic people. I'm going to start handing out infractions and bans again. It's getting out of hand.

  3. #3
    ddebug's Avatar Contributor
    Reputation
    114
    Join Date
    Sep 2010
    Posts
    117
    Thanks G/R
    0/5
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by amadmonk View Post
    So, I'm wondering if anyone has a clean(er) way to hook all events (specifically framescript events, but I wouldn't complain about glue events either). I did some reversing on this myself a long while ago (like pre 3.0) and it wasn't realistically possible because of the way the event handler worked; there wasn't a single call point that got called with every raw event. Rather it looked like there were a bestiary of event object types which got routed through a half dozen or so functions, and reversing/hooking/maintaining this would be prohibitive.

    Right now, I capture all framescript events natively through a bit of injected Lua that hooks all events and pingpongs them back into the bot code. However, this is fragile and hacky and you need very special case handling for things like ReloadUI() and PLAYER_ENTERING_WORLD.

    Is there a better way? Or am I to be stuck with my hack...
    Why not take a look at FrameScript__SignalEvent? Just detour that function. It is signaled each time an event is handled.

  4. #4
    amadmonk's Avatar Active Member
    Reputation
    124
    Join Date
    Apr 2008
    Posts
    772
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks, I'll take a look at that when I get home (at work now, so no WoW and no IDA). I think I looked at that last time and had the problems I mentioned -- no single point of signaling, all custom event object classes, etc. I'm lazy, so I was hoping it had gotten easier.

    I'll see what I can see.
    Don't believe everything you think.

  5. #5
    ddebug's Avatar Contributor
    Reputation
    114
    Join Date
    Sep 2010
    Posts
    117
    Thanks G/R
    0/5
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by amadmonk View Post
    Thanks, I'll take a look at that when I get home (at work now, so no WoW and no IDA). I think I looked at that last time and had the problems I mentioned -- no single point of signaling, all custom event object classes, etc. I'm lazy, so I was hoping it had gotten easier.

    I'll see what I can see.
    I don't understand. The first parameter of FrameScript__SignalEvent is an integer which corresponds to an enum list of the following events: http://www.wowwiki.com/Events_A-Z_(full_list). You can't really go easier than this. It's perfect.

    e.g.

    Code:
    switch (nEventId) // Retrieved from first parameter of SignalEvent
    {
       case CHAT_MSG_WHISPER:
           // Do something.
           break;
       case PLAYER_ENTERING_WORLD:
           // Do something.
           break;
    }

  6. #6
    amadmonk's Avatar Active Member
    Reputation
    124
    Join Date
    Apr 2008
    Posts
    772
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Apoc View Post
    What you're doing is the most stable way to deal with it.

    Just keep checking every 'pulse' if your frame is available; if not, recreate it, and re-hook all the events. That's how its done in quite a few bots, and it works without issues. (You may miss an event or two, but usually nothing terribly important.)

    Edit: Stay on topic people. I'm going to start handing out infractions and bans again. It's getting out of hand.
    Thanks, Apoc. I was figuring that if there was a better way, I would have seen it. I still think it's hacky, but... it works (aside from last night when it got a little borked during a phase change in a heroic instance and ended up crashing my bot and killing my group. But who's counting? )

    ---------- Post added at 04:14 PM ---------- Previous post was at 04:13 PM ----------

    Originally Posted by ddebug View Post
    I don't understand. The first parameter of FrameScript__SignalEvent is an integer which corresponds to an enum list of the following events: http://www.wowwiki.com/Events_A-Z_(full_list). You can't really go easier than this. It's perfect.

    e.g.

    Code:
    switch (nEventId) // Retrieved from first parameter of SignalEvent
    {
       case CHAT_MSG_WHISPER:
           // Do something.
           break;
       case PLAYER_ENTERING_WORLD:
           // Do something.
           break;
    }
    IIRC, the problem was getting the event params. It's not always as simple as just inspecting the Lua stack (again, IIRC -- it's been almost a year since I last looked at that code path).
    Don't believe everything you think.

  7. #7
    ddebug's Avatar Contributor
    Reputation
    114
    Join Date
    Sep 2010
    Posts
    117
    Thanks G/R
    0/5
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by amadmonk View Post
    IIRC, the problem was getting the event params. It's not always as simple as just inspecting the Lua stack (again, IIRC -- it's been almost a year since I last looked at that code path).
    The 3rd parameter has all the arguments (vargs_list).

    For example, this is what I do for CHAT_MSG_WHISPER:

    Code:
    Program.MainForm.Log(Color.Purple, "Whisper from {0}{1}: {2}", args[5], args[1], args[0]);
    MaiN has a nice article on how to do it from C#: http://www.mmowned.com/forums/world-...guments-c.html

    If you are doing it from C++, it is much easier.
    Last edited by ddebug; 11-09-2010 at 04:21 PM.

  8. #8
    ramey's Avatar Member
    Reputation
    45
    Join Date
    Jan 2008
    Posts
    320
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Latest [WoW] Events changed in v3.3.3

    inb4 everyone criticizes!

  9. #9
    Robske's Avatar Contributor
    Reputation
    305
    Join Date
    May 2007
    Posts
    1,062
    Thanks G/R
    3/4
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by ramey View Post
    Latest [WoW] Events changed in v3.3.3

    inb4 everyone criticizes!
    I'd be happy to.

    std::clog << "WoWLink::CEvents: destructed." << std::endl;
    The term you're looking for is 'deconstructed' or 'destroyed'.

    (Too much of a monkey to critize other things)


    On topic:

    Using the lua frame approach does have alot of advantages. You get (most) frame-, glue- and combat-log events in one go and you do not have to maintain multiple offsets and handlers.
    The down side is that it feels dirty in a way that you are basically taking a 'detour' through lua and you have to make extra arrangements to keep the 'detour' alive.

    I have both available in my projects, but at the moment I use the lua-frame method.
    Last edited by Robske; 11-09-2010 at 05:23 PM.
    "Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live." - Martin Golding
    "I cried a little earlier when I had to poop" - Sku

  10. #10
    amadmonk's Avatar Active Member
    Reputation
    124
    Join Date
    Apr 2008
    Posts
    772
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Robske View Post
    ...and you do not have to maintain multiple offsets and handlers...
    Yeah, that's what I was trying to avoid. Sounds like I need to stick with the "route them all through Lua" method to avoid having to chase down the myriad different event type offsets.

    Thanks, all, for the input.
    Don't believe everything you think.

  11. #11
    ramey's Avatar Member
    Reputation
    45
    Join Date
    Jan 2008
    Posts
    320
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Robske View Post
    I'd be happy to.



    The term you're looking for is 'deconstructed' or 'destroyed'.

    (Too much of a monkey to critize other things)


    On topic:

    Using the lua frame approach does have alot of advantages. You get (most) frame-, glue- and combat-log events in one go and you do not have to maintain multiple offsets and handlers.
    The down side is that it feels dirty in a way that you are basically taking a 'detour' through lua and you have to make extra arrangements to keep the 'detour' alive.

    I have both available in my projects, but at the moment I use the lua-frame method.
    You are a ****.
    x

  12. #12
    Cypher's Avatar Kynox's Sister's Pimp
    Reputation
    1358
    Join Date
    Apr 2006
    Posts
    5,368
    Thanks G/R
    0/6
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Robske View Post
    The term you're looking for is 'deconstructed' or 'destroyed'.
    Actually 'destructed' is an acceptable term (its base obviously being 'destruct', which is a real word). Where do you think the term 'destructor' came from? I dunno what you crazy C# guys call it, but as far as C++ goes, his terminology is correct. When an object's destructor is called, the object is said to be 'destructed'.

    Use of the term in popular reference material:
    [11] Destructors, C++ FAQ

    P.S. Sorry, but I wanted to join in on the nitpicking.

  13. #13
    ramey's Avatar Member
    Reputation
    45
    Join Date
    Jan 2008
    Posts
    320
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Cypher View Post
    Actually 'destructed' is an acceptable term (its base obviously being 'destruct', which is a real word). Where do you think the term 'destructor' came from? I dunno what you crazy C# guys call it, but as far as C++ goes, his terminology is correct. When an object's destructor is called, the object is said to be 'destructed'.

    Use of the term in popular reference material:
    [11] Destructors, C++ FAQ

    P.S. Sorry, but I wanted to join in on the nitpicking.
    I knew I was right but wasn't sure. Did even do define: destruct in google!

  14. #14
    XTZGZoReX's Avatar Active Member
    Reputation
    32
    Join Date
    Apr 2008
    Posts
    173
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Cypher View Post
    Actually 'destructed' is an acceptable term (its base obviously being 'destruct', which is a real word). Where do you think the term 'destructor' came from? I dunno what you crazy C# guys call it, but as far as C++ goes, his terminology is correct. When an object's destructor is called, the object is said to be 'destructed'.

    Use of the term in popular reference material:
    [11] Destructors, C++ FAQ

    P.S. Sorry, but I wanted to join in on the nitpicking.
    In C#, it's also called a destructor (though in the runtime, it's a finalizer). So yeah, his terminology is correct there too.

  15. #15
    MaiN's Avatar Elite User
    Reputation
    335
    Join Date
    Sep 2006
    Posts
    1,047
    Thanks G/R
    0/10
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    FrameScript__SignalEvent calls an argument that takes a va_list as argument (natively, this is just a pointer to the first argument in the stack). Hook that function. The format is passed as well.
    [16:15:41] Cypher: caus the CPU is a dick
    [16:16:07] kynox: CPU is mad
    [16:16:15] Cypher: CPU is all like
    [16:16:16] Cypher: whatever, i do what i want

Page 1 of 2 12 LastLast

Similar Threads

  1. [Code] How to hook wow events!
    By -Ryuk- in forum WoW Memory Editing
    Replies: 10
    Last Post: 10-12-2016, 12:42 AM
  2. Hooking WoW Events without LUA-Handler Proc?
    By berlinermauer in forum WoW Memory Editing
    Replies: 1
    Last Post: 01-03-2014, 08:46 PM
  3. [Scourge Event] Get all your Weapon Skills up! (Ally)
    By gfxluvr in forum World of Warcraft Exploits
    Replies: 37
    Last Post: 11-06-2008, 11:42 PM
  4. Replies: 27
    Last Post: 10-23-2008, 12:21 PM
All times are GMT -5. The time now is 07:59 AM. Powered by vBulletin® Version 4.2.3
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Google Authenticator verification provided by Two-Factor Authentication (Free) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search