1.12 Question on how to find an address given two having already been found menu

User Tag List

Results 1 to 4 of 4
  1. #1
    krycess's Avatar Active Member

    Reputation
    28
    Join Date
    Jul 2009
    Posts
    36
    Thanks G/R
    6/6
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    1.12 Question on how to find an address given two having already been found

    so I have these two addresses
    Code:
    internal static IntPtr GetCreatureRank = (IntPtr) 0x00605620;
                internal static IntPtr GetCreatureType = (IntPtr) 0x00605570;
    and I have been trying unsuccessfully to find the CreatureFamily address (to determine what family a player's pet belongs to and yes I know I can do this with Lua)

    I am using the 'creature_template' cmangos database structure as reference.

    I subtract the Type address from the Rank address and I am left with 0xB0 (176). I figured that there were 12 columns between these so I divided the 0xB0 by 12 and got 0xE (14). I then figured that I just needed multiply this by 13 (because the key that I am trying to get the address to is just 1 column above Type) and I got 0xB6 (182).

    this brought me to the conclusion that each key is about 6 bytes and that the address I was looking for was
    Code:
    0x0060556A
    which is totally wrong as you definitely already know.

    I tried coming up with different ways to calculate this and even tried just counting the bytes and I keep getting it wrong.

    I figured out the itemcachepointer stuff and that was simple because I just had to use offsets but I can't use offsets for this because it does not appear that I am directly accessing a creaturecache (I found a snippet in the dump thread but I kept getting the wrong values with it... maybe I was doing it wrong but it didn't really fit with the delegate scheme anyway)

    I'm really trying to just dive right in but I'm probably overlooking something simple and fundamental that I just never acquired knowledge of.



    Could someone please explain to me how/why my thinking is wrong and how I should be thinking about this problem so that I can solve it?

    thanks in advance

    1.12 Question on how to find an address given two having already been found
  2. #2
    reapler's Avatar Member
    Reputation
    7
    Join Date
    Jul 2014
    Posts
    6
    Thanks G/R
    2/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    it looks like the function is at 6055E0 on 1.12.1 (it is called by the lua function and string is returned from db), you could also access the struct by reading if you got the cache offset, on 3.3.5a i do it like this:
    Code:
                    var creatureCachePtr = MemoryManager.Read<IntPtr>(UnitBaseAddress + 0x964);
                    var creatureCache = MemoryManager.Read<CreatureCache>(creatureCachePtr);
                    Logging.Write(creatureCache.Family);
    The struct:
    Code:
        //3.3.5a 12340
        [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
        public struct CreatureCache
        {
            public int Id;
            public IntPtr SubNamePtr;
            public IntPtr IconNamePtr;
            public int TypeFlags;
            public int Type;
            public int Family;
            public int Rank;
            [MarshalAs(UnmanagedType.ByValArray, SizeConst = 2, ArraySubType = UnmanagedType.I4)]
            public int[] KillCredit;
            [MarshalAs(UnmanagedType.ByValArray, SizeConst = 4, ArraySubType = UnmanagedType.I4)]
            public int[] DisplayId;
            public float HpModifier;
            public float MpModifier;
            [MarshalAs(UnmanagedType.ByValArray, SizeConst = 4, ArraySubType = UnmanagedType.I1)]
            public char[] RacialLeader;
            [MarshalAs(UnmanagedType.ByValArray, SizeConst = 6, ArraySubType = UnmanagedType.I4)]
            public int[] QuestItem;
            public int MovementId;
            [MarshalAs(UnmanagedType.ByValArray, SizeConst = 4, ArraySubType = UnmanagedType.LPStr)]
            public string[] Name;
        };
    You also need to change the struct for 1.12.1, shouldn't be too hard
    Last edited by reapler; 12-06-2018 at 02:50 AM.

  3. Thanks krycess (1 members gave Thanks to reapler for this useful post)
  4. #3
    krycess's Avatar Active Member

    Reputation
    28
    Join Date
    Jul 2009
    Posts
    36
    Thanks G/R
    6/6
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    oh my goodness. thank you for your response. I feel like I got spoonfed though. I’m not understanding why I can access the itemcache directly without an objectbase address (why I must use the base address for a unit and not an item) and I am also not understanding why the pointer used by the Lua function is what it is.

    why is the family pointer so much closer to rank than type? does this have nothing to do with ‘creature_template’?

  5. #4
    reapler's Avatar Member
    Reputation
    7
    Join Date
    Jul 2014
    Posts
    6
    Thanks G/R
    2/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by krycess View Post
    I’m not understanding why I can access the itemcache directly without an objectbase address (why I must use the base address for a unit and not an item)
    The data is actually at the wdb folder, i guess wow just load it and assign the creaturecache pointer to the unit struct, but dunno about items.


    Originally Posted by krycess View Post
    why is the family pointer so much closer to rank than type? does this have nothing to do with ‘creature_template’?
    Yep, it has nothing to do with creature_template, it is just a database table to hold the templates.

Similar Threads

  1. [Question] How to find an Objectmanager
    By streppel in forum WoW Memory Editing
    Replies: 1
    Last Post: 05-27-2011, 06:37 PM
  2. Quick question on how to make portals.
    By asskandi in forum World of Warcraft Emulator Servers
    Replies: 3
    Last Post: 04-26-2008, 10:53 AM
  3. I need guide on how to be an gm
    By Xeliber in forum World of Warcraft Emulator Servers
    Replies: 6
    Last Post: 03-30-2008, 11:04 PM
  4. [Question] On how to extract file from DB
    By Ellenor in forum World of Warcraft Emulator Servers
    Replies: 3
    Last Post: 02-15-2008, 06:48 PM
  5. Question on where to find item textures:
    By blaxmith in forum WoW ME Questions and Requests
    Replies: 2
    Last Post: 08-28-2007, 09:21 PM
All times are GMT -5. The time now is 01:23 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