| | WoW Memory Editing WoW Memory Editing for learning purposes only.
This section is more advanced than others on MMOwned Read the section specific rules, infractions will be given out if u break them!That is including the expectations! - If you don't meet them then don't post |  | 
10-12-2009
| | New User | | | Join Date: Apr 2007
Posts: 3
Reputation: 1 Level up: 14%, 434 Points needed | | | | [c++ QUESTION]typedef and unitname I'm trying to get access to UnitName with typedef.
CastSpellById works fine but Unitname crash the wow. :/
And yes it's 3.1.3.
Im trying this way: Code: long ptrUnitName = 0x006A3650;
typedef string (__cdecl * tUnitName)(string Unit);
tUnitName oUnitName = 0;
....
oUnitName = (tUnitName)ptrUnitName;
string Return = oUnitName("player");
Any idea what am i doing wrong?
Ty. | Donate to remove ads, get your "DONATOR title, and get access to the MMOwned community's elite Shoutbawx. 
10-12-2009
|  | Corporal | | | Join Date: Apr 2008
Posts: 17
Reputation: 7 Level up: 99%, 3 Points needed | | | | Hummm ...
If you are using lua_UnitName keep in mind that the correct signature for it is
typedef int (__cdecl * tUnitName)(luastate *L);
where L is the pointer to the luastate and you must push in the the unitid string ...
so one of the correct way to call it in pseudo code is
L = GetLuaState();
lua_pusstring(L,"unitid);
oUnitName(L);
if(gettype(L,1) == String)
name = tostring(L,1);
Different is if you are trying to call the Virtual ObjectName() ...
Last edited by berserk85; 10-12-2009 at 10:06 AM.
| 
10-12-2009
|  | Kynox's sister's pimp Legendary User | | | Join Date: Apr 2006 Location: ntdll.dll
Posts: 4,188
Nominated 63 Times in 4 Posts  TOTM/W Award(s): 1 Reputation: 1085 Points: 55,580, Level: 35 | Level up: 16%, 3,120 Points needed |     | | | MMOwned: Because actually debugging code* yourself is for losers.
* The code you ripped and don't understand. | 
10-12-2009
|  | Knight | | | Join Date: Apr 2009
Posts: 223
Reputation: 11 Level up: 12%, 442 Points needed |   | | | I highly doubt anything in WoW returns standard C++-strings. | 
10-12-2009
| | New User | | | Join Date: Apr 2007
Posts: 3
Reputation: 1 Level up: 14%, 434 Points needed | | | berserk85: Thank you for your answer. I will try do that way.
Cyhper: I'm trying to learn. And i asked because i don't understand. It's true. | 
10-12-2009
|  | Kynox's sister's pimp Legendary User | | | Join Date: Apr 2006 Location: ntdll.dll
Posts: 4,188
Nominated 63 Times in 4 Posts  TOTM/W Award(s): 1 Reputation: 1085 Points: 55,580, Level: 35 | Level up: 16%, 3,120 Points needed |     | | Quote:
Originally Posted by Holdlang berserk85: Thank you for your answer. I will try do that way.
Cyhper: I'm trying to learn. And i asked because i don't understand. It's true. | Actually, if you really wanted to learn, you'd start at the beginning and learn the basics first like the rest of us had to.
What you ACTUALLY want to do is scrape together enough to copypasta a quick bot/hack together.
Stop being a lazy ****tard and learn the basics before you come here asking for "help" with something way out of your skill level. | 
10-12-2009
| | New User | | | Join Date: Apr 2007
Posts: 3
Reputation: 1 Level up: 14%, 434 Points needed | | | | i realised and i will do that.
But i think you need to cool down a little...
c++ is something i skipped in my life, but i'd like to do thinks in it now.
peace | 
10-12-2009
|  | Contributor | | | Join Date: Jul 2008 Location: Node #23
Posts: 316
Reputation: 89 Level up: 97%, 29 Points needed |     | | | to do thinks *things* |  |
Posting Rules
| You may not post new threads You may not post replies You may not post attachments You may not edit your posts HTML code is Off | | | All times are GMT -4. The time now is 10:29 AM. |