Results 1 to 3 of 3
  1. #1
    Member
    Reputation
    1
    Join Date
    Mar 2011
    Posts
    2
    CoreCoins
    0

    Trade Feedbacks

    Status
    n/a
    Positive
    0 (0%)
    Negative
    0 (0%)

    Extracting guild names



    Donate to Remove Ads, Get ShoutBawx - Elite Forum Access
    I've recently been playing with WoW reverse engineering, but I'm still a bit of a noob, so bear with me. I just thought I'd share my findings since I've been using other people's work and it's always good to give back. If this is the wrong place for this, feel free to flame me appropriately.

    I'm using the BlackrainObjects fork from WRadar, but unfortunately it doesn't allow you to get guild names for players. Looking at the code for getting player names it seems that WoW uses a generic hash map thingie (STL? I'm no C++ coder) with truncated GUIDs as keys. I found the offsets for the guild name cache in this post by TOM_RUS:

    http://www.mmowned.com/forums/world-...ml#post2072895

    I first wrote some code to dump all guild strings by iterating over all the objects in all the bins in the hashmap and scanning for alphanumeric characters in the linked data. I found that the strings are located at 0x28.

    I then tried to cross-reference the guids from the guild map with the player objects, and found that storage field 0x5 holds the guild name guid.

    I wrote a quick helper class to get strings from cache objects. It can also be used to get other strings such as pet names and whatnot, but I've just put in the name and guild name caches for now.

    #2074076 - Pastie

    You'll need to modify Offsets.cs and add the offsets for the guild cache:

    /// <summary>
    /// Memory locations specific to the WowPlayer type.
    /// </summary>
    public enum WowPlayer : uint
    {
    NameStore = 0x8DD9A8 + 0x8,
    NameMask = 0x024,
    NameBase = 0x01c,
    NameString = 0x020,

    GuildNameStore = 0x8DDA38 + 0x8,
    GuildNameMask = 0x024,
    GuildNameBase = 0x01c,
    GuildNameString = 40
    }
    The Name and Guild properties of the WowPlayer class can now simply read

    /// <summary>
    /// The name of the player.
    /// </summary>
    public override string Name
    {
    get
    {
    return StringStore.NameStore.getString((uint)GUID);
    }
    }

    public string Guild
    {
    get
    {
    return StringStore.GuildNameStore.getString(GetStorageField<uint>((uint)5));
    }
    }

  2. #2
    Site Donator

    CoreCoins User

    xalcon's Avatar
    Reputation
    64
    Join Date
    Oct 2008
    Location
    Germany
    Posts
    205
    CoreCoins
    3039

    Trade Feedbacks

    Status
    n/a
    Positive
    0 (0%)
    Negative
    0 (0%)
    Hmm, looks interesting, thanks for sharing. I didn't know that the guildnames are saved in the same way than playernames. My Playername-Lookup-Code is a bit different, and it seems it is doing his work in less than 5 loops but I will look into yours. Maybe I can optimise mine even more

    Well, for those who are interested in it, this is the code I'm currently using for my Player-Name lookups (which is an optimised version of this one *click*)... But it could also be some very bad piece of code
    Code:
    public override string name
            {
                get
                {
                    string cname = "";
                    int mask = Core.Memory.ReadInt((uint)Offsets.Name.NameStorePtr + (uint)Core.Memory.MainModule.BaseAddress + (uint)Offsets.Name.NameMaskOffset);
                    if (mask == -1)
                    {
                        cname = "UNKNOWN";
                    }
                    else
                    {
                        UInt64 guid = this.GUID;
    
                        int nameStoreBasePtr = Core.Memory.ReadInt((uint)Offsets.Name.NameBaseOffset + (uint)Offsets.Name.NameStorePtr + (uint)Core.Memory.MainModule.BaseAddress);
                        int maskedGUID = mask & (int)guid;
                        maskedGUID += maskedGUID * 2;
                        int ptr = Core.Memory.ReadInt((uint)(nameStoreBasePtr + (maskedGUID * 4) + 4) + 4);
    
                        while (Core.Memory.ReadUInt((uint)ptr) != (uint)guid)
                        {
                            int maskedGUID2 = (int)this.GUID & mask;
                            maskedGUID2 += maskedGUID2 * 2;
                            int ptr2 = Core.Memory.ReadInt((uint)nameStoreBasePtr + ((uint)maskedGUID2 * 4));
                            ptr2 += ptr;
                            ptr = Core.Memory.ReadInt((uint)ptr2 + 4);
                        }
    
                        cname = Core.Memory.ReadASCIIString((uint)ptr + (uint)Offsets.Name.NameStringOffset, 64);
                    }
                    return cname;
                }
            }
    Last edited by xalcon; 06-16-2011 at 03:36 AM.

  3. #3
    Member
    Reputation
    2
    Join Date
    May 2011
    Posts
    3
    CoreCoins
    0

    Trade Feedbacks

    Status
    n/a
    Positive
    0 (0%)
    Negative
    0 (0%)
    I updated this code to 4.2.2{14545}. Guild is stored in 0x2 of player object.
    Code:
    public enum WowPlayer : uint
            {   //0xD59EE0
                //CACHE_NAME at 0xD59EE0, opcode 0x586A
                NameStore = 0x959EE0 + 0x8,
    
    //            NameStore = 0x9573D8 + 0x8,
    //            NameStore = 0x8DD9A8 + 0x8,
                NameMask = 0x024,
                NameBase = 0x01c,
                NameString = 0x020,
                //CACHE_GUILD at 0xD59F70, opcode 0x8E57
                GuildNameStore = 0x959F70 + 0x8,
    //            GuildNameStore = 0x957468 + 0x8,
                //       GuildNameStore = 0x8DDA38 + 0x8,
                GuildNameMask = 0x024,
                GuildNameBase = 0x01c,
                GuildNameString = 40
            }

    Code:
     public string Guild
            {
                get
                {
                    return StringStore.GuildNameStore.getString(GetStorageField<uint>((uint)2));
                }
            }

 

 

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -4. The time now is 08:04 AM. Powered by vBulletin® Version 4.2.0
Copyright © 2014 vBulletin Solutions, Inc. All rights reserved. Digital Point modules: Sphinx-based search