Skip to content
View in the app

A better way to browse. Learn more.

ResHax

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.
Help us keep the site running.

Resident Evil 4 stage .das files[GC/WII]

Featured Replies

  • Author
  • Localization

KingOfGuns, posted Tue Sep 05, 2017 1:11 pm (26285)


I need help extracting these. Currently we can't open stage/room .das files, i think they are compressed. I've atached 2 .rar files, one contains a stage/room .das file, which cannot be extracted atm, and the other contains a regular .das file, which can be extracted with the current available tools.
  • Author
  • Localization

mariokart64n, posted Thu Feb 03, 2022 1:26 am (69588)


I'm looking for a way to decompress the resource blocks in RE4 so I can study the geometry data.

The header contains two strings, one for the compressed size, and the other is the decompressed size then the header is padded to 32bytes.

At address 32 the compressed stream begins, which always starts with the same dword 0xCE2843DD.
I've ran the compression scan script for quickBMS, but nothing looks correct.

I contacted the author of BioFAT (a generic resident evil unpacker) and they stated that the compression was a custom yz2.

So I've tried to manually configure the header to fit the yaz0 specification, but that also fails to decompress with quickBMS.

I've included samples from PC (Steam Version), Gamecube, and the xbox 360 which oddly only the PC version is missing this yz2 compression. Maybe because PC is little endian vs gamecube and xbox360 which are big endian?

Either way any additional input into what this compression is or how it could be defeated is greatly welcome. :)
  • Author
  • Localization

aluigi, posted Thu Feb 03, 2022 4:33 pm (69595)


Probably that compression is not available in quickbms.
Is there any source code or implementation of that compression? (I don't know if that biofat you mentioned supports it or not)

P.S.: is that "ce 28 43 dd" a magic value for recognizing that compression?
  • Author
  • Localization

mariokart64n, posted Sun Feb 06, 2022 5:15 pm (69696)


Yes CE2843DD appears to be the magic, but I'm not able to locate any existing implementation of the compression.

I have the DOL of the gamecube demo for resident evil 4, but I don't know how to disassemble it. Doing a string search in hex I can see a reference to a function called 'ReadCompressData' but I cannot locate a reference to the magic CE2843DD or the extension yz2.



As for the yz2tool there seems to be some confusion around it, on the pc version on steam the files have multiple extensions.
Example: 000000a0.pack.yz2.lfs

However the compression that was used was Xmem which is seen on both the xbox360 and PC versions. Except the Xbox360 is double compressed with yz2 compression where as the PC is not.

The yz2tool is deceiving in the sense it only unpacks the already decompressed pack files on the PC and does not actually decompress anything.
  • Author
  • Localization

aluigi, posted Sun Feb 06, 2022 8:35 pm (69700)


mariokart64n wrote:
The yz2tool is deceiving in the sense it only unpacks the already decompressed pack files on the PC and does not actually decompress anything.

Indeed, when I quickly checked it I didn't see any decompression code.
Thanks for confirming :)
  • Author
  • Localization

Allen, posted Fri Feb 18, 2022 3:26 pm (69972)


..
  • Author
  • Localization

Allen, posted Fri Feb 18, 2022 3:31 pm (69973)


mariokart64n wrote:
Yes CE2843DD appears to be the magic, but I'm not able to locate any existing implementation of the compression.

I have the DOL of the gamecube demo for resident evil 4, but I don't know how to disassemble it. Doing a string search in hex I can see a reference to a function called 'ReadCompressData' but I cannot locate a reference to the magic CE2843DD or the extension yz2.

re4_e3_demo_dol.zip


Spent 10 days debugging, some progress, but still some bugs can't fully reverse decompress the code. I've been stuck getting the index value of the temp buffer and can't get the index right.

Here I give you some hints if you can debug.
If it is the DEMO version, you can debug these functions.

DOL of the gamecube demo for resident evil 4:
Code:
void __fastcall sub_80178784(_BYTE *a1)
void __fastcall sub_8018A1F0(int *a1, _BYTE *a2, int a3, double a4)
int __fastcall sub_8018A5DC(int result, double a2, double a3, double a4, double a5, int a6, int a7, unsigned int *a8)
__int64 __fastcall sub_8018A3BC(double a1, double a2, double a3, double a4)


This is the version I debugged. RE4 USA GAMECUBE version.
Resident Evil 4 (USA) (Disc 1)_gamecube:
Code:
void __fastcall sub_80170260(int outBufferPtr)
void __fastcall sub_8018F5CC(DecompressTempBufferInfo *tempBufferInfo, _BYTE *outBuffer, int decompressSize, double _f1)
int __fastcall sub_8018F9B8(int result, double a2, double _f2, double _f3, double _f4, int a6, int _dw1280_1, unsigned int *flags)
__int64 __fastcall sub_8018F798(double _f1, double _f2, double _f3, double _f4)
  • Author
  • Localization

mariokart64n, posted Sat Feb 19, 2022 6:44 pm (70017)


thanks for looking at it, its interesting that the retail version is slightly different. I uploaded the demo dol because i figured it may have more debug symbols in it then the retail.

did you get this from IDApro? I seen there was a dol plugin but wasn't able to find a working link to it
  • Author
  • Localization

Allen, posted Sat Feb 26, 2022 2:02 pm (70126)


After another 10 days of hard work, with more progress, I have successfully decompressed the file. The tool will be released after perfecting.
The process is quite painful, debugging the code line by line...
  • Author
  • Localization

Allen, posted Tue Mar 01, 2022 2:34 pm (70166)


Resident Evil 4 Gamecube / Xbox360 stage .das file decompression tool

Usage:
Just drag and drop the .das file or .bin file to the program and it will be automatically decompressed.

re4decmp.zip

  • Author
  • Localization

Leonhart, posted Fri Jun 24, 2022 10:19 am (72272)


Allen wrote:
Resident Evil 4 Gamecube / Xbox360 stage .das file decompression tool

Usage:
Just drag and drop the .das file or .bin file to the program and it will be automatically decompressed.


Hey Allen, thank you for your hard work on this!
Would you be able to create a tool to compress the .das file?
  • Author
  • Localization

Allen, posted Mon Jun 27, 2022 3:50 am (72327)


Leonhart wrote:

Hey Allen, thank you for your hard work on this!
Would you be able to create a tool to compress the .das file?

Hi Leonhart,

I can't yet.
To decompress the data, I only need to interpret assembly language to C code, no need to understand the principle.
The compression code needs to figure out how compression works, which is more complicated.
  • Author
  • Localization

Leonhart, posted Wed Jun 29, 2022 8:57 am (72348)


Allen wrote:
I can't yet.
To decompress the data, I only need to interpret assembly language to C code, no need to understand the principle.
The compression code needs to figure out how compression works, which is more complicated.

Thanks for the reply, do you know anyone who can do this?
  • Author
  • Localization

krisp0o, posted Wed Feb 22, 2023 3:28 am (75529)


Allen wrote:
Resident Evil 4 Gamecube / Xbox360 stage .das file decompression tool

Usage:
Just drag and drop the .das file or .bin file to the program and it will be automatically decompressed.

Hello Allen!!! Do you think the game would be able to read the uncompressed data? I've seen some other .das that don't have content compression. Well, I tried to add the header back myself but unfortunately I didn't get any successes. :(
Guest
This topic is now closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.