sicher nützlich für den ein oder anderen
------------
A small program to demonstrate a method for obtaining a pointer to WOW's character data. This pointer can then be used to access various information such as your character's x, y, and z location.
I wrote this because I have only seen methods of obtaining this pointer by rummaging through WOW's stack. The problem with this is it doesn't always find the pointer and sometimes it can lead to crashes.
To accomplish this, I simply debugged WOW's process to see how it obtained the pointer. Unfortunately, the algorithm became quite complicated, so I encapsulated it inside a dll to make things a little easier. Included is a C++ program demonstrating the use of the dll along with source code for the dll itself. The dll has to make a LOT of reads to WOW's process, so it's terribly inefficient. It would be much faster if it were to execute from within WOW's address space. I didn't do that, however, because I knew there would be people that would feel uneasy about it.
Generally you want to call "FindCharacterPointer" whenever "time" has elapsed. Like every time your timer fires or the user presses a button you should call this function so you are sure your pointer is valid. Doing this will eliminate the need for a "refresh" button, and will help avoid crashes as the dll is fairly stable.
The other exported function "GetWOWHandle" will return a handle to WOW's process with query, read, and write access. This function doesn't really need to be included, but it just made things somewhat easier when I wrote that little test app. Not really important to use that if you don't want to. Note that it only get's updated after a call to FindCharacterPointer.
I made an effort to make the dll "version independent". There is a function that tries to locate the starting offset(which will change with each new version of WOW) instead of hard coding the value. I've tested it successfully with 1.2.1, 1.2.3, and 1.2.4. I wanted to test more than that, but I ran into problems like not being able to find a patch and/or working server. Maybe if I tried harder, but the versions tested are the most important ones anyway. Theoretically as long as Blizzard doesn't make any changes to their character objects, or whatever they are, this program will continue to work for future versions.
Feel free to use the code in anyway you see fit; think of it more as a tutorial. I tried to keep the code simple and provide ample comments so some people could actually learn something instead of blindly using it. If anyone runs into a problem/bug let me know and maybe I will fix it. I hope someone will find this example useful.
Finally, I want to thank the Mobius people, as I mercilessly ripped their x, y, and z offsets for the test program =P