[?] Reading Object Name menu

User Tag List

Results 1 to 5 of 5
  1. #1
    Smarter's Avatar Member
    Reputation
    9
    Join Date
    May 2008
    Posts
    31
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    [?] Reading Object Name

    I am weary that this has possibly been covered already, however I have searched and searched and cannot find a working method to read an objects name. I have tried the following methods:

    Code:
    UInt32 UnitNamePtr = m_Wow.Memory.ReadUInt(m_Wow.Memory.ReadUInt(baseAddress + 0x1f4) + 0x078);
    return m_Wow.Memory.ReadUnicodeString(UnitNamePtr, 30);
    Code:
    return m_Wow.Memory.ReadUnicodeString(m_Wow.Memory.ReadUInt(baseAddress + 0x1f4) + 0x078), 40)
    I attempted to use:
    Code:
            Removed by request.
    However I was un aware of what VMT was. I am using the latest BlackMagic for this project and obviously C#. If anyone could please point me in the correct direction, I would be very grateful.
    Last edited by Smarter; 04-03-2009 at 08:25 AM.

    [?] Reading Object Name
  2. #2
    SKU's Avatar Contributor
    Reputation
    306
    Join Date
    May 2007
    Posts
    565
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The name of an object and the name of a unit are stored differently.

    pUnitName = [[UnitBaseAddress + 0x970] + 0x3C] // 3.0.9
    pObjectName = That's easier than the UnitName, take a look at the "UnitName" lua function.

    VMT = Virtual Method Table. Everything I write now might very well be wrong, as I'm bad.

    pVirtualMethodTable = [ObjectBaseAddress]. I don't know if this is only C++ related or in general like this, as I said, I'm bad.

    The point of this whole thing is to call the objects own GetObjectName funcion - that's much easier than ripping out the offsets for each type every patch.

    (The "UnitName" function calls them after it found out what type the object was if I recall correctly :P)

    The GetObjectName virtual method is as of 3.0.9 the 47th virtual method.

    GetObjectNameFunction = [[ObjectBaseAddress] + 47 * 4]

    The reason you multiply by four is because the 47 is not a direct structure offset but an index, every pointer is 4 bytes long -> you multiply by 4 to get the actual offset.

    As I said, don't take this stuff for granted. Shynds blog ( Shynd’s WoW Modification Journal ) has an entry about that. (Not about GetObjectName() but about Interact() - that's 'just' another virtual method)

    *Hopes that Cypher is in a good mood*

    Edit:

    Code:
    // GetObjectName 3.0.9
    .text:00659E00                 mov     eax, [ecx+1F4h]
    .text:00659E06                 test    eax, eax
    .text:00659E08                 jz      short loc_659E0E
    .text:00659E0A                 mov     eax, [eax+78h]
    .text:00659E0D                 retn
    Your offsets are corret, but only work for objects (type 5)
    uint pObjectName = [[ObjectBaseAddress + 0x1F4] + 0x78]
    string szObjectName = [pObjectName]
    Last edited by SKU; 04-03-2009 at 07:56 AM.

  3. #3
    Smarter's Avatar Member
    Reputation
    9
    Join Date
    May 2008
    Posts
    31
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank you so much. I have another question, I first sort my objects by the Type offset, before making any read attempts, once this is done I read through them. However on some of my Unit objects they do not have a name? I have to catch the error of it attempting to read.

  4. #4
    argh44z's Avatar Member
    Reputation
    19
    Join Date
    Nov 2007
    Posts
    93
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by SKU View Post
    pVirtualMethodTable = [ObjectBaseAddress]. I don't know if this is only C++ related or in general like this, as I said, I'm bad.
    It is compiler specific (or rather specific to whatever C++ ABI a compiler uses), although many compilers stick the pointer to the vtable there. What is highly unstandardized is the layout of the vtable and ordering of virtual functions.

  5. #5
    Cypher's Avatar Kynox's Sister's Pimp
    Reputation
    1356
    Join Date
    Apr 2006
    Posts
    5,368
    Thanks G/R
    0/4
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by argh44z View Post
    It is compiler specific (or rather specific to whatever C++ ABI a compiler uses), although many compilers stick the pointer to the vtable there. What is highly unstandardized is the layout of the vtable and ordering of virtual functions.

    That being said, I don't know of a single major compiler that does NOT implement virtual functions as vtables with a pointer at the object base on any of the major platforms.

    Also, I would hardly expect the ordering of virtual functions in memory to be standardized, or even to be considered for standardization, given that it has absolutely zero bearing on high-level software that isn't specifically designed to exploit certain low level and undocumented compiler intricacies (at which point you're already "on your own" as far as standard C++ goes).

Similar Threads

  1. [Mac][3.2] Finding the object list & reading object names
    By flukes1 in forum WoW Memory Editing
    Replies: 12
    Last Post: 09-22-2009, 09:47 PM
  2. Object name in new address ?
    By j121780im in forum WoW Memory Editing
    Replies: 3
    Last Post: 01-16-2009, 01:10 PM
  3. Object Name and id HELP!!!
    By Fireblast in forum WoW EMU Questions & Requests
    Replies: 4
    Last Post: 08-28-2008, 08:47 PM
  4. object names?? confused..
    By arynock in forum WoW Memory Editing
    Replies: 41
    Last Post: 07-25-2008, 03:46 AM
  5. Can you read player names out of process?
    By sweeper18 in forum WoW Memory Editing
    Replies: 10
    Last Post: 07-06-2008, 08:54 PM
All times are GMT -5. The time now is 02:37 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