EnumVisibleObjects - Is ClntObjMgrPtr no longer in use? What to do with the callback menu

User Tag List

Results 1 to 7 of 7
  1. #1
    GlittPrizes's Avatar Active Member CoreCoins Purchaser Authenticator enabled
    Reputation
    58
    Join Date
    Nov 2019
    Posts
    104
    Thanks G/R
    53/33
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    EnumVisibleObjects - Is ClntObjMgrPtr no longer in use? What to do with the callback

    My diffing isn't really working because it renames the wrong functions, so I'm trying to track down a few things manually. There are like 3 functions that are nearly the same, and I suspect that one of them is EnumVisibleObjects. My understanding is that EVO takes a callback as a parameter and calls it according to a filter. I'm not sure what to do with this callback to retrieve the entities.

    This is what I'm guessing is EnumVisibleObjects (Retail)
    Code:
    __int64 __fastcall enumVisibleObj_140FAD5F0(unsigned int (__fastcall *callback)(__int64, __int64), __int64 filter)
    {
      __int64 objFilter; // rdi
      unsigned int (__fastcall *fCallback)(__int64, __int64); // rsi
      _QWORD *entity; // rbx
      __int64 objProperty???; // rcx
    
      objFilter = filter;
      fCallback = callback;
      entity = *(_QWORD **)(sCurMgr_1429DFEF0 + 0x120);
      if ( entity == (_QWORD *)(sCurMgr_1429DFEF0 + 0x120) )
        return 1i64;
      while ( 1 )
      {
        objProperty??? = (__int64)(entity + 5);    // is this the object guid?
        entity = (_QWORD *)*entity;
        if ( !fCallback(objProperty???, objFilter) )
          break;
        if ( entity == (_QWORD *)(sCurMgr_1429DFEF0 + 0x120) )
          return 1i64;
      }
      return 0i64;
    }
    I'm not sure what I'm supposed to be doing in the callback function. Any hint in the right direction would be greatly appreciated. It seems in previous builds, the callback would call ClntObjMgrPtr to get a pointer to the entity, but I'm confused because the behavior seems a bit different now.

    edit: I think I'm overcomplicating this. I setup a basic callback to show a messagebox for the objectProperty??? and it has like 100 valid things it shows. Not sure what I'm looking at though (entity + 5)

    edit edit: I found a nice candidate for ClntObjMgrPtr but I need a plugin to decompile since it's a big function. I'm now trying to find 'ByGUID' functions to test stuff out.
    Last edited by GlittPrizes; 06-29-2020 at 11:15 PM. Reason: update

    EnumVisibleObjects - Is ClntObjMgrPtr no longer in use? What to do with the callback
  2. #2
    SailorMars's Avatar Member
    Reputation
    7
    Join Date
    Oct 2015
    Posts
    49
    Thanks G/R
    0/6
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    a good description posted by "counted" (8.2.5.31960)

    Note that your line

    Code:
    objProperty??? = (__int64)(entity + 5);    // is this the object guid?
    the "+5" is probably wrong. For some unknown reason, my decompiler gives me a wrong offset "-3", too. The assembly line is like this

    Code:
    lea     rcx, [rbx-18h]
    and the offset should be -0x18.

  3. Thanks GlittPrizes (1 members gave Thanks to SailorMars for this useful post)
  4. #3
    GlittPrizes's Avatar Active Member CoreCoins Purchaser Authenticator enabled
    Reputation
    58
    Join Date
    Nov 2019
    Posts
    104
    Thanks G/R
    53/33
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by SailorMars View Post
    a good description posted by "counted" (8.2.5.31960)

    Note that your line

    Code:
    objProperty??? = (__int64)(entity + 5);    // is this the object guid?
    the "+5" is probably wrong. For some unknown reason, my decompiler gives me a wrong offset "-3", too. The assembly line is like this

    Code:
    lea     rcx, [rbx-18h]
    and the offset should be -0x18.
    That makes sense the + 5 was throwing me off. After looking through counted's post I'm getting a better grasp of the object manager. So the - 0x18 should be a pointer to the next object? This pointer gets sent to the callback where I can dereference it and cast it to the WoWObject struct. From there I can use the guid to call ByGUID functions. That is my plan I'm just away from the PC at the moment, so I'll try to put a test together later.

  5. #4
    GlittPrizes's Avatar Active Member CoreCoins Purchaser Authenticator enabled
    Reputation
    58
    Join Date
    Nov 2019
    Posts
    104
    Thanks G/R
    53/33
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm only getting objects (0) and no other types. The WoWObject struct seems to be aligned by checking with offsetof.

    Main.cpp
    Code:
    uint64_t EnumObjectsCallback(int64_t objectPtr, int64_t filter)
    {
    	if (objectPtr)
    	{
    		auto* object = reinterpret_cast<WoWObject*>(objectPtr);
                    // switch object->Type
    		return 1;
    	}
    	return 0;
    }
    
    void EnumObjects()
    {
    	GameMethods::EnumVisible(EnumObjectsCallback, 0);
    }
    WoWObject.h
    Code:
    enum TypeId
    {
        OBJECT                      = 0,
        ITEM                        = 1,
        CONTAINER                   = 2,
        AZERITE_EMPOWERED_ITEM      = 3,
        AZERITE_ITEM                = 4,
        UNIT                        = 5,
        PLAYER                      = 6,
        ACTIVE_PLAYER               = 7,
        GAME_OBJECT                 = 8,
        DYNAMIC_OBJECT              = 9,
        CORPSE                      = 10,
        AREA_TRIGGER                = 11,
        SCENE_OBJECT                = 12,
        CONVERSATION                = 13
    };
    
    struct Guid
    {
        unsigned long High;
        unsigned long Low;
    };
    
    #pragma  pack(1)
    struct WoWObject
    {
        int64_t VTable;     // 0x0
        char Pad1[2];       //
        TypeId Type;        // 0x10
        char Pad2[4];       //
        int64_t NextObj;    // 0x18
        char Pad3[14];      //
        Guid Guid;          // 0x40
    };
    GameMethods.cpp
    Code:
    typedef uint64_t (__fastcall* EnumVisibleCb)(int64_t, int64_t);
    
    int64_t GameMethods::EnumVisible(EnumVisibleCb callback, int64_t filter)
    {
    	return reinterpret_cast<int64_t(__fastcall*)(EnumVisibleCb, int64_t)>(Offsets::Base + Offsets::EnumVisibleObjects)(callback, filter);
    }
    Last edited by GlittPrizes; 07-01-2020 at 02:33 AM. Reason: most recent attempt

  6. #5
    ejt's Avatar Contributor
    Reputation
    209
    Join Date
    Mar 2008
    Posts
    166
    Thanks G/R
    3/111
    Trade Feedback
    0 (0%)
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by SailorMars View Post
    a good description posted by "counted" (8.2.5.31960)

    Note that your line

    Code:
    objProperty??? = (__int64)(entity + 5);    // is this the object guid?
    the "+5" is probably wrong. For some unknown reason, my decompiler gives me a wrong offset "-3", too. The assembly line is like this

    Code:
    lea     rcx, [rbx-18h]
    and the offset should be -0x18.
    In C when you increase a pointer it increases by num * size of pointer so

    +5 becomes 5 * 0x8 in this case because wow is 64-bit
    and -3 becomes -3 * 0x8 which is equal -0x18.

    For clarity about "pointer size", a 32-bit program would multiply by 0x4 because the pointer sizes in a 32-bit program is... 32-bit so 0x4. Respectively 0x8 in 64-bit programs because, 64-bit integers.

    If it is prefixed with a * (dereference) it instead increases the value that the pointer is pointing to which you seem to confuse it with.

  7. Thanks GlittPrizes (1 members gave Thanks to ejt for this useful post)
  8. #6
    GlittPrizes's Avatar Active Member CoreCoins Purchaser Authenticator enabled
    Reputation
    58
    Join Date
    Nov 2019
    Posts
    104
    Thanks G/R
    53/33
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I think I have it working after reading type at obj + 0x16 and making sure the Type enum is uint8_t. I say I think so because when testing on two different characters, it only found one ACTIVE_PLAYER each as well as a variety of other object types. I suppose I could confirm it through the active player guid, but I'm pretty sure I have it setup now which is awesome for me I never thought I'd see the day

    edit: I was confusing 0x16 with +16, so it is still 0x10 and the GUID appears to also be 0x40 in latest patch.
    Last edited by GlittPrizes; 07-06-2020 at 11:04 AM. Reason: hex to decimal confusion

  9. #7
    34D's Avatar Member
    Reputation
    4
    Join Date
    May 2020
    Posts
    57
    Thanks G/R
    10/3
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    There are 3 functions.
    EnumVisibleObjects should be + 0x120 and +5(+0x40) callback OBJECT
    EnumVisibleObjectsPtr should be + 0x120 and -3(-0x18) callback objectPTR
    EnumVisibleUnitsPtr should be + 0x130 and -5(-0x40) callback unitPTR

  10. Thanks GlittPrizes (1 members gave Thanks to 34D for this useful post)

Similar Threads

  1. What to do with the 7 SoR accounts i have??
    By 1337jay1337 in forum World of Warcraft General
    Replies: 9
    Last Post: 04-10-2013, 08:14 PM
  2. [Selling] Farming account no longer in use (clean)
    By jimmyd1337 in forum WoW-US Account Buy Sell Trade
    Replies: 0
    Last Post: 10-11-2012, 07:10 AM
  3. Guide to: What to do when the content is clear
    By buahbleah in forum World of Warcraft Guides
    Replies: 11
    Last Post: 03-28-2009, 05:47 AM
  4. what to do with the .raw file? easy rep!
    By C-Death in forum WoW ME Questions and Requests
    Replies: 3
    Last Post: 02-14-2008, 12:53 AM
  5. What to do with the account I got!
    By paniczone in forum World of Warcraft General
    Replies: 17
    Last Post: 11-12-2007, 01:19 AM
All times are GMT -5. The time now is 04:21 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