<?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/"
	>

<channel>
	<title>Rick's Game Stuff &#187; File Formats</title>
	<atom:link href="http://blog.gib.me/tag/file-formats/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.gib.me</link>
	<description>Games, mods &#38; modding.</description>
	<lastBuildDate>Thu, 22 Jul 2010 11:37:06 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Borderlands Save Editor (Revision 10)</title>
		<link>http://blog.gib.me/2009/10/31/borderlands-save-editor-revision-10/</link>
		<comments>http://blog.gib.me/2009/10/31/borderlands-save-editor-revision-10/#comments</comments>
		<pubDate>Sun, 01 Nov 2009 04:42:45 +0000</pubDate>
		<dc:creator>Rick</dc:creator>
				<category><![CDATA[Borderlands]]></category>
		<category><![CDATA[File Formats]]></category>
		<category><![CDATA[Hacking]]></category>
		<category><![CDATA[Tools]]></category>

		<guid isPermaLink="false">http://blog.gib.me/?p=204</guid>
		<description><![CDATA[Newer build of my Borderlands save editor, fixes the problem with editing Roland (Soldier) saves, as well as several other minor changes and fixes. Download If you encounter any problems (crashes, etc), feel free to comment this post.]]></description>
			<content:encoded><![CDATA[<p>Newer build of my Borderlands save editor, fixes the problem with editing Roland (Soldier) saves, as well as several other minor changes and fixes.</p>
<p><a href="http://blog.gib.me/wp-content/uploads/2009/10/saveedit1.png"><img class="alignnone size-full wp-image-205" title="Borderlands Save Editor" src="http://blog.gib.me/wp-content/uploads/2009/10/saveedit1.png" alt="Borderlands Save Editor" width="640" height="380" /></a></p>
<p><a href="http://blog.gib.me/wp-content/uploads/2009/10/saveedit-rev10.zip">Download</a></p>
<p>If you encounter any problems (crashes, etc), feel free to comment this post.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.gib.me/2009/10/31/borderlands-save-editor-revision-10/feed/</wfw:commentRss>
		<slash:comments>1546</slash:comments>
		</item>
		<item>
		<title>Borderlands Save Editor (Revision 9)</title>
		<link>http://blog.gib.me/2009/10/30/borderlands-save-editor-revision-9/</link>
		<comments>http://blog.gib.me/2009/10/30/borderlands-save-editor-revision-9/#comments</comments>
		<pubDate>Fri, 30 Oct 2009 20:17:33 +0000</pubDate>
		<dc:creator>Rick</dc:creator>
				<category><![CDATA[Borderlands]]></category>
		<category><![CDATA[File Formats]]></category>
		<category><![CDATA[Hacking]]></category>
		<category><![CDATA[Tools]]></category>

		<guid isPermaLink="false">http://blog.gib.me/?p=196</guid>
		<description><![CDATA[Made an editor for Borderlands saves; seems stable enough for public consumption now. Download See new post for a new build. If you encounter any problems (crashes, etc), feel free to comment this post.]]></description>
			<content:encoded><![CDATA[<p>Made an editor for Borderlands saves; seems stable enough for public consumption now.</p>
<p><a href="http://blog.gib.me/wp-content/uploads/2009/10/saveedit.png"><img class="alignnone size-full wp-image-200" title="Borderlands Save Editor" src="http://blog.gib.me/wp-content/uploads/2009/10/saveedit.png" alt="Borderlands Save Editor" width="640" height="380" /></a></p>
<p><span style="text-decoration: line-through;">Download</span> <a href="http://blog.gib.me/2009/10/31/borderlands-save-editor-revision-10/">See new post for a new build.</a></p>
<p>If you encounter any problems (crashes, etc), feel free to comment this post.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.gib.me/2009/10/30/borderlands-save-editor-revision-9/feed/</wfw:commentRss>
		<slash:comments>36</slash:comments>
		</item>
		<item>
		<title>Left4Dead *.vpk Extraction Tools, Updated</title>
		<link>http://blog.gib.me/2009/07/07/left4dead-vpk-extraction-tools-updated/</link>
		<comments>http://blog.gib.me/2009/07/07/left4dead-vpk-extraction-tools-updated/#comments</comments>
		<pubDate>Tue, 07 Jul 2009 07:09:19 +0000</pubDate>
		<dc:creator>Rick</dc:creator>
				<category><![CDATA[Left 4 Dead]]></category>
		<category><![CDATA[Steam]]></category>
		<category><![CDATA[Valve]]></category>
		<category><![CDATA[File Formats]]></category>
		<category><![CDATA[Hacking]]></category>
		<category><![CDATA[Tools]]></category>

		<guid isPermaLink="false">http://blog.gib.me/?p=166</guid>
		<description><![CDATA[A newer build of my VPK tool. This fixes support for the newer VPK format that was introduced recently in Left4Dead.]]></description>
			<content:encoded><![CDATA[<p><a href="http://blog.gib.me/wp-content/uploads/2009/07/extractpackage3.zip">A newer build of my VPK tool</a>. This fixes support for the newer VPK format that was introduced recently in Left4Dead.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.gib.me/2009/07/07/left4dead-vpk-extraction-tools-updated/feed/</wfw:commentRss>
		<slash:comments>58</slash:comments>
		</item>
		<item>
		<title>Hacking Grand Theft Auto IV</title>
		<link>http://blog.gib.me/2008/12/09/hacking-grand-theft-auto-iv/</link>
		<comments>http://blog.gib.me/2008/12/09/hacking-grand-theft-auto-iv/#comments</comments>
		<pubDate>Tue, 09 Dec 2008 12:00:13 +0000</pubDate>
		<dc:creator>Rick</dc:creator>
				<category><![CDATA[Grand Theft Auto IV]]></category>
		<category><![CDATA[File Formats]]></category>
		<category><![CDATA[Hacking]]></category>

		<guid isPermaLink="false">http://blog.gib.me/?p=56</guid>
		<description><![CDATA[A week ago Grand Theft Auto IV came out for the PC, since then I&#8217;ve been trying to poke about at things, the first thing I saw that I wanted to try was to edit the save files. I found the save files nestled in C:\Users\Rick\AppData\Local\Rockstar Games\GTAIV\savegames. You&#8217;ll likely find several subdirectories there, following the [...]]]></description>
			<content:encoded><![CDATA[<p>A week ago Grand Theft Auto IV came out for the PC, since then I&#8217;ve been trying to poke about at things, the first thing I saw that I wanted to try was to edit the save files.</p>
<p>I found the save files nestled in <code>C:\Users\Rick\AppData\Local\Rockstar Games\GTAIV\savegames</code>. You&#8217;ll likely find several subdirectories there, following the format of <code>user_&lt;16 byte Live user ID&gt;</code>. Under one of these directories you find files following the scheme of <code>SGTA4&lt;index&gt;</code>.</p>
<p>Taking a look at these saves, the data is unencrypted and in a very obvious format. Unfortunately you cannot directly edit them, GTAIV makes use of some hashing features built into xlive.dll (Games for Windows &#8211; Live).</p>
<p>There is a 360 (coincidence?) byte footer to each GTAIV save file &#8212; this makes up two blocks. A 296 byte block, and a 64 byte block. I&#8217;m not sure about the 296 byte block, but the 64 bit block is likely a hash of the save data.</p>
<p>I set an obvious way to try and edit the save data: change the amount of money you have.</p>
<p>Looking at the structure of the save data, the amount of cash you have is in the second block of data in the save (PlayerInfo), there appear to be two values for money &#8212; one is probably total cash while the other is current cash. They are <code>0x1EA</code> and <code>0x1F2</code> bytes from the start of the save file (due to the structure of the file, these offsets are unlikely to change).</p>
<p>Out of all the attempts I made in trying to edit a save file &#8212; the one I ended up with was pretty much a massive hack. xlive.dll has some protections enabled that make tampering with a running game a bad idea (crashing, not functioning properly, among other things). I dug deep enough to discover that I could essentially break a part of xlive.dll to make it possible to modify GTAIV code. When GTAIV calls xlive.dll to do something (in this instance, hash a save file), xlive.dll does a check on the calling process to make sure it hasn&#8217;t been modified. The offending function is called XLivepVerifyAddress (xlive.dll+0xA6354, according to xlive.pdb <img src='http://blog.gib.me/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> .</p>
<p>I broke this function (by making it always return 0), hooked the function that hashes save data (GTAIV.exe+0x18C180), a pointer to the save data being the first argument.</p>
<p>Starting the game with my changes (done at runtime, no modification to files of course, via loader + injected DLL), I load my game, something crashes (another thread, perhaps), the game continues to run fine. I save.</p>
<p>The end result?</p>
<p>A save file with its cash altered to $10,000,000, with a valid hash.</p>
<p><a href="http://blog.gib.me/wp-content/uploads/2008/12/millions.jpg"><img class="alignnone size-medium wp-image-57" title="Millions" src="http://blog.gib.me/wp-content/uploads/2008/12/millions-300x187.jpg" alt="" width="300" height="187" /></a></p>
<p>(shortly after purchasing a <span style="text-decoration: line-through;">fancy</span> hat with my new money in a relatively new game)</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.gib.me/2008/12/09/hacking-grand-theft-auto-iv/feed/</wfw:commentRss>
		<slash:comments>25</slash:comments>
		</item>
		<item>
		<title>GCFScape now supports VPK archives</title>
		<link>http://blog.gib.me/2008/11/24/gcfscape-now-supports-vpk-archives/</link>
		<comments>http://blog.gib.me/2008/11/24/gcfscape-now-supports-vpk-archives/#comments</comments>
		<pubDate>Mon, 24 Nov 2008 08:40:45 +0000</pubDate>
		<dc:creator>Rick</dc:creator>
				<category><![CDATA[Left 4 Dead]]></category>
		<category><![CDATA[Valve]]></category>
		<category><![CDATA[File Formats]]></category>
		<category><![CDATA[Made by someone else]]></category>
		<category><![CDATA[Tools]]></category>

		<guid isPermaLink="false">http://blog.gib.me/?p=48</guid>
		<description><![CDATA[GCFScape can be found here.]]></description>
			<content:encoded><![CDATA[<p><a href="http://nemesis.thewavelength.net/index.php?p=26">GCFScape can be found here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.gib.me/2008/11/24/gcfscape-now-supports-vpk-archives/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Left4Dead *.vpk Extraction Tools, now with UI</title>
		<link>http://blog.gib.me/2008/11/14/left4dead-vpk-extraction-tools-now-with-ui/</link>
		<comments>http://blog.gib.me/2008/11/14/left4dead-vpk-extraction-tools-now-with-ui/#comments</comments>
		<pubDate>Fri, 14 Nov 2008 09:58:21 +0000</pubDate>
		<dc:creator>Rick</dc:creator>
				<category><![CDATA[Left 4 Dead]]></category>
		<category><![CDATA[Steam]]></category>
		<category><![CDATA[Valve]]></category>
		<category><![CDATA[File Formats]]></category>
		<category><![CDATA[Hacking]]></category>
		<category><![CDATA[SVN]]></category>
		<category><![CDATA[Tools]]></category>

		<guid isPermaLink="false">http://blog.gib.me/?p=38</guid>
		<description><![CDATA[A newer build of my VPK tool that now includes a UI. It also fixes handling of the &#8216;small data&#8217; in the directory file that most *.vmt files were using instead of real files in one of the other package files. Please report any issues in comments, thanks. Edit: See this newer post for a [...]]]></description>
			<content:encoded><![CDATA[<p><span style="text-decoration: line-through;">A newer build of my VPK tool that now includes a UI</span>. It also fixes handling of the &#8216;small data&#8217; in the directory file that most *.vmt files were using instead of real files in one of the other package files. Please report any issues in comments, thanks. <strong>Edit: <a href="http://blog.gib.me/2009/07/07/left4dead-vpk-extraction-tools-updated/">See this newer post for a newer build of tools</a>.</strong></p>
<p><a href="http://svn.gib.me/public/valve/trunk/">The code for this is also now available on SVN</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.gib.me/2008/11/14/left4dead-vpk-extraction-tools-now-with-ui/feed/</wfw:commentRss>
		<slash:comments>68</slash:comments>
		</item>
		<item>
		<title>Left4Dead *.vpk Extraction Tools Test</title>
		<link>http://blog.gib.me/2008/11/13/left4dead-vpk-extraction-tools-test/</link>
		<comments>http://blog.gib.me/2008/11/13/left4dead-vpk-extraction-tools-test/#comments</comments>
		<pubDate>Fri, 14 Nov 2008 02:44:17 +0000</pubDate>
		<dc:creator>Rick</dc:creator>
				<category><![CDATA[Left 4 Dead]]></category>
		<category><![CDATA[Steam]]></category>
		<category><![CDATA[Valve]]></category>
		<category><![CDATA[File Formats]]></category>
		<category><![CDATA[Hacking]]></category>
		<category><![CDATA[Tools]]></category>

		<guid isPermaLink="false">http://blog.gib.me/?p=28</guid>
		<description><![CDATA[Here are some test binaries for extracting data from the *.vpk packages recently seen in the Left4Dead demo. Edit: See this newer post for a newer build of tools. To use: Extract the *.dll and *.exe files to a directory, it doesn&#8217;t matter where. Click + dragdrop a _dir.vpk file onto Gibbed.Valve.ExtractPackage.exe. Files will be [...]]]></description>
			<content:encoded><![CDATA[<p><span style="text-decoration: line-through;">Here are some test binaries for extracting data from the *.vpk packages recently seen in the Left4Dead demo</span>. <strong>Edit: <a href="http://blog.gib.me/2009/07/07/left4dead-vpk-extraction-tools-updated/">See this newer post for a newer build of tools</a>.</strong></p>
<p>To use:</p>
<ol>
<li>Extract the *.dll and *.exe files to a directory, it doesn&#8217;t matter where.</li>
<li>Click + dragdrop a _dir.vpk file onto Gibbed.Valve.ExtractPackage.exe.</li>
<li>Files will be extracted to the directory the file you dragged is in, or the current directory if you invoke ExtractPackage in a console window.</li>
</ol>
<p>I will probably get around to making a tool with a UI, but for now, this works. Source will also be provided pretty soon.</p>
<p>If any of you encounter any bugs please leave a comment here with information. This tool was tested with the most recent version of the Left4Dead demo, and may break with the full game files once it is out.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.gib.me/2008/11/13/left4dead-vpk-extraction-tools-test/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
