Confused about reading offsets, for exampe object's type menu

User Tag List

Results 1 to 6 of 6
  1. #1
    Viano's Avatar Active Member
    Reputation
    37
    Join Date
    May 2008
    Posts
    172
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Confused about reading offsets, for exampe object's type

    Hello there,

    Nesox posted the following offsets.

    Code:
    public enum WoWObjectFields
    {
        OBJECT_FIELD_GUID = 0x0,
        OBJECT_FIELD_TYPE = 0x2,
        OBJECT_FIELD_ENTRY = 0x3,
        OBJECT_FIELD_SCALE_X = 0x4,
        OBJECT_FIELD_PADDING = 0x5,
        //TOTAL_OBJECT_FIELDS = 0x5
    }
    So I am trying to read the type of an object as follows.

    Code:
    public uint Type
            {
                get
                {
                    return _magic.Read<uint>((uint)_magic.Read<IntPtr>((uint)_pointer, 0x8) + 0x2 * 4);
                }
            }
    Which should be [[pointer + descriptor] + offset * 4].
    This prints for example 1616046321, so it's clearly bullshit.

    Now in I saw in some open source bot that type's offset is 0x14 and not 0x2 and I tried the following.

    Code:
    public uint Type
            {
                get
                {
                    return _magic.Read<uint>((uint)_pointer + 0x14);
                }
            }
    And this worked!

    So what the heck? Is the offset 0x2 or 0x14 and why don't I have to use the descriptor 0x8?
    And what is the correct and final way of reading Type, X, Y, Z and so on? Using descriptor or not? What am I doing wrong?
    Viano

    Confused about reading offsets, for exampe object's type
  2. #2
    eLaps's Avatar Active Member
    Reputation
    34
    Join Date
    Sep 2007
    Posts
    123
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Viano View Post
    Code:
    (uint)_magic.Read<IntPtr>((uint)_pointer, 0x8)
    Shouldn't this be
    Code:
    (uint)_magic.Read<IntPtr>((uint)_pointer + 0x8)
    ?

  3. #3
    mnbvc's Avatar Banned
    Reputation
    120
    Join Date
    Jul 2009
    Posts
    273
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    the type in the descriptor fields is a mask, i saw a table of the different flags a few days ago, but dunno where it was
    just use the type at 0x14 that are "normal" numbers and much easier to handle :P

  4. #4
    Apoc's Avatar Angry Penguin
    Reputation
    1387
    Join Date
    Jan 2008
    Posts
    2,750
    Thanks G/R
    0/12
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    1) You're initial descriptors table read, is a double read. [[basePtr]+0x8] and not [basePtr+0x8]

    2) The descriptor table "TYPE" field, is a flag. Not a single constant number. The TYPE field lets you tell *all* the types of 'objects' that the object is. The non-descriptor field just tells you the actual type. (Player, GameObject, etc)

  5. #5
    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)
    "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

  6. #6
    Seifer's Avatar Site Donator
    Reputation
    129
    Join Date
    Apr 2007
    Posts
    270
    Thanks G/R
    1/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If you take a look at:

    WowObject.cs - blackrainobjects - Project Hosting on Google Code

    You'll see that Type is defined as follows:
    Code:
    /// <summary>
            /// The object's Type.
            /// </summary>
            public int Type
            {
                get { return ObjectManager.Memory.ReadInt(BaseAddress + 0x14); }
            }
    As Robske nicely pointed out in the above post and the main BlackRain thread. You're free to use BR's source code to fix these sort of problems.

Similar Threads

  1. Replies: 3
    Last Post: 01-31-2015, 02:05 AM
  2. Replies: 6
    Last Post: 11-04-2012, 10:35 PM
  3. Confused About The New Patch Avaliable for download!
    By doriangarza in forum World of Warcraft General
    Replies: 3
    Last Post: 09-17-2010, 05:23 PM
  4. Confused about dealing with game objects
    By b9er in forum WoW Memory Editing
    Replies: 8
    Last Post: 12-31-2008, 01:50 AM
  5. Another Bann wave about to come for Patch 2.0.7! PLEASE READ
    By edestron in forum World of Warcraft General
    Replies: 14
    Last Post: 02-13-2007, 06:35 PM
All times are GMT -5. The time now is 05:09 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