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
    204
    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 02: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 01:00 AM. Powered by vBulletin® Version 4.2.0
Copyright © 2014 vBulletin Solutions, Inc. All rights reserved.
Content Relevant URLs by vBSEO Resources saved on this page: MySQL 21.43%
vBulletin Optimisation provided by vB Optimise (Pro) - vBulletin Mods & Addons Copyright © 2014 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247