[c++][3.3.5][Question] UnitName(UnitID), where UnitID is not UnitID menu

User Tag List

Results 1 to 4 of 4
  1. #1
    Borg333's Avatar Member Authenticator enabled
    Reputation
    2
    Join Date
    Dec 2013
    Posts
    23
    Thanks G/R
    5/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    [c++][3.3.5][Question] UnitName(UnitID), where UnitID is not UnitID

    Hi, there is the way to call UnitName(UnitID), where UnitID is Object from Object Manager as BaseAddress/Guid/Descriptor or some thing else? I see that UnitName calls Script_GetGUIDFromToken, but if i want to using it differently, i must replace this function mith own or i can put something that i can read from memory that can be properly used in UnitName(UnitID)?
    I know i can init OM and read UnitName directly from memory, I just want to know possibility of it and methods.
    Thanks.

    These ads disappear when you log in.

  2. #2
    Borg333's Avatar Member Authenticator enabled
    Reputation
    2
    Join Date
    Dec 2013
    Posts
    23
    Thanks G/R
    5/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I can get BaseAddress from UnitID by 0x0060C1F0 and then get GUID with offset but, if i do this, i must register other similar functions with own checks to push value, f.e.
    Code:
    _UnitName = UnitName
    function UnitName(unitIDorGUID)
    	if string.match(unitIDorGUID, "0x") then 
    		return ObjectName(unitIDorGUID) -- registered C function, gets UnitName through ObjectManager like Obj -> Name
    	else
    		return _UnitName(unitIDorGUID) 
    	end
    end
    but in this way i need to recode all lua functions, it is a bad way as i think, and i need to detour Script_GetGUIDFromToken, but i dont know how to do it properly
    Last edited by Borg333; 08-09-2022 at 02:37 PM.

  3. #3
    Borg333's Avatar Member Authenticator enabled
    Reputation
    2
    Join Date
    Dec 2013
    Posts
    23
    Thanks G/R
    5/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ok, now i can detour GetGUIDFromToken and GetGuidByKeyword
    char __cdecl GetGUIDFromTokenDetour(char* a1, int a3, char a4)
    __int64 __cdecl GetGuidByKeywordDetour(char* a1)
    i can read first argument a1 (returns UnitIDs), now trying to understand, how i must use it

    -----------------------------------------------------------------
    i can do this:
    Code:
    	if (a1 && a1[0] == '0' && a1[1] == 'x') {  
    		printf("\nGetGUIDFromTokenDetour: ");
    		printf("%s ", a1);
    		return 100; //for example, ulong from 0x0000000000000064
    	}
    but still cant getting return by /dump UnitName("0x0000000000000064")
    Last edited by Borg333; 08-10-2022 at 06:46 AM.

  4. #4
    thateuler's Avatar Member
    Reputation
    6
    Join Date
    May 2019
    Posts
    21
    Thanks G/R
    17/5
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Another way to do this is to write the guid to the global value of `mouseover` or `focus`, and then call `UnitName("focus")`.

Similar Threads

  1. [Question](Noob Q) Where do I put the MPQ?
    By Hammil in forum WoW ME Questions and Requests
    Replies: 1
    Last Post: 05-15-2009, 12:36 AM
  2. Replies: 12
    Last Post: 11-21-2008, 09:25 PM
  3. [Question] Hey dude, where are mare model changes?
    By Andreew in forum WoW ME Questions and Requests
    Replies: 2
    Last Post: 12-14-2007, 05:39 AM
All times are GMT -5. The time now is 02:17 AM. Powered by vBulletin® Version 4.2.3
Copyright © 2022 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2022 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search