Hacking Grand Theft Auto IV: Part III

Another feature set provided by the Games For Windows API is various functions for “protecting” data (hashing & validating). GTA IV uses these functions to hash and validate its save files. I’m not exactly sure how these functions work exactly — other than the fact that the one we are interested in, XLiveUnprotectData, is called in a peculiar way.

It’s called twice, with five arguments, none of these arguments point at the save data itself, but at the 360 byte blob at the end of the save file. I suspect that this process is actually decrypting some memory rather than hashing the save itself, the end result is that a CRC32 hash of a part of the save is extracted, then compared against. By hashing the save and providing the valid CRC32 in the result of a replaced XLiveUnprotectData we can get past this validation, allow us to load other people’s saves as well as letting us modify our saves.

For the new version of the wrapper:

  • Multiplayer functionality of GTA IV is now forcefully disabled, to prevent usage of my wrapper to cheat in multiplayer. Yeah, sorry, I’m not going to encourage it.
  • Protected buffers have slightly changed to better organize them, they are a single block of data rather than two now (this is only really useful if you’re writing a trainer for use with my wrapper).
  • A new tool, CopyXLiveResources, is now provided to fix the invisible Games For Windows interface in-game. You do not have to use this tool if you do not want to.
  • Save validation is now disabled, you can load any save. Note: This will not magically fix any form of corruption on your save files if they are corrupted.

Note: the save validation “feature” of this version of my wrapper now potentially makes it incompatible with any other game, and previous version of GTA IV. This version of the wrapper was made with GTA IV 1.0.1.0 in mind, if there are compatibility issues with previous versions I have no plans to support them.

XLive Wrapper (1.2.0.7) for GTA IV (1.0.1.0)

I have only tested my wrapper locally. There could be unforeseen issues that I have not expected, if you experience any bugs feel free to comment this post.

Tags: ,

203 Responses to “Hacking Grand Theft Auto IV: Part III”

  1. YSS says:

    My problem is the following..
    I installed the patch 1.0.1.0, and have auto login activated (Windows Live)
    If i copy the two files into the gta iv main folder (with GTA IV.exe and so on) and i run the copyXlive…exe, the xlive.dll size is ~‎8,5 mb. I think thats ok so far..
    But if i want to start GTA IV, (from the folder with: GTAIVlauncher, GTA IV.exe and Social club) the game crashes… i will get kicked back to my desktop and a window appears with the following text inside: “GTA IV.exe has caused problem and needs to close”. I dont know what to do… :-(

    My OS: Windows vista Home premium x64 (-bit)

    does anybody know the solution for that problem?
    Thanks in advance!

Leave a Reply