[19034 x64] Guids and ClntObjMgrObjectPtr question menu

User Tag List

Page 1 of 2 12 LastLast
Results 1 to 15 of 16
  1. #1
    apollo0510's Avatar Active Member
    Reputation
    18
    Join Date
    Aug 2008
    Posts
    53
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    [19034 x64] Guids and ClntObjMgrObjectPtr question

    Hello there.

    While studying the latest patch, I came across a strange thing:

    ClntObjMgrObjectPtr now wants a pointer to a 16 byte structure.
    The lower uint64 is of course the guid of the object.
    But the upper uint64 is some kind of mask that is used for filtering the results.
    Anyone has some insights yet about the meaning of those bits ?

    Thanks for your help.

    BTW: (no rebase, 0x140000000 ida default)
    ClntObjMgrObjectPtr = 0x1403E9650 if you want to have a look at it.

    [19034 x64] Guids and ClntObjMgrObjectPtr question
  2. #2
    Torpedoes's Avatar ★ Elder ★ Doomsayer
    Authenticator enabled
    Reputation
    1147
    Join Date
    Sep 2013
    Posts
    956
    Thanks G/R
    148/415
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Remember that GUIDs are 128-Bit integers now.

  3. #3
    apollo0510's Avatar Active Member
    Reputation
    18
    Join Date
    Aug 2008
    Posts
    53
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Torpedoes View Post
    Remember that GUIDs are 128-Bit integers now.
    wholy crap. Yes, indeed. *starts refactoring*

    Thank you.

  4. #4
    Flam2's Avatar Member
    Reputation
    1
    Join Date
    Apr 2010
    Posts
    7
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by king48488 View Post
    Code:
    /*
     * Copyright (C) 2012-2014 Arctium Emulation <http://arctium.org>
     *
     * This program is free software: you can redistribute it and/or modify
     * it under the terms of the GNU General Public License as published by
     * the Free Software Foundation, either version 3 of the License, or
     * (at your option) any later version.
     *
     * This program is distributed in the hope that it will be useful,
     * but WITHOUT ANY WARRANTY; without even the implied warranty of
     * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     * GNU General Public License for more details.
     *
     * You should have received a copy of the GNU General Public License
     * along with this program.  If not, see <http://www.gnu.org/licenses/>.
     */
    
    using Framework.Constants.Object;
    using Framework.Objects.WorldEntities;
    
    namespace Framework.Objects
    {
        public class SmartGuid
        {
            public ulong Low { get; set; }
            public ulong High { get; set; }
    
            public SmartGuid() { }
    
            public SmartGuid(IWorldObject obj)
            {
                if ((var player = obj as Player) != null)
                {
                    Type         = GuidType.Player;
                    MapId        = (ushort)player.Data.Map;
                    CreationBits = player.Data.Guid;
                }
            }
    
            public GuidType Type
            {
                get { return (GuidType)(High >> 58); }
                set { High |= (ulong)value << 58; }
            }
    
            public GuidSubType SubType
            {
                get { return (GuidSubType)(Low >> 56); }
                set { Low |= (ulong)value << 56; }
            }
    
            public ushort RealmId
            {
                get { return (ushort)((High >> 42) & 0x1FFF); }
                set { High |= (ulong)value << 42; }
            }
    
            public ushort ServerId
            {
                get { return (ushort)((Low >> 40) & 0x1FFF); }
                set { Low |= (ulong)value << 40; }
            }
    
            public ushort MapId
            {
                get { return (ushort)((High >> 29) & 0x1FFF); }
                set { High |= (ulong)value << 29; }
            }
    
            public uint Id
            {
                get { return (uint)(High & 0xFFFFFF) >> 6; }
                set { High |= (ulong)value << 6; }
            }
    
            public ulong CreationBits
            {
                get { return Low & 0xFFFFFFFFFF; }
                set { Low |= value; }
            }
        }
    }
    Excuse me, but how to use it?

    If I had the following code:

    Code:
            public ulong Guid
            {
                get { return Memory.WoW.Read<ulong>(BaseAddress + (int)Offsets.Object.Guid); }
            }
    then now it should look something like this?
    Code:
            public ulong gLow
            {
                get { return Memory.WoW.Read<ulong>(BaseAddress + (int)Offsets.Object.Guid); }
            }
            public ulong gHigh 
            {
                get { return Memory.WoW.Read<ulong>(BaseAddress + (int)Offsets.Object.Guid) + 64; }
            }
    
      SmartGuid Guid = new SmartGuid ();
      Guid.Low  = gLow;
      Guid.High = gHigh ;
    
      Interact(Guid.id);

  5. #5
    -Ryuk-'s Avatar Elite User CoreCoins Purchaser Authenticator enabled
    Reputation
    529
    Join Date
    Nov 2009
    Posts
    1,028
    Thanks G/R
    38/51
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Flam2 View Post
    Excuse me, but how to use it?

    If I had the following code:

    Code:
            public ulong Guid
            {
                get { return Memory.WoW.Read<ulong>(BaseAddress + (int)Offsets.Object.Guid); }
            }
    then now it should look something like this?
    Code:
            public ulong gLow
            {
                get { return Memory.WoW.Read<ulong>(BaseAddress + (int)Offsets.Object.Guid); }
            }
            public ulong gHigh 
            {
                get { return Memory.WoW.Read<ulong>(BaseAddress + (int)Offsets.Object.Guid) + 64; }
            }
    
      SmartGuid Guid = new SmartGuid ();
      Guid.Low  = gLow;
      Guid.High = gHigh ;
    
      Interact(Guid.id);
    Code:
    public SmartGuid GUID()
    {
    ulong low = Memory.WoW.Read<ulong>(BaseAddress + (int)Offsets.Object.Guid);
    ulong high= Memory.WoW.Read<ulong>(BaseAddress + (int)Offsets.Object.Guid + 0x8);
    
    return new SmartGuid(low, high)
    }
    
    Interact(GUID)
    |Leacher:11/2009|Donor:02/2010|Established Member:09/2010|Contributor:09/2010|Elite:08/2013|

  6. #6
    Torpedoes's Avatar ★ Elder ★ Doomsayer
    Authenticator enabled
    Reputation
    1147
    Join Date
    Sep 2013
    Posts
    956
    Thanks G/R
    148/415
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by -Ryuk- View Post
    Code:
    public SmartGuid GUID()
    {
    ulong low = Memory.WoW.Read<ulong>(BaseAddress + (int)Offsets.Object.Guid);
    ulong high= Memory.WoW.Read<ulong>(BaseAddress + (int)Offsets.Object.Guid + 0x8);
    
    return new SmartGuid(low, high)
    }
    
    Interact(GUID)
    Two reads, that's expensive if you're not caching. I'm no C# expert but isn't there a way to just read 16 bytes and store it directly on a SmartGuid?

  7. #7
    -Ryuk-'s Avatar Elite User CoreCoins Purchaser Authenticator enabled
    Reputation
    529
    Join Date
    Nov 2009
    Posts
    1,028
    Thanks G/R
    38/51
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Torpedoes View Post
    Two reads, that's expensive if you're not caching. I'm no C# expert but isn't there a way to just read 16 bytes and store it directly on a SmartGuid?
    Not with the SmartGuid code he is using...

    For one read just use uint128
    |Leacher:11/2009|Donor:02/2010|Established Member:09/2010|Contributor:09/2010|Elite:08/2013|

  8. #8
    Flam2's Avatar Member
    Reputation
    1
    Join Date
    Apr 2010
    Posts
    7
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Now I have this code, but get incorrect values​​, where I made ​​a mistake?

    Code:
     public class WoWGuid
        {
            public ulong Low { get; set; }
            public ulong High { get; set; }
    
            public WoWGuid() { }
    
            public WoWGuid(ulong lowGuid, ulong highGuid)
            {
                Low = lowGuid ;
                High = highGuid  ;
            }
    
            public WoWGuidType Type
            {
                get { return (WoWGuidType)(High >> 58); }
                set { High |= (ulong)value << 58; }
            }
    
            public GuidSubType SubType
            {
                get { return (GuidSubType)(Low >> 56); }
                set { Low |= (ulong)value << 56; }
            }
    
            public ushort RealmId
            {
                get { return (ushort)((High >> 42) & 0x1FFF); }
                set { High |= (ulong)value << 42; }
            }
    
            public ushort ServerId
            {
                get { return (ushort)((Low >> 40) & 0x1FFF); }
                set { Low |= (ulong)value << 40; }
            }
    
            public ushort MapId
            {
                get { return (ushort)((High >> 29) & 0x1FFF); }
                set { High |= (ulong)value << 29; }
            }
    
            public uint Id
            {
                get { return (uint)(High & 0xFFFFFF) >> 6; }
                set { High |= (ulong)value << 6; }
            }
    
            public ulong CreationBits
            {
                get { return Low & 0xFFFFFFFFFF; }
                set { Low |= value; }
            }
        }
    Code:
            public WoWGuid GUID()
            {
                ulong high = Memory.WoW.Read<ulong>(BaseAddress + (int)Offsets.ObjectFields.Guid);
                ulong low = Memory.WoW.Read<ulong>(BaseAddress + (int)Offsets.ObjectFields.Guid + 0x8);
    
                return new WoWGuid(low, high);
            }
    Code:
        public enum ObjectFields
        {
            Guid = 0x0,
        };

  9. #9
    hamburger12's Avatar Contributor CoreCoins Purchaser
    Reputation
    87
    Join Date
    Jan 2010
    Posts
    297
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Here:

    public enum ObjectFields
    {
    Guid = 0x0, = > 0x28
    };

  10. #10
    gdfsxwy's Avatar Active Member
    Reputation
    15
    Join Date
    Apr 2010
    Posts
    26
    Thanks G/R
    16/8
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    public ushort ServerId
    {
    get { return (ushort)((Low >> 40) & 0xFFFF); }
    set { Low |= (ulong)value << 40; }
    }

  11. #11
    Flam2's Avatar Member
    Reputation
    1
    Join Date
    Apr 2010
    Posts
    7
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank you all! Now I got a good guid! By the way, another my mistake - changed the high offset and low offset positions.

  12. #12
    TOM_RUS's Avatar Legendary
    Reputation
    914
    Join Date
    May 2008
    Posts
    699
    Thanks G/R
    0/52
    Trade Feedback
    0 (0%)
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by gdfsxwy View Post
    public ushort ServerId
    {
    get { return (ushort)((Low >> 40) & 0xFFFF); }
    set { Low |= (ulong)value << 40; }
    }
    Pretty sure mask is 0x1FFF.

  13. #13
    fvicaria's Avatar Active Member
    Reputation
    29
    Join Date
    Jan 2009
    Posts
    55
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Torpedoes View Post
    Two reads, that's expensive if you're not caching. I'm no C# expert but isn't there a way to just read 16 bytes and store it directly on a SmartGuid?
    Still one read.
    Code:
    Memory.Read<WoWGuid>(IntPtr.Add(BaseAddress, 0x28));

  14. #14
    evil2's Avatar Active Member
    Reputation
    27
    Join Date
    Feb 2009
    Posts
    164
    Thanks G/R
    25/9
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by fvicaria View Post
    Still one read.
    Code:
    Memory.Read<WoWGuid>(IntPtr.Add(BaseAddress, 0x28));
    one line of code does not necessarily imply one memory read ^^

    go for ReadBytes -> direct into your GUID struct

  15. #15
    fvicaria's Avatar Active Member
    Reputation
    29
    Join Date
    Jan 2009
    Posts
    55
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Never said the implementation was one line. But it does read all 16 bytes at once from the process memory (Kernel32::ReadProcessMemory)
    Not sure what you are trying to say...

Page 1 of 2 12 LastLast

Similar Threads

  1. programming, hacks, and bot questions, answered!
    By WoWLegend in forum World of Warcraft General
    Replies: 38
    Last Post: 03-06-2007, 01:41 PM
  2. WoW Gold guide and RL if u want:)
    By Nolixz in forum World of Warcraft Guides
    Replies: 23
    Last Post: 12-18-2006, 10:24 PM
  3. A request and 2 questions
    By Osmose in forum WoW ME Questions and Requests
    Replies: 3
    Last Post: 10-14-2006, 12:10 PM
  4. 1-60 in 3 Weeks (The guide and method the WoW Power Levelers use)
    By Matt in forum World of Warcraft Guides
    Replies: 3
    Last Post: 08-15-2006, 04:20 PM
All times are GMT -5. The time now is 02:59 PM. 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