Page 1 of 1

Resident Evil 3 - Decrypting

Posted: Thu Mar 23, 2006 3:26 am
by Strobe
Ive made a long way on this format.
The files are encrypted with XOR. thats simple. however,
they use 2 Different XORs per file. and all files have 2 headers.
one encryption header, and one file header.

the Encryption header itself is XOR by using the 16th byte value
in the header.

however I have not yet found out what is making out the second
XOR value for the rest of the file.

here is an example of a WAVE file found in rofs15.dat
, you see the here that i have the first header decrypted by XORing
it with 6. and the rest of the file with value of 152.

and it is for sure a WAVE file. however, the 152 value was almost
bruteforced from my side. anyone else has something to come with? :/

Cheers...

Posted: Thu Mar 23, 2006 3:26 am
by Strobe
Decrypted.

Complete explanation?

Posted: Tue Mar 06, 2007 9:02 pm
by PmData
Hello,

Could you please write down a complete explanation of how to decrypt the files, in the wiki for example?

Archive has also compression for some files.

Posted: Wed Apr 25, 2007 9:42 pm
by PmData
I figured now how you did it. In fact, rofs15.dat archive contains WAV file as you said, and all files starts with 'RIFF' string, so it's easy to xoring it against the crypted value to find the key (single byte).

Now we need to find how this key is selected.

I started writing a wiki page about it, will rewrite it for xentax once I got it:
http://rewiki.regengedanken.de/wiki/.DA ... _Evil_3%29

As you can see the 'NotComp' string you found may refer to the fact that the file is not compressed. Other files I found have 'Hi_Comp' as string, and are not like what they should be (for example TIM files), so it may mean they are compressed.

Found decryption algorithm!

Posted: Mon Apr 30, 2007 11:02 pm
by PmData
Hello,

I finally found how decryption is done. I will post an example routine later on rewiki. Here is one of the background images (640x480 JPEG image directly from a rofs.dat file).

Example decryption routine

Posted: Tue May 01, 2007 9:18 am
by PmData
Hello,

For people interested, an example decryption routine is available at:
http://rewiki.regengedanken.de/wiki/.DA ... _Evil_3%29

Now, I need to do the same with the optionnal decompression step.

Posted: Sat May 19, 2007 10:37 pm
by PmData
I finished writing a base documentation for the rofs<n>.dat file archives.

However, I wonder if I should also add some pseudo-code for decryption and decompression steps, any hints?

http://wiki.xentax.com/index.php/Resident_Evil_3_DAT

\o/ Finally done

Posted: Fri May 25, 2007 11:09 pm
by PmData
Hello,

I did more tests, and now everything is working correctly. The last error I made was to decrypt a whole file, then depack it. It does not work as the depacker must work on blocks of the file, and must be resetted.

So now, I updated everything in both Xentax and Rewiki pages. I also started writing a patch for PhysicsFS library so I can use it in my own programs.

Posted: Mon Jun 11, 2007 6:21 pm
by BeeswaX
so is it possible to get the stage models and textures ?

Posted: Mon Jun 11, 2007 7:52 pm
by PmData
What I've done is the equivalent of having documented the ZIP archive file format. It does not tell anything about the files stored in the archive.

The background images are stored as JPEG images (like the background above), some textures and other bitmapped images are stored as TIM images (like the Jill skin above).

From the various file extensions I see in the archive, it roughly use same file formats for models and the rest as previous RE games, which are still to be documented.

Posted: Wed Jun 13, 2007 11:50 am
by BeeswaX
any chance you can upload some zombie, and /or nemesis skins ?
im a 3d modeler and with these skins its a little easier for me to get something textured

:D

Posted: Mon Dec 17, 2007 11:05 am
by Strobe
Good work dudes!!! i missed this!!

I gave up too quickly ;X, glad too see someone finally broke that damn
encryption. Very nice work.