Understanding localized strings (how to read them OOP) menu

User Tag List

Page 1 of 2 12 LastLast
Results 1 to 15 of 19
  1. #1
    Tanaris4's Avatar Contributor Authenticator enabled
    Reputation
    148
    Join Date
    Oct 2008
    Posts
    646
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Understanding localized strings (how to read them OOP)

    So I FINALLY am able to actually find the correct Spell DBC struct my knowing the Spell ID (on mac), sadly it took me way too long to figure this out - but GetSpellInfo helped me greatly.

    My question, I was able to find 4 pointers within the struct to strings: (at 0x180 through 0x18C):


    Now I'm actually looking at the spell 15616 (Flame Shock) - randomly chosen. But when I follow the above pointers, they take me to spell name "Snap Kick" (the other pointers are to the start of the string list, the description, and then a 1 word description of Snap Kick):


    So I'm guessing that I need to transform the string pointer somehow. Is this a correct assumption? And if so - can people provide me insight into how to do this?

    (and yes I'm on a mac, but I don't think this should matter)

    Thanks!

    Other relevant screenshots (just of the struct in case you wanted to see):

    Image 2
    Image 3
    Image 4
    Image 5
    Image 6
    https://tanaris4.com

    Understanding localized strings (how to read them OOP)
  2. #2
    swollen's Avatar Member
    Reputation
    36
    Join Date
    May 2007
    Posts
    124
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    1. Destroy Mac.
    2. Get PC
    3. Install Windaids
    4. Copy pasta code

  3. #3
    Krillere's Avatar Contributor
    Reputation
    112
    Join Date
    Nov 2007
    Posts
    668
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by swollen View Post
    1. Destroy Mac.
    2. Get PC
    3. Install Windaids
    4. Copy pasta code

    1. Stop failing.
    2. Stop failing.
    3. Stop failing.
    4. Stop failing.

  4. #4
    schlumpf's Avatar Retired Noggit Developer

    Reputation
    755
    Join Date
    Nov 2006
    Posts
    2,759
    Thanks G/R
    0/3
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    1. Tell me which application you are using.

  5. #5
    swollen's Avatar Member
    Reputation
    36
    Join Date
    May 2007
    Posts
    124
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Krillere View Post
    1. Stop failing.
    2. Stop failing.
    3. Stop failing.
    4. Stop failing.
    1. MacFag alert
    2. MacFag alert
    3. MacFag alert
    4. MacFag alert

  6. #6
    Tanaris4's Avatar Contributor Authenticator enabled
    Reputation
    148
    Join Date
    Oct 2008
    Posts
    646
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Can I actually get a useful response to this thread? If you don't know shit go the **** away, this isn't a PC vs. mac debate, use whatever you are comfortable with.

    @schlumpf - serious question?
    https://tanaris4.com

  7. #7
    schlumpf's Avatar Retired Noggit Developer

    Reputation
    755
    Join Date
    Nov 2006
    Posts
    2,759
    Thanks G/R
    0/3
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    @Tanaris4: Yes. I still search a good cheatengine replacement for my mac.

    Snap Kick is 15618, so just a bit more. Seems like your struct is wrong or something like that.
    Last edited by schlumpf; 04-12-2010 at 10:04 AM.

  8. #8
    Tanaris4's Avatar Contributor Authenticator enabled
    Reputation
    148
    Join Date
    Oct 2008
    Posts
    646
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It's not wrong tho, check the last image in my post. That's the correct spell ID. I think I need to localize properly, I know Apoc had mentioned you have to do something else (maybe related to subtracting 0x18, altho this doesn't help), so not sure what I need to be doing.

    Also, just use Pocket Gnome, the screen shots are from the memory tab. Great way to look @ things in memory.
    https://tanaris4.com

  9. #9
    MaiN's Avatar Elite User
    Reputation
    335
    Join Date
    Sep 2006
    Posts
    1,047
    Thanks G/R
    0/10
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm pretty sure the name is at around field 136 (+0x220).
    Atleast, it is on Windows.
    Last edited by MaiN; 04-12-2010 at 11:38 AM.
    [16:15:41] Cypher: caus the CPU is a dick
    [16:16:07] kynox: CPU is mad
    [16:16:15] Cypher: CPU is all like
    [16:16:16] Cypher: whatever, i do what i want

  10. #10
    Tanaris4's Avatar Contributor Authenticator enabled
    Reputation
    148
    Join Date
    Oct 2008
    Posts
    646
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yea it's not 0x220 on mac, although honestly these things never vary cross platform.

    What is SO strange is I can consistently land on the correct spell ID w/in the database. But the strings ALWAYS point to a spell name/description that is (spellID + 2). Obviously I can program around this (If I want the spell name, search for the spell ID - 2). But I'd like to have an understanding why this is happening ya know? I have to be missing something simple.
    https://tanaris4.com

  11. #11
    MaiN's Avatar Elite User
    Reputation
    335
    Join Date
    Sep 2006
    Posts
    1,047
    Thanks G/R
    0/10
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Tanaris4 View Post
    Yea it's not 0x220 on mac, although honestly these things never vary cross platform.

    What is SO strange is I can consistently land on the correct spell ID w/in the database. But the strings ALWAYS point to a spell name/description that is (spellID + 2). Obviously I can program around this (If I want the spell name, search for the spell ID - 2). But I'd like to have an understanding why this is happening ya know? I have to be missing something simple.
    Have you tried debugging lua_GetSpellName or lua_GetSpellInfo? See how it unpacks the row.
    [16:15:41] Cypher: caus the CPU is a dick
    [16:16:07] kynox: CPU is mad
    [16:16:15] Cypher: CPU is all like
    [16:16:16] Cypher: whatever, i do what i want

  12. #12
    Tanaris4's Avatar Contributor Authenticator enabled
    Reputation
    148
    Join Date
    Oct 2008
    Posts
    646
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That's what I'm trying to do now, and I'm confused as shit. And the pseudocode generator on mac doesn't always work that well :/ 0xD2E300 is a pointer to the WoW DB Struct

    Code:
     WowClientDB__GetRow();
      v3 = *(&dword_D2E300 + 4);
      if ( _EBX >= v3
        && _EBX <= *(&dword_D2E300 + 3)
        && (v4 = *(const void **)(*(&dword_D2E300 + 8) + 4 * (_EBX - v3))) != 0 )
      {
        if ( unk_C7E44C )
        {
          v6 = (unsigned int)&v37;
          v5 = (int)((char *)v4 + 1);
          v36 = *(_BYTE *)v4;
          if ( (unsigned int)&v45 > (unsigned int)&v37 )
          {
            do
            {
              *(_BYTE *)v6 = *(_BYTE *)v5;
              v21 = *(_BYTE *)v5;
              ++v6;
              if ( *(_BYTE *)v5 == *(_BYTE *)(v5 - 1) )
              {
                v19 = v6;
                v20 = v6 + *(_BYTE *)(v5 + 1) - 1;
                if ( *(_BYTE *)(v5 + 1) )
                {
                  while ( 1 )
                  {
                    *(_BYTE *)v19++ = v21;
                    if ( v19 == v20 + 1 )
                      break;
                    v21 = *(_BYTE *)v5;
                  }
                  v6 = v19;
                }
                v5 += 2;
                if ( (unsigned int)&v45 > v6 )
                  *(_BYTE *)v6++ = *(_BYTE *)v5;
              }
              ++v5;
            }
            while ( v6 < (unsigned int)&v45 );
          }
        }
        else
        {
          memcpy(&v36, v4, 0x2A8u);
        }
        v7 = GetPlayerGUID();
        v8 = GetBaseAddressFromGUID(v7, 16);
        v35 = v8;
        if ( v47 )
        {
          LODWORD(v27) = sub_56D8E0(0);
          v8 = GetBaseAddressFromGUID(v27, 8);
        }
        FrameScript_PushString(a1, v43);
    Full source: tanaris4 private pastebin - collaborative debugging tool


    Edit: Kind of getting somewhere, looks like what I want to do is get the resulting POINTER to the row, add 0x1 to it, and then jump a certain amount and I see the correct string (but it's not static, it varies a bit on how far away it is, i.e. name could be at 0x60 away or 0x68 away)
    Last edited by Tanaris4; 04-12-2010 at 12:11 PM.
    https://tanaris4.com

  13. #13
    MaiN's Avatar Elite User
    Reputation
    335
    Join Date
    Sep 2006
    Posts
    1,047
    Thanks G/R
    0/10
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Tanaris4 View Post
    That's what I'm trying to do now, and I'm confused as shit. And the pseudocode generator on mac doesn't always work that well :/ 0xD2E300 is a pointer to the WoW DB Struct

    Code:
     WowClientDB__GetRow();
      v3 = *(&dword_D2E300 + 4);
      if ( _EBX >= v3
        && _EBX <= *(&dword_D2E300 + 3)
        && (v4 = *(const void **)(*(&dword_D2E300 + 8) + 4 * (_EBX - v3))) != 0 )
      {
        if ( unk_C7E44C )
        {
          v6 = (unsigned int)&v37;
          v5 = (int)((char *)v4 + 1);
          v36 = *(_BYTE *)v4;
          if ( (unsigned int)&v45 > (unsigned int)&v37 )
          {
            do
            {
              *(_BYTE *)v6 = *(_BYTE *)v5;
              v21 = *(_BYTE *)v5;
              ++v6;
              if ( *(_BYTE *)v5 == *(_BYTE *)(v5 - 1) )
              {
                v19 = v6;
                v20 = v6 + *(_BYTE *)(v5 + 1) - 1;
                if ( *(_BYTE *)(v5 + 1) )
                {
                  while ( 1 )
                  {
                    *(_BYTE *)v19++ = v21;
                    if ( v19 == v20 + 1 )
                      break;
                    v21 = *(_BYTE *)v5;
                  }
                  v6 = v19;
                }
                v5 += 2;
                if ( (unsigned int)&v45 > v6 )
                  *(_BYTE *)v6++ = *(_BYTE *)v5;
              }
              ++v5;
            }
            while ( v6 < (unsigned int)&v45 );
          }
        }
        else
        {
          memcpy(&v36, v4, 0x2A8u);
        }
        v7 = GetPlayerGUID();
        v8 = GetBaseAddressFromGUID(v7, 16);
        v35 = v8;
        if ( v47 )
        {
          LODWORD(v27) = sub_56D8E0(0);
          v8 = GetBaseAddressFromGUID(v27, 8);
        }
        FrameScript_PushString(a1, v43);
    Full source: tanaris4 private pastebin - collaborative debugging tool


    Edit: Kind of getting somewhere, looks like what I want to do is get the resulting POINTER to the row, add 0x1 to it, and then jump a certain amount and I see the correct string (but it's not static, it varies a bit on how far away it is, i.e. name could be at 0x60 away or 0x68 away)
    The actual row is "inlined" in the stack when that is called.
    char v36; // [sp+5Ch] [bp-2CCh]@12 <- that is the base of the struct, hence it should actually be something like v36.spellID.
    FrameScript_PushString(a1, v43); <- Ok, that is our name. v43.
    char *v43; // [sp+27Ch] [bp-ACh]@14 <- v43 is at sp+0x27C, while v36 is at sp+0x5C. 0x27C - 0x5C = 0x220. So after the row has been unpacked, the name is at row+0x220.
    Also, it looks horrible. You should define some types:
    struct WoWClientDB
    {
    void *funcTable;
    int isLoaded;
    int numRows;
    int maxIndex;
    int minIndex;
    int stringTable;
    void *funcTable2;
    void *FirstRow;
    void **Rows;
    };
    Thanks to Apoc/Kynox for this. Set D2E300 to this type (Set it to the struct, NOT A POINTER TO THE STRUCT!).
    Last edited by MaiN; 04-12-2010 at 01:13 PM.
    [16:15:41] Cypher: caus the CPU is a dick
    [16:16:07] kynox: CPU is mad
    [16:16:15] Cypher: CPU is all like
    [16:16:16] Cypher: whatever, i do what i want

  14. #14
    Tanaris4's Avatar Contributor Authenticator enabled
    Reputation
    148
    Join Date
    Oct 2008
    Posts
    646
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    @Main - thanks for the reply, that makes more sense. So then my next question is how do I determine what sp (stack pointer?) points to, and how do I "unpack" the row?

    Also, I do have those types defined, just not when I'm hacking away trying to understand what is going on.

    And I'm also doing this OOP, so wouldn't SP be irrelevant?
    https://tanaris4.com

  15. #15
    MaiN's Avatar Elite User
    Reputation
    335
    Join Date
    Sep 2006
    Posts
    1,047
    Thanks G/R
    0/10
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Tanaris4 View Post
    @Main - thanks for the reply, that makes more sense. So then my next question is how do I determine what sp (stack pointer?) points to, and how do I "unpack" the row?

    Also, I do have those types defined, just not when I'm hacking away trying to understand what is going on.

    And I'm also doing this OOP, so wouldn't SP be irrelevant?
    No. Basically the unpacked row is copied to the address of the variable "v36", which happens to lie at sp+5C. That means sp+5C is going to be spell ID and sp+60 is going to be the field that comes after the spell ID in the row structure.
    v43 is at sp+27C, which means that it is at 27C - 5C relative to the row start address. 27C - 5C = 0x220.
    It's using the stack as memory instead of allocating new memory one might say.
    [16:15:41] Cypher: caus the CPU is a dick
    [16:16:07] kynox: CPU is mad
    [16:16:15] Cypher: CPU is all like
    [16:16:16] Cypher: whatever, i do what i want

Page 1 of 2 12 LastLast

Similar Threads

  1. [QUESTION] Aggroing more mobs than wanted/ How to make them yellow?
    By Romis in forum World of Warcraft Emulator Servers
    Replies: 3
    Last Post: 03-01-2008, 06:44 AM
  2. How to read .M2 informations ?
    By 0megear in forum WoW ME Questions and Requests
    Replies: 1
    Last Post: 01-08-2008, 07:40 AM
  3. Zul'Aman items + how to add them
    By riath in forum WoW EMU Guides & Tutorials
    Replies: 5
    Last Post: 12-05-2007, 09:03 AM
  4. Replies: 5
    Last Post: 05-04-2007, 10:16 AM
  5. Hunter Pets how to use them to gank lowbies
    By Demonicmaster in forum World of Warcraft Exploits
    Replies: 4
    Last Post: 12-21-2006, 04:35 PM
All times are GMT -5. The time now is 10:05 AM. Powered by vBulletin® Version 4.2.3
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Google Authenticator verification provided by Two-Factor Authentication (Free) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search