What function determines what the mouse icon should be? (trying 2 find interact dist) menu

User Tag List

Results 1 to 12 of 12
  1. #1
    Tanaris4's Avatar Contributor Authenticator enabled
    Reputation
    148
    Join Date
    Oct 2008
    Posts
    646
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    What function determines what the mouse icon should be? (trying 2 find interact dist)

    All-

    I've been poking around in the OS X 5.0.1 binary mainly to find a function that would relate to updating the mouse icon (as the game updates it if you are close enough to interact with a game object, and I'm trying to determine that distance).

    I've noticed there is a AutoMouseOverProc function (windows 16357: 5941A0, rebased) but can't actually get to a "update mouse icon" function.

    Anyone have any ideas where I should look next? Searching for combinations of function names with mouse and icon is kind of failing me.

    ~ Tanaris
    https://tanaris4.com

    What function determines what the mouse icon should be? (trying 2 find interact dist)
  2. #2
    Jadd's Avatar 🐸 Premium Seller
    Reputation
    1515
    Join Date
    May 2008
    Posts
    2,433
    Thanks G/R
    81/336
    Trade Feedback
    1 (100%)
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    CGWorldFrame::CursorTrackUnit seems to check which graphic it should use, and CursorSetMode and CursorSetFile seem to set the actual graphic.

    Hope this helps!

  3. #3
    ~Unknown~'s Avatar Contributor
    Reputation
    193
    Join Date
    Jan 2009
    Posts
    211
    Thanks G/R
    0/5
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I asked this question awhile back in this thread here: http://www.ownedcore.com/forums/worl...-distance.html (Game object interact distance)

    I'm not sure if it is any help to you or not. I didn't actually end up with the answer I was looking for either. Let me know if you could if you do end up finding it.

  4. #4
    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)
    Units...
    Code:
            public override float InteractRange        {
                get
                {
                    // TODO: Figure out correct IsWithinInteractRange in WoW
    
    
                    if (Entry == 13158) // Lieutenant Sanders - he's hanging from a tree and it bugs O.o
                        return 5f;
                    // Agatha - undead 'talk to me to start doing anything' NPC. YOu need to talk to her to 'stand up' from being dead when you first start.
                    // She's just out of normal range for us.
                    if (Entry == 49044)
                        return 6f;
    
    
                    return CombatReach + 2.0f;
                }
            }
    GO's
    Code:
            public override float InteractRange
            {
                get
                {
    
    
                    return SubObj != null ? SubObj.InteractDistance - 0.25f : 4f;
                }
            }
    InteractDistance is just SubObj+0xC

  5. #5
    Tanaris4's Avatar Contributor Authenticator enabled
    Reputation
    148
    Join Date
    Oct 2008
    Posts
    646
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    So I actually tried that (JuJu told me about it) but it wasn't working for a crystal that literally has an interact distance of 30 (it's in the starting draenei area). Calling the function to get the distance worked fine, and of course OOP it would be near impossible as it gets a bunch of information on the CM2Models before calculating it.
    https://tanaris4.com

  6. #6
    zys924's Avatar Active Member
    Reputation
    20
    Join Date
    Nov 2009
    Posts
    113
    Thanks G/R
    0/7
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Apoc View Post
    Units...
    Code:
            public override float InteractRange        {
                get
                {
                    // TODO: Figure out correct IsWithinInteractRange in WoW
    
    
                    if (Entry == 13158) // Lieutenant Sanders - he's hanging from a tree and it bugs O.o
                        return 5f;
                    // Agatha - undead 'talk to me to start doing anything' NPC. YOu need to talk to her to 'stand up' from being dead when you first start.
                    // She's just out of normal range for us.
                    if (Entry == 49044)
                        return 6f;
    
    
                    return CombatReach + 2.0f;
                }
            }
    GO's
    Code:
            public override float InteractRange
            {
                get
                {
    
    
                    return SubObj != null ? SubObj.InteractDistance - 0.25f : 4f;
                }
            }
    InteractDistance is just SubObj+0xC
    Mind if telling me what exactly is a "Sub Obj"? I know it has sth to do with bobber like stuffs.

  7. #7
    ~Unknown~'s Avatar Contributor
    Reputation
    193
    Join Date
    Jan 2009
    Posts
    211
    Thanks G/R
    0/5
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Apoc View Post
    Units...
    Code:
            public override float InteractRange        {
                get
                {
                    // TODO: Figure out correct IsWithinInteractRange in WoW
    
    
                    if (Entry == 13158) // Lieutenant Sanders - he's hanging from a tree and it bugs O.o
                        return 5f;
                    // Agatha - undead 'talk to me to start doing anything' NPC. YOu need to talk to her to 'stand up' from being dead when you first start.
                    // She's just out of normal range for us.
                    if (Entry == 49044)
                        return 6f;
    
    
                    return CombatReach + 2.0f;
                }
            }
    GO's
    Code:
            public override float InteractRange
            {
                get
                {
    
    
                    return SubObj != null ? SubObj.InteractDistance - 0.25f : 4f;
                }
            }
    InteractDistance is just SubObj+0xC

    Hmm, I looked at this function in disassembly and it makes sense sort of. I'm wondering if the accuracy is off for some objects or its a different interact range. For example, this function gives 5 yards as range for mailboxes, but I can easily stand at 5.5 and open it. perhaps I'm misunderstanding the function or screwed up somewhere

  8. #8
    JuJuBoSc's Avatar Banned for scamming CoreCoins Purchaser
    Reputation
    1019
    Join Date
    May 2007
    Posts
    922
    Thanks G/R
    1/3
    Trade Feedback
    1 (100%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by ~Unknown~ View Post
    Hmm, I looked at this function in disassembly and it makes sense sort of. I'm wondering if the accuracy is off for some objects or its a different interact range. For example, this function gives 5 yards as range for mailboxes, but I can easily stand at 5.5 and open it. perhaps I'm misunderstanding the function or screwed up somewhere
    0044B2E0 CGGameObject_C_SubObj__CheckRange

    This is what you are looking for, but require some work to get it working on by memory reading.

  9. #9
    Tanaris4's Avatar Contributor Authenticator enabled
    Reputation
    148
    Join Date
    Oct 2008
    Posts
    646
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Sorry for bumping an old thread, but how do I actually determine a SubObj? Once I have a GameObject, I'm not sure how to find it's sub objects.

    Poking around in the mac binary as well as cheat engine and not getting very far.

    Thanks in advance!

    Edit: I believe it's [baseaddress + 0x1B4] based on what i found in cheat engine.. curious if anyone can tell me something more solid (function reference?)
    Last edited by Tanaris4; 06-26-2013 at 08:54 PM.
    https://tanaris4.com

  10. #10
    Empted's Avatar Contributor
    Reputation
    83
    Join Date
    Aug 2011
    Posts
    117
    Thanks G/R
    0/5
    Trade Feedback
    2 (100%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You can try to search for VMT in the object's dump. Try scanning for pointer that points to the same place for all other objects of this type and also there are function pointers with narrow range. I'm sure this method will find you all sub objects. Once you found them all, it won't be hard to guess which one is needed.

    P.S. check object's [VMT+0x94] function, almost sure it returns interact distance (from Script_CheckInteractDistance), can't check though, since servers are down. Will update later.
    Last edited by Empted; 06-26-2013 at 11:34 PM.

  11. #11
    Tanaris4's Avatar Contributor Authenticator enabled
    Reputation
    148
    Join Date
    Oct 2008
    Posts
    646
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    So don't judge me on this one, but how do I dump a list of an object's VMT functions? I've never had a need for it before :/

    Looks like i'm trying to find either CGGameObject_C::GetInteractDistanceSquared or CGGameObject_C_TypeBase::GetInteractDistance

    Edit: Those functions are just what Apoc posted, shux. The issue i'm running into is that yes, the interact distance is in those functions + his example, but sometimes you can't get that close to the object. So then you also need to know the maximum range. For example: http://www.wowhead.com/object=181433

    Looks like I need to reverse that CheckRange function /tear
    Last edited by Tanaris4; 06-27-2013 at 08:19 AM.
    https://tanaris4.com

  12. #12
    Empted's Avatar Contributor
    Reputation
    83
    Join Date
    Aug 2011
    Posts
    117
    Thanks G/R
    0/5
    Trade Feedback
    2 (100%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    So what I've got:
    To dump VMT functions you read VMT pointer (first 4 bytes of the object) and read [VMT+i*4] in cycle. I've wrote some simple snippet to get all sub objects:
    PHP Code:
                Dictionary<uintintsubObjs= new Dictionary<uintint>();
                
    int wowTextEnd = (int)ai.wow.MainModule.BaseAddress 0x8a0000// .text section size
                
    int wowTextStart = (int)ai.wow.MainModule.BaseAddress 0x1000;
                foreach (
    KeyValuePair<ulongGameObjectpair in ObjectManager.GameObjectList)
                {
                    for (
    uint i 0166i++) // 166*4 bytes is approximate game object size, got it by substracting base addresses of adjacent objects
                    
    {
                        try
                        {
                            
    uint VMT ai.wow.ReadUInt(ai.wow.ReadUInt(pair.Value.BaseAddress 4)); // read [base+offset] to get object address, then [object] to get VMT
                            
    int pointer1 ai.wow.ReadInt(VMT); //read two function (probably) pointers
                            
    int pointer2 ai.wow.ReadInt(VMT 0x4);
                            if (
    pointer1 wowTextStart || pointer1 wowTextEnd) continue; //they must be in the .text segment
                            
    if (pointer2 wowTextStart || pointer2 wowTextEnd) continue;
                            
    uint objectOffseti;
                            if (
    subObjs.ContainsKey(objectOffset))
                                
    subObjs[objectOffset]++;
                            else
                                
    subObjs.Add(objectOffset1);
                        }
                        catch
                        {
                            continue; 
    //get rid of read fail exceptions
                        
    }
                    }
                } 
    Scanned many game objects and got some pointers to sub objects (for sure) at: [base+8] [base+32] [base+52] [base+192] [base+220] [base+436]
    So you were right, sub object with interact distance is at [base+0x1B4] (0x1b4=436) . Made a break point at (sub+0xC), got function that returns 0 if player cannot interact with object, 1 otherwise. Also it's accurate (checked ingame).
    Also, it's [VMT+8*4] (sub object's VMT). I think it's just the same function JuJuBoSc told about. Going to try reversing it by myself, but a bit later, will update if i'll succeed.
    Last edited by Empted; 06-27-2013 at 02:17 PM.

Similar Threads

  1. What happend to the rank icons?
    By ramble in forum Report Bugs
    Replies: 6
    Last Post: 12-29-2010, 06:09 AM
  2. Whats the point?
    By Warto in forum Community Chat
    Replies: 10
    Last Post: 10-21-2006, 08:09 PM
  3. what the..
    By WarriorPwner in forum World of Warcraft General
    Replies: 3
    Last Post: 10-16-2006, 09:15 AM
  4. whats the chance you get banned
    By pandapindakaas in forum World of Warcraft General
    Replies: 2
    Last Post: 09-04-2006, 12:56 PM
  5. what the.....
    By Relz in forum Community Chat
    Replies: 4
    Last Post: 06-15-2006, 06:47 PM
All times are GMT -5. The time now is 03:29 PM. 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