<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Shynd's WoW Modification Journal</title>
	<atom:link href="http://shynd.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://shynd.wordpress.com</link>
	<description>Creating a WoW Bot, little by little</description>
	<lastBuildDate>Mon, 21 Jul 2008 15:54:37 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='shynd.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Shynd's WoW Modification Journal</title>
		<link>http://shynd.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://shynd.wordpress.com/osd.xml" title="Shynd&#039;s WoW Modification Journal" />
	<atom:link rel='hub' href='http://shynd.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Reading Player/Unit Name</title>
		<link>http://shynd.wordpress.com/2008/07/06/reading-playerunit-name/</link>
		<comments>http://shynd.wordpress.com/2008/07/06/reading-playerunit-name/#comments</comments>
		<pubDate>Sun, 06 Jul 2008 19:28:12 +0000</pubDate>
		<dc:creator>Shynd</dc:creator>
				<category><![CDATA[World of Warcraft]]></category>
		<category><![CDATA[getplayername]]></category>
		<category><![CDATA[warcraft]]></category>
		<category><![CDATA[wow]]></category>
		<category><![CDATA[wow bot]]></category>

		<guid isPermaLink="false">http://shynd.wordpress.com/?p=29</guid>
		<description><![CDATA[Not that it&#8217;s really imperative to know the name of anything, when you&#8217;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&#8217;ll be nice to keep a list of the different players that were seen [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=shynd.wordpress.com&amp;blog=3977891&amp;post=29&amp;subd=shynd&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Not that it&#8217;s really imperative to know the name of anything, when you&#8217;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&#8217;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&#8217;ll share it with you.<span id="more-29"></span></p>
<p>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&#8217;s name.  In order to find and display a player&#8217;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?</p>
<p><a title="GetObjectName" href="http://www.nomorepasting.com/getpaste.php?pasteid=17694" target="_blank">Here&#8217;s a link to the code that I use.</a> It should be pretty easy to convert to just about any language out there.  If it&#8217;s not, drop me a line either here or at mmowned.com&#8217;s WoW Memory Editing forums and I&#8217;ll help as best as I can.</p>
<p>I apologize for the really short article, today.  Might have something better next time.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/shynd.wordpress.com/29/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/shynd.wordpress.com/29/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/shynd.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/shynd.wordpress.com/29/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/shynd.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/shynd.wordpress.com/29/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/shynd.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/shynd.wordpress.com/29/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/shynd.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/shynd.wordpress.com/29/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/shynd.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/shynd.wordpress.com/29/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/shynd.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/shynd.wordpress.com/29/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/shynd.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/shynd.wordpress.com/29/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=shynd.wordpress.com&amp;blog=3977891&amp;post=29&amp;subd=shynd&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://shynd.wordpress.com/2008/07/06/reading-playerunit-name/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">Shynd</media:title>
		</media:content>
	</item>
		<item>
		<title>Clarification of Object Data</title>
		<link>http://shynd.wordpress.com/2008/06/29/clarification-of-object-data/</link>
		<comments>http://shynd.wordpress.com/2008/06/29/clarification-of-object-data/#comments</comments>
		<pubDate>Sun, 29 Jun 2008 16:21:32 +0000</pubDate>
		<dc:creator>Shynd</dc:creator>
				<category><![CDATA[World of Warcraft]]></category>
		<category><![CDATA[bobbysing]]></category>
		<category><![CDATA[bot]]></category>
		<category><![CDATA[ePlayerFields]]></category>
		<category><![CDATA[eUnitFields]]></category>
		<category><![CDATA[GameObject]]></category>
		<category><![CDATA[warcraft]]></category>
		<category><![CDATA[wow]]></category>
		<category><![CDATA[wow bot]]></category>

		<guid isPermaLink="false">http://shynd.wordpress.com/?p=28</guid>
		<description><![CDATA[I&#8217;m making this post for anyone struggling to gather all the information from objects, corpses, mobs, and players that would be necessary to create a bot/tool.  I&#8217;ve had to look in many different places and many different websites/projects to consolidate all of the information I&#8217;ve gathered in order to effectively read object data.  Hopefully, this [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=shynd.wordpress.com&amp;blog=3977891&amp;post=28&amp;subd=shynd&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m making this post for anyone struggling to gather all the information from objects, corpses, mobs, and players that would be necessary to create a bot/tool.  I&#8217;ve had to look in many different places and many different websites/projects to consolidate all of the information I&#8217;ve gathered in order to effectively read object data.  Hopefully, this post will make it easier for at least some of you.<span id="more-28"></span></p>
<p>I hope you&#8217;ve all read up on how to access WoW&#8217;s linked-list of game objects.  If not, search around mmowned.com and forum.gamedeception.com, or read <a title="Accessing WoW's Game Objects" href="http://shynd.wordpress.com/2008/06/14/accessing-wows-game-objects/" target="_blank">my article on the subject</a>.</p>
<p>First, here&#8217;s the best resource for structs, enumerations, and offsets that I&#8217;ve found, as far as object information gathering goes: <a title="Defines.h" href="http://www.nomorepasting.com/getpaste.php?pasteid=17404" target="_blank">bobbysing&#8217;s WoWXBase Defines.h</a>.  His full source is readily available <a title="WoWX Hack Base" href="http://forum.gamedeception.net/showthread.php?p=93792#post93792" target="_blank">here</a>.</p>
<p>Now then, what do all of these things mean?  These enumerations are offsets for different fields of information held inside each game object in memory.  If you know the base address for an object and what type of object it is (you read its type from baseaddress+0&#215;14), then you can access all of the data listed in these enumerations.</p>
<p>For all of the information except ePlayerFields, the pointer to the start of the information struct is found at (baseaddress+0&#215;120).  Say that you read memory at MobBaseAddress+0&#215;120 and it tells you the mob&#8217;s information struct is held at address 0&#215;1230000.  Now, look at the eUnitFields enumeration in Defines.h: you can see that UNIT_FIELD_HEALTH = 0&#215;40.  So, if you now read memory from 0&#215;1230040, you have that mob&#8217;s health.  Same goes for GameObjects, DynamicObjects, and Corpses (scroll down about 2/3rds of the way through Defines.h to find the object type enumeration).</p>
<p>Players, however, are slightly different.  Each player has all of the same information as a unit/mob at (baseaddress+0&#215;120), but it ALSO has all the information in ePlayerFields, with a pointer to the start of that structure at (baseaddress+0&#215;1198).</p>
<p>Also, for both units/mobs and players, you can find its positional information at (baseaddress+0xBF0).  X coordinate is +0xBF0, Y is +0xBF4, Z is +0xBF8, and Facing is +0xBFC (all are float type values).  Lastly, for your local player, and I&#8217;m not entirely sure about this one, there seems to be an __int64 GUID of whatever you are currently auto-attacking at (baseaddress+0xF08)&#8211;very useful for checking if you&#8217;re currently auto-attacking: +0xF08 is zero if you&#8217;re not, non-zero if you are.</p>
<p>There you go, that should at least get you started on gathering information.  Hope it helped.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/shynd.wordpress.com/28/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/shynd.wordpress.com/28/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/shynd.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/shynd.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/shynd.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/shynd.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/shynd.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/shynd.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/shynd.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/shynd.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/shynd.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/shynd.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/shynd.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/shynd.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/shynd.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/shynd.wordpress.com/28/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=shynd.wordpress.com&amp;blog=3977891&amp;post=28&amp;subd=shynd&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://shynd.wordpress.com/2008/06/29/clarification-of-object-data/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">Shynd</media:title>
		</media:content>
	</item>
		<item>
		<title>Object.Interact()</title>
		<link>http://shynd.wordpress.com/2008/06/28/objectinteract/</link>
		<comments>http://shynd.wordpress.com/2008/06/28/objectinteract/#comments</comments>
		<pubDate>Sun, 29 Jun 2008 03:50:30 +0000</pubDate>
		<dc:creator>Shynd</dc:creator>
				<category><![CDATA[World of Warcraft]]></category>
		<category><![CDATA[bobbysing]]></category>
		<category><![CDATA[bot]]></category>
		<category><![CDATA[interact]]></category>
		<category><![CDATA[kynox]]></category>
		<category><![CDATA[s_curmgr]]></category>
		<category><![CDATA[TLS]]></category>
		<category><![CDATA[vtable]]></category>
		<category><![CDATA[warcraft]]></category>
		<category><![CDATA[wow]]></category>
		<category><![CDATA[wow bot]]></category>

		<guid isPermaLink="false">http://shynd.wordpress.com/?p=27</guid>
		<description><![CDATA[The phrase of the day is: Virtual Table.  Read up on Object Oriented Programming, class inheritance, and virtual functions.  I probably don&#8217;t understand all of these things as well as I should, so I will not cloud the issue by summarizing what my understanding of the above subjects is. Suffice it to say that the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=shynd.wordpress.com&amp;blog=3977891&amp;post=27&amp;subd=shynd&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The phrase of the day is: Virtual Table.  Read up on Object Oriented Programming, class inheritance, and virtual functions.  I probably don&#8217;t understand all of these things as well as I should, so I will not cloud the issue by summarizing what my understanding of the above subjects is.</p>
<p>Suffice it to say that the table of virtual functions associated with a class object&#8211;a class object might be a GameObject, a GameUnit, a GamePlayer, etc., as it applies to World of Warcraft&#8211;are things that can be called almost <em>as a part of</em> the object.  For instance, instead of calling a function like <strong>Interact(GameObject obj)</strong>, you&#8217;d simply call it like <strong>obj.Interact()</strong>, which, in my opinion, simplifies things greatly.<span id="more-27"></span></p>
<p>Anyway, you should all know, by now, how to find the base address of whatever object you want to interact with (generally it will be either a mob or a mining/herbalism/quest node).  Loop through whatever objects you find until you find the one you want to kill, target it, walk up to it, call <strong>it.Interact()</strong> and, voila, you&#8217;re attacking it.  So, once you have the base address of the object, read the VERY FIRST pointer, at offset zero.  <strong>ReadDword(WoWhProcess, objectbaseaddress);</strong> This will be a pointer to its <strong>virtual table</strong> of functions associated with that class object.</p>
<p>The virtual table consists of pointers to subroutines associated with the object.  In other words, each entry in the table is a DWORD pointing to the start address of a function that can be used with&#8211;or <em>as a part of</em>&#8211;the object.  If you want to call <strong>obj.Interact()</strong>, you need only know which place in the virtual table <strong>.Interact()</strong> occupies.  Well, here: it occupies position number 34.  That, by the way, is credit, ONCE AGAIN, to bobbysing&#8217;s WoWX hack base, so think of him and anyone else that helped him find the information when you use it&#8211;I did literally nothing to find it except page through his source code.</p>
<p>So, you&#8217;ve got your pointer to the virtual table by reading at the base address of the object, and now you read from <strong>(virtualtablepointer + (34 * 4))</strong> in order to find the address of the .Interact() function associated with the object (yes, it&#8217;s a different address for GameObjects and GameUnits, so you really do have to read its address from the virtual table associated with the object each time you call it).  Remember, it&#8217;s in position 34, and each position consists of a DWORD (4-byte) pointer to a function, so, to read from position 34, we read from VTable+(34*4).  Hope that&#8217;s clear.</p>
<p>If we&#8217;re calling a class method from an external thread&#8211;and we are&#8211;then we have to make sure our thread is as close as possible to resembling the thread that NORMALLY would call the method.  We pretty much all, at this point, use the TLS method for iterating through loaded objects, so I <strong>hope</strong> this is not new to anyone who needs to know how to target a unit&#8211;in other words, if you&#8217;re reading this post and hoping to apply it to your bot/tool, you should probably understand what I&#8217;m talking about.  A pointer to the linked-list of objects in the WoW client is held in the <strong>TIB</strong>, or <strong>Thread Information Block</strong>, of the calling thread.  Since we are creating an external thread, as in my last article, to call this method, we need to modify our thread&#8217;s TIB to emulate WoW&#8217;s.  A few simple ASM instructions and one memory write should do the trick!</p>
<p>Get your pointer to the s_curMgr ready, you&#8217;re going to need it.  Currently, you can get a pointer to the s_curMgr with two memory reads: [[0xD495B0]+0&#215;2218].  This is what we&#8217;re going to use to update the TIB of our thread.</p>
<p>At this point, you&#8217;re going to want to make sure you&#8217;ve read my <a title="SelectUnit" href="http://shynd.wordpress.com/2008/06/27/selectunit/" target="_blank">SelectUnit article</a> because much of what I&#8217;m going to breeze through right now is covered there, with code examples.  We&#8217;re going to have to allocate memory, inject code, and call CreateRemoteThread, just as outlined in the SelectUnit article.</p>
<p>So, allocate your chunk of memory using VirtualAllocEx.  It doesn&#8217;t have to be huge, but making it a full 0&#215;1000 byte chunk won&#8217;t hurt for our purposes.  For this example, assume your code injects at address 0&#215;1230000; here is the ASM we will be injecting:</p>
<blockquote>
<pre>MOV EDX,DWORD PTR DS:[DEADBEEF] ;DEADBEEF==placeholder for our s_curMgr pointer
MOV EAX,DWORD PTR FS:[2C]       ;start accessing our TIB
MOV EAX,DWORD PTR DS:[EAX]      ;do it like WoW does it
ADD EAX,08                      ;same
MOV DWORD PTR DS:[EAX],EDX      ;move the s_curMgr pointer into our TIB
MOV ECX,DWORD PTR DS:[DEADBEEF] ;ECX = the base address of the object we're interacting with
CALL WoW.DEADBEEF               ;DEADBEEF = placeholder for the address of the virtual function
RETN                            ;always return so we don't crash</pre>
</blockquote>
<p>So, like before, we have to patch a few relative moves and calls.  First, remember that pointer to the s_curMgr you read from memory?  Write it to CodeCave+2 (in this example, 0&#215;1230002).  Now, write the base address of the object with which you wish to interact to CodeCave+0&#215;100 (0&#215;1230100) and patch the second occurence of DEADBEEF (CodeCave+21) with the value of CodeCave+0&#215;100 (this will tell it to move the value at address 0&#215;1230100 into ECX on line 6).  Lastly, patch your relative Interact call on line 7 by writing (interactfunction &#8211; (CodeCave + 30)) to CodeCave+26.  When it&#8217;s all injected, and you look at it in OLLYDBG, it should look normalized, with all the addresses correct and no more DEADBEEF (spoiled meat stinks anyway).</p>
<p>Now you just CreateRemoteThread on it and watch as your player loots it, attacks it, mines it, or gathers it.  Magic.</p>
<p>As is my usual practice, <a title="InteractWithObject" href="http://www.nomorepasting.com/getpaste.php?pasteid=17399" target="_blank">here&#8217;s a bit of code on which to chew</a>.</p>
<p>Until we meet again.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/shynd.wordpress.com/27/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/shynd.wordpress.com/27/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/shynd.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/shynd.wordpress.com/27/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/shynd.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/shynd.wordpress.com/27/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/shynd.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/shynd.wordpress.com/27/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/shynd.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/shynd.wordpress.com/27/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/shynd.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/shynd.wordpress.com/27/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/shynd.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/shynd.wordpress.com/27/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/shynd.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/shynd.wordpress.com/27/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=shynd.wordpress.com&amp;blog=3977891&amp;post=27&amp;subd=shynd&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://shynd.wordpress.com/2008/06/28/objectinteract/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">Shynd</media:title>
		</media:content>
	</item>
		<item>
		<title>SelectUnit</title>
		<link>http://shynd.wordpress.com/2008/06/27/selectunit/</link>
		<comments>http://shynd.wordpress.com/2008/06/27/selectunit/#comments</comments>
		<pubDate>Fri, 27 Jun 2008 12:14:23 +0000</pubDate>
		<dc:creator>Shynd</dc:creator>
				<category><![CDATA[World of Warcraft]]></category>
		<category><![CDATA[bobbysing]]></category>
		<category><![CDATA[bot]]></category>
		<category><![CDATA[kynox]]></category>
		<category><![CDATA[SelectUnit]]></category>
		<category><![CDATA[warcraft]]></category>
		<category><![CDATA[wow bot]]></category>
		<category><![CDATA[WoWX]]></category>

		<guid isPermaLink="false">http://shynd.wordpress.com/?p=24</guid>
		<description><![CDATA[If you haven&#8217;t yet downloaded bobbysing&#8217;s WoWX framework, do so immediately.  Look through it, learn what you can from it, always keep it as a resource.  Kynox and bobby (and others, I&#8217;m sure) have done a ton of reverse-engineering and whatnot and it would be folly to do the same reversing, wasting your time, when [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=shynd.wordpress.com&amp;blog=3977891&amp;post=24&amp;subd=shynd&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>If you haven&#8217;t yet downloaded bobbysing&#8217;s WoWX framework, <a title="WoWX Hack Base" href="http://forum.gamedeception.net/showthread.php?p=93792#post93792" target="_blank">do so immediately</a>.  Look through it, learn what you can from it, always keep it as a resource.  Kynox and bobby (and others, I&#8217;m sure) have done a ton of reverse-engineering and whatnot and it would be folly to do the same reversing, wasting your time, when you could be building upon the work of others and furthering the WoW hacking community in other directions.</p>
<p>That said, the SelectUnit function that I&#8217;m using is ripped <strong>directly</strong> from bobbysing&#8217;s WoWX framework, right down to the pattern that I use to find it.  Instead of screwing with patterns&#8211;if you want to screw with patterns, you can find the pattern in bobby&#8217;s Patterns.xml, labeled SelectUnit&#8211;I&#8217;ll just provide you with the address of the function we&#8217;re talking about:<span id="more-24"></span> <strong>0x006D8760</strong>.  This function has one parameter: the 64-bit integer representing the unit&#8217;s GUID (read from <strong>UnitBase+0&#215;30</strong>).</p>
<p>I don&#8217;t know about you, but my bot doesn&#8217;t select units all that often; it&#8217;s not something done multiple times a second, anyway.  SelectUnit, kill unit (takes some time, depending on level and class), loot unit, find next unit, SelectUnit.  For that reason, I&#8217;m okay with the added overhead for creating a new thread each time I want to select a unit, solely because it keeps me from having to inject a DLL into the client (which I&#8217;d like to avoid doing, for now).  Basically, the way I&#8217;m doing it goes a little like this:</p>
<ul>
<li>Allocate a chunk of memory for my codecave</li>
<li>MemoryWrite ASM opcodes that push the 64-bit integer GUI onto the stack (you need two push commands, seeing as you can only push 4 bytes per command and a 64-bit integer is 8 bytes long)</li>
<li>MemoryWrite ASM opcodes that will call SelectUnit, clean up the stack, and return</li>
<li>MemoryWrite the 64-bit integer GUID at an address I know (that pointed to by my two pushes)</li>
<li>Use CreateRemoteThread API to create a thread that executes my injected code</li>
<li>Use WaitForSingleObject to wait until the thread returns</li>
</ul>
<p>In pseudo-c, it might look a little like this (remember, ASM CALLs are relative, so you have to transform the static SelectUnit address into a relative call).</p>
<blockquote>
<pre>DWORD dwSelectUnit = 0x006D8760;
__int64 GUID = 0; //clears target

//Allocate with address NULL and it will give us the first available chunk
LPVOID lpCodeCave= VirtualAllocEx(hProcess, NULL, 0x100, MEM_COMMIT, PAGE_READWRITE);
//ASM with two pushes and a call (relative pushes and calls are represented by 0s temporarily)
byte[21] bInject = { 0xFF, 0x35, 0, 0, 0, 0, 0xFF, 0x35, 0, 0, 0, 0, 0xE8, 0, 0, 0, 0, 0x83, 0xC4, 0x08, 0xC3 };
//inject code
WriteProcessMemory(hProcess, lpCodeCave, bInject, sizeof(bInject), NULL);

//transform relative call address and patch
dwSelectUnit = dwSelectUnit - ((DWORD)lpCodeCave + 17);
WriteProcessMemory(hProcess, (void *)((DWORD)lpCodeCave + 13), dwSelectUnit, 4, NULL);

//patch PUSH opcodes to point to correct places
WriteProcessMemory(hProcess, ((DWORD)lpCodeCave + 2), ((DWORD)lpCodeCave + 0x504), 4, NULL);
WriteProcessMemory(hProcess, ((DWORD)lpCodeCave + 8), ((DWORD)lpCodeCave + 0x500), 4, NULL);

//write the GUID to be selected to memory
WriteProcessMemory(hProcess, ((DWORD)lpCodeCave + 0x500), GUID, sizeof(GUID), NULL);

//create the thread that executes our injected code
HANDLE hThread = CreateRemoteThread(hProcess, NULL, 0, (LPTHREAD_START_ROUTINE)lpCodeCave, 0, 0, NULL);
WaitForSingleObject(hThread, INFINITE);
CloseHandle(hThread);</pre>
</blockquote>
<p>Easy enough?  I hope so.</p>
<p><a title="Object.Interact()" href="http://shynd.wordpress.com/2008/06/28/objectinteract/" target="_self">As always, here&#8217;s a link to the next article in this journal.</a></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/shynd.wordpress.com/24/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/shynd.wordpress.com/24/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/shynd.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/shynd.wordpress.com/24/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/shynd.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/shynd.wordpress.com/24/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/shynd.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/shynd.wordpress.com/24/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/shynd.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/shynd.wordpress.com/24/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/shynd.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/shynd.wordpress.com/24/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/shynd.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/shynd.wordpress.com/24/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/shynd.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/shynd.wordpress.com/24/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=shynd.wordpress.com&amp;blog=3977891&amp;post=24&amp;subd=shynd&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://shynd.wordpress.com/2008/06/27/selectunit/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">Shynd</media:title>
		</media:content>
	</item>
		<item>
		<title>Movement</title>
		<link>http://shynd.wordpress.com/2008/06/22/movement/</link>
		<comments>http://shynd.wordpress.com/2008/06/22/movement/#comments</comments>
		<pubDate>Mon, 23 Jun 2008 01:55:02 +0000</pubDate>
		<dc:creator>Shynd</dc:creator>
				<category><![CDATA[World of Warcraft]]></category>
		<category><![CDATA[bot]]></category>
		<category><![CDATA[facing]]></category>
		<category><![CDATA[GameObject]]></category>
		<category><![CDATA[movement]]></category>
		<category><![CDATA[rotation]]></category>
		<category><![CDATA[warcraft]]></category>
		<category><![CDATA[wow bot]]></category>

		<guid isPermaLink="false">http://shynd.wordpress.com/?p=23</guid>
		<description><![CDATA[Well, I don&#8217;t know about the rest of you, but this part is both EXTREMELY tedious to figure out and very, very interesting to me.  Very quick back story: whereas I am pretty good at mathematical concepts, I never passed any high school math higher than Geometry, due to turning in precisely 36% of my [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=shynd.wordpress.com&amp;blog=3977891&amp;post=23&amp;subd=shynd&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Well, I don&#8217;t know about the rest of you, but this part is both EXTREMELY tedious to figure out and very, very interesting to me.  Very quick back story: whereas I am pretty good at mathematical concepts, I never passed any high school math higher than Geometry, due to turning in precisely 36% of my math homework three semesters in a row, so any math Algebra 2 and above I have to teach myself as if it were new (because it <strong>is</strong>).  That makes facing rotation, degrees, radians, tangents, etc., all new-sauce to me.  This article will attempt to make some of these subjects easier for those of you who aren&#8217;t math majors.</p>
<p>As I understand it, there are two ways of measuring rotation: degrees and radians.  As you should all know, there are 360 degrees in a circle (with 0 degrees and 360 degrees meeting at north, 90 degrees being west, 180 degrees being south, and 270 degrees being east&#8230; counter-clockwise, if you will).  What many of you may not know is that there is <strong>π*2</strong> radians in a circle.  That&#8217;s <strong>pi multiplied-by two</strong>, or <strong>3.1415.. + 3.1415..</strong> (which turns out to be approximately 6.3).  A <a title="Wikipedia.org Radian" href="http://en.wikipedia.org/wiki/Radian" target="_blank">radian</a> is exactly <strong>180/</strong><strong>π</strong> degrees, or about 57.2958 degrees.  57.2958 * 3.1415 * 2 == 360.  There&#8217;s the math you need to know.  To go from radians (which is how we will read Object.Facing from WoW&#8217;s memory) to degrees, you need to multiply by 180 and divide by pi.  I hope that&#8217;s clear.  If not, perhaps this will help:<span id="more-23"></span><br />
<img style="vertical-align:middle;" src="http://www.shynd.com/images/wowfacing.jpg" alt="WoWFacing" width="363" height="295" /></p>
<p>Also mentioned in the above picture is something many of you may not have encountered yet, <a title="Wikipedia.org Atan2" href="http://en.wikipedia.org/wiki/Atan2" target="_blank"><strong>atan</strong> or <strong>atan2</strong></a>.  The atan/atan2 function allows us to determine the arctangent between two coordinates, or the measurement, in radians, which we SHOULD be facing in order to face directly at a given point, knowing our own coordinates.  Thankfully, whatever programming language&#8211;in my case, C#&#8211;we&#8217;re using should be doing most of the work.  In C#, <strong>System.Math.Atan2</strong> will give you the cake you&#8217;re so eagerly awaiting.  But, wait!, what if it returns a negative facing value?  WoW only deals with positive facing values!  Simple: add this negative facing value to Math.PI * 2, thus normalizing it.</p>
<p>Was that a lot to deal with?  Yeah, and I&#8217;m sorry.  There&#8217;s more, too: what if we want to determine which way we should turn in order to spend the least amount of time turning?  Well, we need to calculate how many radians (or degrees, if you wish) we&#8217;d need to turn to the left and how many radians we&#8217;d need to turn to the right, then compare the two.</p>
<p>Basically, you set up two if..then statements, and calculate the radians needed to turn depending on which situation you&#8217;re in for each direction.  If your current facing is greater than where you want to face, you&#8217;re going to have to turn past north if you turn left but you won&#8217;t have to turn past north if you turn right; conversely, if your current facing is lesser than the point you wish to be facing, you&#8217;re going to have to rotate past north if you turn to the right, but not if you turn to the left.</p>
<p>If you&#8217;re turning past north&#8211;which is sometimes shorter&#8211;you have to calculate the radians between your current facing and north&#8230; then between north and your goal&#8230; then add those two together to get your total needed rotation.  If you&#8217;re facing at 5.3 and you want to face 1.0, you&#8217;ll need to turn from 5.3 to north (6.3), or 1 radian, and then from north (also 0) to 1, or another 1 radian.  So, turning to the left from 5.3 to 1.0 is 2.0 radians, whereas turning to the right would be 5.3 &#8211; 1.0, or 4.3 radians.  It&#8217;s obvious which turn is shorter.</p>
<p><a title="TurningDirection" href="http://www.nomorepasting.com/getpaste.php?pasteid=17182" target="_blank">This is what mine looks like.</a></p>
<p>Anyway, you should all know, by now, that you can find a unit&#8217;s positional information&#8211;which includes facing direction&#8211;by reading from baseaddress+0xBF0.  +0xBF0 is XCoordinate, +0xBF4 is YCoordinate, +0xBF8 is ZCoordinate, and +0xBFC is FacingDirection.  Once you know your own facing direction, and the coordinates of yourself plus whatever object (or way point) you want to face, you should have no trouble, now, figuring out which way to turn and when to stop turning.  As always, I&#8217;ll post some source along with my article, which should make things just that much easier.  <a title="WoWTestWalkTo" href="http://www.shynd.com/public/WoWTestWalkTo.rar" target="_blank">Here it is, in a .rar format.</a> (Again, you&#8217;ll need my <a title="MemoryLib" href="http://www.shynd.com/public/MemoryLib.rar" target="_blank">MemoryLib C# class library</a>, and you&#8217;ll need to add that as a reference to your project.)</p>
<p>Until next time!</p>
<p><a title="SelectUnit" href="http://shynd.wordpress.com/2008/06/27/selectunit/" target="_self">Click here to read the next post in this journal.</a></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/shynd.wordpress.com/23/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/shynd.wordpress.com/23/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/shynd.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/shynd.wordpress.com/23/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/shynd.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/shynd.wordpress.com/23/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/shynd.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/shynd.wordpress.com/23/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/shynd.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/shynd.wordpress.com/23/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/shynd.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/shynd.wordpress.com/23/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/shynd.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/shynd.wordpress.com/23/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/shynd.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/shynd.wordpress.com/23/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=shynd.wordpress.com&amp;blog=3977891&amp;post=23&amp;subd=shynd&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://shynd.wordpress.com/2008/06/22/movement/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">Shynd</media:title>
		</media:content>

		<media:content url="http://www.shynd.com/images/wowfacing.jpg" medium="image">
			<media:title type="html">WoWFacing</media:title>
		</media:content>
	</item>
		<item>
		<title>GetUnitReaction</title>
		<link>http://shynd.wordpress.com/2008/06/15/getunitreaction/</link>
		<comments>http://shynd.wordpress.com/2008/06/15/getunitreaction/#comments</comments>
		<pubDate>Sun, 15 Jun 2008 16:59:49 +0000</pubDate>
		<dc:creator>Shynd</dc:creator>
				<category><![CDATA[World of Warcraft]]></category>
		<category><![CDATA[faction]]></category>
		<category><![CDATA[GetUnitReaction]]></category>
		<category><![CDATA[hack]]></category>
		<category><![CDATA[hacking]]></category>
		<category><![CDATA[warcraft]]></category>

		<guid isPermaLink="false">http://shynd.wordpress.com/?p=20</guid>
		<description><![CDATA[Okay, this is the big one.  We all want to be able to find out how to determine which enemies are hostile and which enemies are neutral.  Kynox, bless his awesome ass, showed us how to do it in-process here (by in-process, I mean injecting a DLL and calling a game function that compares your [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=shynd.wordpress.com&amp;blog=3977891&amp;post=20&amp;subd=shynd&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Okay, this is the big one.  We all want to be able to find out how to determine which enemies are hostile and which enemies are neutral.  Kynox, bless his awesome ass, showed us how to do it in-process <a title="Regarding Aggro Flag" href="http://www.mmowned.com/forums/wow-memory-editing/128387-kynox-regarding-aggro-flags.html#post841390" target="_blank">here</a> (by in-process, I mean injecting a DLL and calling a game function that compares your faction with the faction of the unit in question).  First, let&#8217;s outline Kynox&#8217;s version.</p>
<p>As of the current patch, 2.4.2, the class method for <strong>CObject-&gt;GetUnitReaction(CObject obj)</strong> is at address 0x005D4AB0 (can be found in <strong>WoWOffsets.h</strong> in the download posted by Kynox in the above link).  Basically, when it&#8217;s called, the two units&#8217; factions are compared and a value representing their reaction is returned (1 for hostile, 3 for neutral, 4 for friendly, etc.). [<em>Note: 1 is actually "extremely hostile" and 3 is actually "hostile", but 1 is fundamentally equivalent to aggressive and 3 is </em><em>fundamentally </em><em> equivalent to </em><em>neutral</em>]<span id="more-20"></span></p>
<p>You&#8217;ll notice that there&#8217;s not two arguments passed to this function; you don&#8217;t call it like <strong>GetUnitReaction(unit1, unit2)</strong>.  That is because it is a <strong>class method</strong>.  You don&#8217;t have to specify unit1 because it is being called <em>as a part of</em> unit1.  It&#8217;s actually called like so: <strong>unit1-&gt;GetUnitReaction(unit2)</strong>.  Therefore, in ASM, the ECX register is set to equal the base address of unit1, and the base address of unit2 is passed as an argument.  This allows the function to compare the two.  Just thought I&#8217;d point that out for those of you who are reverse-engineering the client to see the inner-workings, so to speak (all two of you!).</p>
<p>Now then, how does it compare the two factions: ay, there&#8217;s the rub.  That&#8217;s what everyone wants to know.  Well, let&#8217;s start off with how it finds the factions of the two units.</p>
<p>A unit&#8217;s faction is held at <strong>[[unitBase + 0x120]+0&#215;74]</strong>.  That&#8217;s two memory reads.  In C#, it looks like so:</p>
<blockquote><p><code>int Faction = Memory.ReadUInt(hProcess,(Memory.ReadUInt(hProcess, (curObj + 0x120)) + 0x74));</code></p></blockquote>
<p>Next question: once you get the faction of both units, what do you do?  Well, what the WoW client does is pass unit1&#8242;s faction and unit2&#8242;s base address to the subroutine at address 0x005D1AE0.  For instance, if you&#8217;re a Tauren (tauren faction == 6) and you&#8217;re comparing your faction to the unit at base 0x1DF00008, it&#8217;d look like this: <strong>CompareUnitFaction(6, </strong><strong>0x1DF00008</strong><strong>);</strong> CompareUnitFaction (temporary name until someone comes up with something better) then grabs the unit&#8217;s faction at <strong>[[0x1DF00008+0x120]+0&#215;74]</strong> and compares it with 6.  How does it compare it?  Well, that&#8217;s taken me hours and hours of reverse-engineering to figure out, so I&#8217;ll save you the time and explain it (as I understand it, which may be wrong).</p>
<p>CompareUnitFaction takes the factions of each unit and gets the address of that particular faction&#8217;s data struct in memory.  It does this by doing something like the following (pseudo code):</p>
<blockquote><p><code>int startIndex = *0x93E80C;<br />
DWORD factionPointer = *0x93E818;<br />
DWORD totalFactions = *0x93E808;<br />
DWORD hash1, hash2;<br />
if (unit1.Faction &gt;= startIndex &amp;&amp; unit1.Faction &lt; totalFactions &amp;&amp; unit2.Faction &gt;= startIndex &amp;&amp; unit2.Faction &lt; totalFactions)<br />
{<br />
hash1 = (factionPointer + ((unit1.Faction - startIndex) * 4))<br />
hash2 = (factionPointer + ((unit2.Faction - startIndex) * 4))<br />
return <strong>CompareFactionHash(hash1, hash2);</strong><br />
}</code></p></blockquote>
<p>So, what&#8217;s <strong>CompareFactionHash(hash1, hash2)</strong> do?  Well, it looks through the client&#8217;s faction data struct and compares flags depending on which factions are being compared.  <a title="CompareFactionHash ASM" href="http://www.nomorepasting.com/getpaste.php?pasteid=16878" target="_blank">Here&#8217;s a link to the ASM subroutine.</a> <a title="CompareFactionHash C#" href="http://www.nomorepasting.com/getpaste.php?pasteid=16879" target="_blank">Here&#8217;s a link to my C# implementation of that ASM subroutine (should be understandable, I would think).</a></p>
<p>I&#8217;ve only tested it under the most contained of circumstances, but all tests came back positive.  It seems to be a pretty good way of determining whether a unit is Hostile, Neutral, or Friendly towards you without injecting any code.</p>
<p><a title="C# GetUnitReaction" href="http://www.nomorepasting.com/getpaste.php?pasteid=16880" target="_blank">Here&#8217;s my full C# code</a>; you&#8217;re welcome to convert it to whatever you want, redistribute it, etc., as long as credit is given.</p>
<p>More to come, as always! <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><a title="Movement" href="http://shynd.wordpress.com/2008/06/22/movement/" target="_self">Click here to read the next article in this journal.</a></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/shynd.wordpress.com/20/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/shynd.wordpress.com/20/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/shynd.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/shynd.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/shynd.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/shynd.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/shynd.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/shynd.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/shynd.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/shynd.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/shynd.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/shynd.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/shynd.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/shynd.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/shynd.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/shynd.wordpress.com/20/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=shynd.wordpress.com&amp;blog=3977891&amp;post=20&amp;subd=shynd&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://shynd.wordpress.com/2008/06/15/getunitreaction/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">Shynd</media:title>
		</media:content>
	</item>
		<item>
		<title>Accessing WoW&#8217;s Game Objects</title>
		<link>http://shynd.wordpress.com/2008/06/14/accessing-wows-game-objects/</link>
		<comments>http://shynd.wordpress.com/2008/06/14/accessing-wows-game-objects/#comments</comments>
		<pubDate>Sat, 14 Jun 2008 16:50:58 +0000</pubDate>
		<dc:creator>Shynd</dc:creator>
				<category><![CDATA[World of Warcraft]]></category>
		<category><![CDATA[GameObject]]></category>
		<category><![CDATA[hacking]]></category>
		<category><![CDATA[TLS]]></category>
		<category><![CDATA[warcraft]]></category>

		<guid isPermaLink="false">http://shynd.wordpress.com/?p=10</guid>
		<description><![CDATA[Now, I haven&#8217;t done nearly as much research into this particular part of WoW hacking as I probably should, but I&#8217;m looking at it from a IJW (it just works!) standpoint.  Other people, before you and me, have done the really hard work and we&#8217;re privileged enough to simply ride along atop their findings.  Never&#8211;and [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=shynd.wordpress.com&amp;blog=3977891&amp;post=10&amp;subd=shynd&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Now, I haven&#8217;t done nearly as much research into this particular part of WoW hacking as I probably should, but I&#8217;m looking at it from a IJW (it just works!) standpoint.  Other people, before you and me, have done the really hard work and we&#8217;re privileged enough to simply ride along atop their findings.  Never&#8211;and I mean <strong>never</strong>&#8211;let their work go unappreciated.</p>
<p>WoW stores its game objects inside what&#8217;s called its Thread Local Storage (hereafter referred to as <strong>TLS</strong>).  There&#8217;s pointers to pointers to its linked-list of game objects (hereafter referred to as the <strong>object manager</strong>) but, thanks to Kynox, we can make it VERY easy to access the object manager inside WoW&#8217;s TLS.  Seriously, any time you have the opportunity, thank Kynox.  This method is so much easier than any of the others I&#8217;ve come across.<span id="more-10"></span></p>
<p>So, as of the current patch on June 14th, 2008, (2.4.2 I think?), there is a pointer to the object manager at [0x00D495B0]+0&#215;2218.  See <a title="Accessing WoW's Object Manager" href="http://www.mmowned.com/forums/wow-memory-editing/127839-proof-concept-dwfindpattern-tls-c.html" target="_blank">this thread</a> on how I access the object manager in my application.  Basically, if you are content with your tool only working for the current version of the client and you don&#8217;t mind having to manually update for new client versions, just read from memory like so:</p>
<ul>
<li>Define a DWORD variable named <strong>g_clientConnection</strong> and read from 0x00D495B0 into it.</li>
<li>Define another DWORD variable named <strong>s_curMgr</strong> and read from ( g_clientConnection + 0&#215;2218 ) into it.</li>
<li>s_curMgr is now your pointer to the object manager.</li>
</ul>
<p>Now that we have our object manager, we can start reading objects from the linked-list.  I now turn you over to <a title="Kynox's WoW Object Dumper" href="http://www.mmowned.com/forums/wow-memory-editing/124819-source-wow-object-dumper.html" target="_blank">Kynox&#8217;s WoW Object Dumper</a> so you can peruse its source, which I will also outline in just a second.</p>
<p>Once you have your object manager pointer, you can read from ( s_curMgr + 0xC0 ) and gain your localGUID (it&#8217;s an int64, not a DWORD).  Save this so you can compare it to the GUIDs in the linked-list and determine which is your own (useful for teleportation hacks, setting your facing direction by writing to memory, etc.).</p>
<p>Read from ( s_curMgr + 0xAC ) for a pointer to the start of the linked-list.  Each object in the linked-list contains a pointer to the next object, so we&#8217;re going to need two DWORD variables here: <strong>curObj</strong> and <strong>nextObj</strong>. We&#8217;ll loop through the list, reading information from curObj, including a pointer to nextObj, determine if nextObj is valid, and then setting our current object (curObj) to the next one in the list (nextObj) and doing it all over again, only stopping when nextObj is null.  This is all a part of Kynox&#8217;s WoW Object Dumper, but I will show you my C# source for the same exact thing <a title="Shynd's C# WoW Object Dumper" href="http://www.nomorepasting.com/getpaste.php?pasteid=16843" target="_blank">here</a>.  You can find the Memory library in use in that example <a title="Shynd's C# MemoryLib" href="http://www.shynd.com/public/MemoryLib.rar" target="_blank">here</a>.</p>
<p>This allows you access to the positional data on all of the loaded objects.  This is as far as I have currently gotten, but I will be pushing on very, very soon.  Stay tuned.</p>
<p><a title="GetUnitReaction" href="http://shynd.wordpress.com/2008/06/15/getunitreaction/" target="_self">Read my next post in this journal here.</a></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/shynd.wordpress.com/10/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/shynd.wordpress.com/10/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/shynd.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/shynd.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/shynd.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/shynd.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/shynd.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/shynd.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/shynd.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/shynd.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/shynd.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/shynd.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/shynd.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/shynd.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/shynd.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/shynd.wordpress.com/10/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=shynd.wordpress.com&amp;blog=3977891&amp;post=10&amp;subd=shynd&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://shynd.wordpress.com/2008/06/14/accessing-wows-game-objects/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">Shynd</media:title>
		</media:content>
	</item>
		<item>
		<title>Starting Out</title>
		<link>http://shynd.wordpress.com/2008/06/14/starting-out/</link>
		<comments>http://shynd.wordpress.com/2008/06/14/starting-out/#comments</comments>
		<pubDate>Sat, 14 Jun 2008 16:10:30 +0000</pubDate>
		<dc:creator>Shynd</dc:creator>
				<category><![CDATA[World of Warcraft]]></category>
		<category><![CDATA[hacking]]></category>
		<category><![CDATA[warcraft]]></category>
		<category><![CDATA[warden]]></category>

		<guid isPermaLink="false">http://shynd.wordpress.com/?p=9</guid>
		<description><![CDATA[Where to start?  Oh, that&#8217;s right, the gathering of information. Firstly, let&#8217;s start with talking about what we&#8217;re going to need to know, based on what we want to do. If we&#8217;re building a bot/tool for retail WoW, we&#8217;re going to want to know as much as possible about Warden. We&#8217;re obviously going to need [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=shynd.wordpress.com&amp;blog=3977891&amp;post=9&amp;subd=shynd&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Where to start?  Oh, that&#8217;s right, the gathering of information.</p>
<p>Firstly, let&#8217;s start with talking about what we&#8217;re going to need to know, based on what we want to do.</p>
<ul>
<li>If we&#8217;re building a bot/tool for retail WoW, we&#8217;re going to want to know as much as possible about <em>Warden</em>.</li>
<li>We&#8217;re obviously going to need a method of gathering the information we need from the client (memory-reading).</li>
<li>If we&#8217;re thinking about injecting a DLL into the WoW client, we should probably research whether or not WoW has anti-injection methods in place (it does!).</li>
</ul>
<p>Now, personally, I am not going to talk much about Warden on this blog.  I&#8217;m not looking to create my tool for retail WoW (yet) and I do not really want to spread what may be construed as misinformation due to the lack of proven knowledge about <em>Warden</em>.  Suffice it to say that doing ANYTHING to guard against <em>Warden </em>is far better than doing nothing.  Here&#8217;s a few pointers that may help, but also may not:<span id="more-9"></span></p>
<ol>
<li>If you inject code, you had better figure out how to tell when Warden is scanning your memory modifications.  One way would be to catch <em>Warden </em>as it is initialized and hook its memory-reading routine so you can tell where it&#8217;s reading and shut off your tool or crash all of WoW if it&#8217;s about to read any of your hooks or the base of your injected code.  If you inject a DLL, unlink your module (search gamedeception.net for unlinking modules). [<em>Kynox has pointed out that Warden scans through modules using the Process Page List, currently, so unlinking your module won't achieve much.  Instead, look into nulling your module's EAT, which will make you harder to detect but will screw up ejecting your module.</em>]</li>
<li>If you&#8217;re injecting a DLL but not hooking any functions, it may be useful to simply set up a <strong>Vectored Exception Handler</strong>, then set protected memory chunks right before and right after your module.  Assuming <em>Warden </em>would scan through memory in ~0&#215;1000 byte chunks, an exception will be thrown whenever it&#8217;s getting close to your module, allowing you to handle that exception and then uninject / crash WoW so that you don&#8217;t get detected.  Of course, Exception Handlers are probably detectable by themselves, so you might want to research that, as well.  I&#8217;ve never used this method so I&#8217;m sorry that I cannot give you more information.</li>
<li>If you&#8217;re injecting a DLL and hooking game routines, for God&#8217;s sake don&#8217;t use the <strong>Microsoft Detours</strong> library (either v1.5 or v2.1).  This library is notorious for being used in game hacks and a very simple scan+hash can be used to determine whether it resides inside the client or not.  Seriously, write your own detour library and keep it private or randomize it in some way if you&#8217;re going to detour/hook game routines.</li>
<li>Randomize the title, classname, CRC, and process name of your main hack window.  Part of what <em>Warden </em>does is scan open windows and processes and it&#8217;d be stupid to get caught for using something that is on its blacklist when these things are so easy to change.  [<em>Kynox also pointed out that the current version of Warden doesn't scan anywhere outside of WoW.exe, so this is probably less than helpful as well... still, so easy it couldn't hurt just in case Warden starts doing this again, I suppose (which, personally, I doubt, since they've taken so much flak over scanning open windows in the past).</em>]</li>
</ol>
<p>Also, if you&#8217;re planning to inject a DLL, know that WoW seems to hook <strong>CreateRemoteThread </strong>(from what I&#8217;ve read, only, as I&#8217;ve never attempted to use CreateRemoteThread with WoW), so that method of DLL injection is out.  What I would suggest is to create a small, harmless DLL with a generic windows hook in it (search google or codeproject.com for <strong>SetWindowsHookEx injection</strong>) that, when it detects it has been loaded into the WoW client, simply calls LoadLibrary from within the client memory space to load your actual hacking DLL.  Then the harmless DLL can unset the windows hook and disappear into the mists as its job is already done.  [<em>Xarg0 has pointed out that he's capable of injecting his DLL using VirtualAllocEx and CreateRemoteThread, just like normal, so perhaps they've stopped doing this.  I read this on gamedeception.net and, as stated, have never tried, so I don't know =p</em> <em>Test it for yourselves</em>]</p>
<p>Alternatively, you could have the harmless DLL simply allocate enough memory and then map your hack dll into memory without using LoadLibrary (less detectable), then create a thread on whatever initialization your hack has to do (detouring functions, etc.).  Circumventing LoadLibrary keeps your module out of the linked module list, also, plus this would be a good time to set protections on the memory region right before and right after your module and set up the <strong>Vectored Exception Handler</strong> as anti-scanning protection.  Just a thought.</p>
<p>I suppose you could also research some of the undocumented kernel functions that do the actual work when CreateRemoteThread is called and circumvent WoW&#8217;s hold on that API, thus injecting your DLL just like any other, but I leave that up to you to research.</p>
<p>My next post will outline how to access the client&#8217;s linked-list of game objects, allowing us to see what&#8217;s around our player (bot) or access our own game object (teleportation, etc.).</p>
<p><a title="Accessing WoW's Game Objects" href="http://shynd.wordpress.com/2008/06/14/accessing-wows-game-objects/" target="_self">Read my next post in this journal here.</a></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/shynd.wordpress.com/9/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/shynd.wordpress.com/9/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/shynd.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/shynd.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/shynd.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/shynd.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/shynd.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/shynd.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/shynd.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/shynd.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/shynd.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/shynd.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/shynd.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/shynd.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/shynd.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/shynd.wordpress.com/9/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=shynd.wordpress.com&amp;blog=3977891&amp;post=9&amp;subd=shynd&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://shynd.wordpress.com/2008/06/14/starting-out/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">Shynd</media:title>
		</media:content>
	</item>
		<item>
		<title>Introduction</title>
		<link>http://shynd.wordpress.com/2008/06/14/introduction/</link>
		<comments>http://shynd.wordpress.com/2008/06/14/introduction/#comments</comments>
		<pubDate>Sat, 14 Jun 2008 15:20:56 +0000</pubDate>
		<dc:creator>Shynd</dc:creator>
				<category><![CDATA[World of Warcraft]]></category>
		<category><![CDATA[GameObject]]></category>
		<category><![CDATA[hack]]></category>
		<category><![CDATA[hacking]]></category>
		<category><![CDATA[TLS]]></category>
		<category><![CDATA[warcraft]]></category>
		<category><![CDATA[warden]]></category>

		<guid isPermaLink="false">http://shynd.wordpress.com/?p=4</guid>
		<description><![CDATA[So, three weeks ago (around the end of May, 2008), I decided, on a whim, to check back in on the WoW hacking scene.  I spent the next week, or so, bookmarking and consolidating all of the useful information that I found.  One week, just gathering information.  This journal is going to be an attempt [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=shynd.wordpress.com&amp;blog=3977891&amp;post=4&amp;subd=shynd&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>So, three weeks ago (around the end of May, 2008), I decided, on a whim, to check back in on the WoW hacking scene.  I spent the next week, or so, bookmarking and consolidating all of the useful information that I found.  One week, just gathering information.  This journal is going to be an attempt to consolidate some of that information in a slightly more self-contained format, as well as share some of my methods and (perhaps!) insights into creating different WoW tools&#8211;personally, I&#8217;m heading towards the bot end of the spectrum, but what is contained here should be useful to almost anyone, as well.<span id="more-4"></span></p>
<p>In the next few posts, I will try to recount the steps I have already taken towards the goal so that you will have a good starting point.  I hope the journey for all involved is a learning experience.</p>
<p><a title="Starting Out" href="http://shynd.wordpress.com/2008/06/14/starting-out/" target="_self">Read my next post in this journal here.</a></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/shynd.wordpress.com/4/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/shynd.wordpress.com/4/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/shynd.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/shynd.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/shynd.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/shynd.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/shynd.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/shynd.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/shynd.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/shynd.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/shynd.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/shynd.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/shynd.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/shynd.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/shynd.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/shynd.wordpress.com/4/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=shynd.wordpress.com&amp;blog=3977891&amp;post=4&amp;subd=shynd&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://shynd.wordpress.com/2008/06/14/introduction/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">Shynd</media:title>
		</media:content>
	</item>
	</channel>
</rss>
