Not that it’s really imperative to know the name of anything, when you’re botting, but I recently spent a little bit of time reverse-engineering the GetPlayerName function so that I could read player names in memory. The way I figure it, it’ll be nice to keep a list of the different players that were seen by my bot, how long they remained near me, etc. Or, maybe, further down the road, I may make myself a tool that automatically heals / follows a certain character, based on their name. Either way, I convinced myself it was worth the time to figure out, so now I’ll share it with you.
Basically, WoW seems to keep all character names stored in memory in a linked-list that contains the player GUID, some other random information, and the player’s name. In order to find and display a player’s name, WoW iterates through this linked list, comparing each GUID in the list with the GUID of the player whose name it wants. Well, why not do exactly the same thing?
Here’s a link to the code that I use. It should be pretty easy to convert to just about any language out there. If it’s not, drop me a line either here or at mmowned.com’s WoW Memory Editing forums and I’ll help as best as I can.
I apologize for the really short article, today. Might have something better next time.
First of all, thanks for this blog. I’m learning a lot from it. Then, some comments:
-The MemoryLib.cs found on your site doesn’t include the code for the ReadObject function. Adding a reference to the dll works, but I think the .cs is from an older version.
-In the “Reading Player/Unit Name” source code there’s a “using WoW;” line, but this module is not included (WoWAmeliorator class, etc). Could you please show us that source code? I’m sure you have more jewels on that module
Comment by barthen — July 12, 2008 @ 8:02 pm
Respect:)
I’m learning a lot from it too.
Sorry for my english, hope it’s understandable:)
When i add code about unit/player names i got errors on compiling:
Error 1 The best overloaded method match for ‘MemoryLib.Memory.ReadString(int, long, int)’ has some invalid arguments
Error 2 Argument ‘1′: cannot convert from ‘System.IntPtr’ to ‘int’
Thought it’s something wrong with Memory.ReadString, but can’t find what.
Give me please some links about memory reading, i need to understand how works your memorylib, or write my own. Thanks.
Comment by ustim — July 31, 2008 @ 7:06 am
One of the few places that describe more how the things are done inside WoW rather than just pasting offsets.
Would just like to thank you for the posts, they are very helpful.
Keep up the good stuff!
Comment by mosucul — July 28, 2009 @ 1:50 pm