Resident Evil 4 FEN_decompress (*.fen) on PS4

Extraction and unpacking of game archives and compression, encryption, obfuscation, decoding of unknown files
shadow_lonely
Posts: 216
Joined: Mon Oct 06, 2014 3:30 am

Resident Evil 4 FEN_decompress (*.fen) on PS4

Post by shadow_lonely »

Hi, i started with Resident Evil 4 on PS4, if have a litte different, PC used lfs and PS4 used fen, to decompress lfs file, i used quickbms script:

Code: Select all

comtype xmemdecompress
get name basename
log MEMORY_FILE 0 0
goto 0x10
get chunks long
append
for i = 0 < chunks
get zsize short
get size short
if size = 0
    math size = 0x10000
endif
get offset long
math offset + 0x13
clog MEMORY_FILE offset zsize size
next i
append
get size asize MEMORY_FILE
log name 0x00 size MEMORY_FILE


Anyone please help me decompress those files from ps4. Many thanks!

My example files: https://drive.google.com/file/d/1zUyRQW ... sp=sharing
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Resident Evil 4 FEN_decompress (*.fen) on PS4

Post by aluigi »

I have made a script from scratch:
http://aluigi.org/bms/re4_lfs_fen.bms
shadow_lonely
Posts: 216
Joined: Mon Oct 06, 2014 3:30 am

Re: Resident Evil 4 FEN_decompress (*.fen) on PS4

Post by shadow_lonely »

aluigi wrote:I have made a script from scratch:
http://aluigi.org/bms/re4_lfs_fen.bms

Thanks! Your script's working perfect. Thanks for quick reply.
Nameless32
Posts: 35
Joined: Sun Dec 21, 2014 7:43 pm

Re: Resident Evil 4 FEN_decompress (*.fen) on PS4

Post by Nameless32 »

aluigi wrote:I have made a script from scratch:
http://aluigi.org/bms/re4_lfs_fen.bms


can you add suport for ps3 files ?
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Resident Evil 4 FEN_decompress (*.fen) on PS4

Post by aluigi »

yes and no.
Basically they are just "segs" files with a "ZLDR" magic at the beginning, so it's enough to strip the first 8 bytes and it's done.
But there is a problem with the obtained segs file because it uses lzma compression instead of deflate (no problem here) and some chunks can't be decompressed for some unknown reasons not depending by the algorithm or quickbms, the first byte of the lzma stream should be 0 or 1 while it's a "random" number in these particular chunks.
So both this and the segs scripts have been updated but you can't extract the data.

Long story short: no.
Nameless32
Posts: 35
Joined: Sun Dec 21, 2014 7:43 pm

Re: Resident Evil 4 FEN_decompress (*.fen) on PS4

Post by Nameless32 »

aluigi wrote:yes and no.
Basically they are just "segs" files with a "ZLDR" magic at the beginning, so it's enough to strip the first 8 bytes and it's done.
But there is a problem with the obtained segs file because it uses lzma compression instead of deflate (no problem here) and some chunks can't be decompressed for some unknown reasons not depending by the algorithm or quickbms, the first byte of the lzma stream should be 0 or 1 while it's a "random" number in these particular chunks.
So both this and the segs scripts have been updated but you can't extract the data.

Long story short: no.


sad....

T-T

thanks anyway o/
shadow_lonely
Posts: 216
Joined: Mon Oct 06, 2014 3:30 am

Re: Resident Evil 4 FEN_decompress (*.fen) on PS4

Post by shadow_lonely »

aluigi wrote:yes and no.
Basically they are just "segs" files with a "ZLDR" magic at the beginning, so it's enough to strip the first 8 bytes and it's done.
But there is a problem with the obtained segs file because it uses lzma compression instead of deflate (no problem here) and some chunks can't be decompressed for some unknown reasons not depending by the algorithm or quickbms, the first byte of the lzma stream should be 0 or 1 while it's a "random" number in these particular chunks.
So both this and the segs scripts have been updated but you can't extract the data.

Long story short: no.


Hi aluigi. Could you help me unpack *.pack file in Resident Evil 4 (PS4 version) by quickbms script, please? My example file: https://1drv.ms/u/s!AqHXyzDaH_sGiUeSH_M4RiejLiF9

Thanks!
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Resident Evil 4 FEN_decompress (*.fen) on PS4

Post by aluigi »

Script 0.1.2
shadow_lonely
Posts: 216
Joined: Mon Oct 06, 2014 3:30 am

Re: Resident Evil 4 FEN_decompress (*.fen) on PS4

Post by shadow_lonely »

aluigi wrote:Script 0.1.2

Thanks! That's great!
shadow_lonely
Posts: 216
Joined: Mon Oct 06, 2014 3:30 am

Re: Resident Evil 4 FEN_decompress (*.fen) on PS4

Post by shadow_lonely »

I tested, it working, could you help again with .udas files?
Old script working on pc:

Code: Select all

goto 0x400
get files long
getdstring dummy 0xc
math extoffset = files
math extoffset * 4
math extoffset + 0x410
for i = 0 < files
get name basename
#get name2 basename
log MEMORY_FILE 0 0
put i byte MEMORY_FILE
goto 0x00 MEMORY_FILE
getvarchr index MEMORY_FILE 0
get offset long
savepos TMP
get nextoffset long
math nextoffset - offset
math offset + 0x400
goto extoffset
getdstring ext 3
get dummy byte
savepos extoffset
goto TMP
#string name + "/"
#string name + name2
string name + "_"
string name + index
string name + "."
string name + ext
if ext = "MDT"
log name offset nextoffset
endif
next i


My example files: https://1drv.ms/u/s!AqHXyzDaH_sGiUiROpQa4q_u6TO_
Thanks!
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Resident Evil 4 FEN_decompress (*.fen) on PS4

Post by aluigi »

udas seems a very messy format
shadow_lonely
Posts: 216
Joined: Mon Oct 06, 2014 3:30 am

Re: Resident Evil 4 FEN_decompress (*.fen) on PS4

Post by shadow_lonely »

aluigi wrote:udas seems a very messy format

Thanks. I only use .mdt files for translate. Hope you can help, please.
shadow_lonely
Posts: 216
Joined: Mon Oct 06, 2014 3:30 am

Re: Resident Evil 4 FEN_decompress (*.fen) on PS4

Post by shadow_lonely »

I just collect some small files for example: https://1drv.ms/u/s!AqHXyzDaH_sGiUmMK-MBy0mN-j5o
Thanks!

Maybe different le and be?

Image