Author Topic: Finding compression/encryption between two files  (Read 1856 times)

Offline Atariangamer

  • Dormant User
  • Snot Lord
  • *****
  • Thank You
  • -Given: 31
  • -Receive: 55
  • Posts: 11809
  • Keelah se'lai
Finding compression/encryption between two files
« on: May 10, 2012, 03:42:21 AM »
Okay, random question.

I have a file that is either encrypted, compressed, or both. I also have this same file decrypted, decompressed, or both.

Is there any way to find out exactly what's different between the two files?
Don't remember me as I was...I was an idiot.

Offline matthias720

  • Mr. Whaleware
  • Snot Lord
  • *****
  • Thank You
  • -Given: 52
  • -Receive: 33
  • Posts: 9189
  • Up! Up! And ...
Re: Finding compression/encryption between two files
« Reply #1 on: May 10, 2012, 08:52:28 AM »
Hmm... The only thing I can think of, is that their checksum should be different.
:whale :caineware :ninjaware :whale :caineware :ninjaware

Offline Atariangamer

  • Dormant User
  • Snot Lord
  • *****
  • Thank You
  • -Given: 31
  • -Receive: 55
  • Posts: 11809
  • Keelah se'lai
Re: Finding compression/encryption between two files
« Reply #2 on: May 10, 2012, 12:34:06 PM »
definitely...But it doesn't matter.

I think I found a way around it, so I don't even need this.
Don't remember me as I was...I was an idiot.

Offline ChexCommander

  • #1 Bro President
  • Multiplayer Team Leader
  • Snot Lord
  • *****
  • Thank You
  • -Given: 70
  • -Receive: 19
  • Posts: 10519
  • Stay classy, cats...stay classy
Re: Finding compression/encryption between two files
« Reply #3 on: May 10, 2012, 04:44:35 PM »
Encrypted/Compressed, eh? Makes me curious as to the subject matter.
"I don't cook, either. Not as long as they still deliver pizza." -Tiger Woods

Offline Atariangamer

  • Dormant User
  • Snot Lord
  • *****
  • Thank You
  • -Given: 31
  • -Receive: 55
  • Posts: 11809
  • Keelah se'lai
Re: Finding compression/encryption between two files
« Reply #4 on: May 10, 2012, 07:28:51 PM »
Half-Life 2, Xbox modding.

*cough*



Who knows, you guys might could help. I've seen people try and fail at this, so its probably a lost cause. But here's the down low:

On the HL2 disc is a loader program, the HL2 program, and two folders: Loader and Game.
The loader program follows a text file in the loader directory that copies a game data file and a language data file to a temporary partition on the hard disk. It also copies the intro videos over so that they play smoothly while the game data gets loaded.

After that, the HL2 program takes over, reading files both from the disc and the HDD cache that was just 'installed' by the loader. After a map unloads, this cache is deleted.

Now, the engine never pulls game data from the disc: only generic sound files and the maps load from disc. The map that is being used currently gets copied to the HDD for faster loading. Then all models, animations, textures, etc...as well as the localized voice files, get pulled from the files that were 'installed' in the loader.


Some things known: after the loader copies the data files, the source files on the disk never get touched again. In fact, the HL2 program doesn't check to make sure the files aren't modified: it just looks at the hard drive in a set location.
The structure of the data files on the HDD is known, and they can be read and even extracted.
Only one program is capable of even beginning to add things to these data files, and it was never fully completed, and has loads of bugs that can sometimes cause the game to lock the system instead of doing anything else.


Now where the encryption/compression comes in...the data files on the HDD are in a .xzp format. This is like a GCF on the PC version, and someone, using hex, was able to pull out enough header data to let GCFscape be able to read these files. The main file is about 400MB, give or take.

The weird part? the disc only contains .xz_ files. They are nearly half the size of the .xzp files that end up on the hard drive, and they aren't compressed by any normal means.
Even weirder, it seems to be part of the loader program. The 'install' text file in the loader folder merely says to copy the .xz_ file to a location on the HDD, renaming it to .xzp. It does so, but it has an added step.


I found a way to get around this, but again, after any manner of editing the .xzp with the tool, it locks the game instead of loading it.


Even worse, a very very VERY early Source SDK is required to compile the Xbox specific formats. AFAIK, its just got some very particular compression to aid the fact that there's only 64MB RAM on the system...Shared. <_>.
Now what's crazy is that after searching a whole lot, I found what appears to be source code from 2005 (the time that the Xbox version of HL2 was released) of the Source SDK tools. Not hammer or anything, but it has the vrad and vtf tools, all of which have either xbox versions or xbox switches that would let them create/decompile xbox compatibile stuff. And as I've only had the absolute in ground level C++, I can't make heads or tails of it. Not to mention it recommends in these source files to use VC++2003? <_>

So yeah! That's whats up.
Don't remember me as I was...I was an idiot.

 


Web Hosting by InMotion Hosting