Quantic Dream Sample Thread

Extraction and unpacking of game archives and compression, encryption, obfuscation, decoding of unknown files
AnonBaiter
Posts: 1125
Joined: Tue Feb 02, 2016 2:35 am

Re: Quantic Dream Sample Thread

Post by AnonBaiter »

So I tested the script on the PC version of the game and it gave me this error:

Code: Select all

  000000003ff77800 370688     0000000000000221.dat

Error: incomplete input file 1: C:\GOG Games\Fahrenheit (Indigo Prophecy)\BigFile_PC.dat
       Can't read 207100 bytes from offset 000000003ff9f704.
       Anyway don't worry, it's possible that the BMS script has been written
       to exit in this way if it's reached the end of the archive so check it
       or contact its author or verify that all the files have been extracted.
       Please check the following coverage information to know if it's ok.

  coverage file 1    50%   541542749  1073346308

Last script line before the error or that produced the error:
  35  log "" OFFSET SIZE 1


Anyway, here are the samples for the PC version:
https://mega.nz/#!cIFGgCQT!O3FA3gHv72wnUbKGLWdu6-j00SHlxe7b5QYynznIxEk
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Quantic Dream Sample Thread

Post by aluigi »

I can do nothing, the does what the IDM index says:

Code: Select all

. 00000221
. 00002274 get     DUMMY      0x0000034f 4
. 00002278 get     OFFSET     0x3ff77800 4
. 0000227c get     SIZE       0x0005a800 4
. 00002280 get     DAT_NUM    0x00000000 1
  3ff77800 370688     00000221.dat
There is a problem later where the IDM suddenly adds another 32bit in the middle of the format screwing everything, but, again the script does exactly what the IDM says.
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Quantic Dream Sample Thread

Post by aluigi »

I can write some 2 work-arounds to bypass these invalid entries, what you think?
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Quantic Dream Sample Thread

Post by aluigi »

Forget what I said, this IDM is completely messed.
AnonBaiter
Posts: 1125
Joined: Tue Feb 02, 2016 2:35 am

Re: Quantic Dream Sample Thread

Post by AnonBaiter »

Acutally, the PARTITIO(.par) files on the XBOX version were encoded using the Microsoft IMA ADPCM(4-bit) codec.
So far the output I'm getting out of an converted GENH looks a bit garbled(looks like it uses an variant of the codec) but you get the idea.
AnonBaiter
Posts: 1125
Joined: Tue Feb 02, 2016 2:35 am

Re: Quantic Dream Sample Thread

Post by AnonBaiter »

Anyway, here's a sample from the PC demo version of Fahrenheit.
That's all that I'm left with right now. Do you wish me to repost the samples from Heavy Rain and Beyond Two Souls? I could make the packed files more organized next time...
AnonBaiter
Posts: 1125
Joined: Tue Feb 02, 2016 2:35 am

Re: Quantic Dream Sample Thread

Post by AnonBaiter »

After looking at a decrypted EBOOT file, I learned that these decrypted .sdat files were actually .idm files.
But the problem is that I can't figure these monsters out at all. I mean, there is an hex byte over there that is actually the location of the offsets, the chunks, etc. but it's not even clear about what exactly they are supposed to represent. This kind of thing has been bugging me for years, but to be honest I don't think these games themselves are even that interesting at all, but anyway...

It's really messy. Take a look at this file if you see what I mean. This file came from Heavy Rain Move Edition.
AnonBaiter
Posts: 1125
Joined: Tue Feb 02, 2016 2:35 am

Re: Quantic Dream Sample Thread

Post by AnonBaiter »

I have written a script in which it can check "QUANTICDREAMTABIDMEM" files used on PS3 games developed by Quantic Dream.

Code: Select all

open FDDE "idm"
idstring "QUANTICDREAMTABIDMEM"

endian big
get INFO_OFF long
get INFO_QUANT long
get ZERO long
for i = 0 < INFO_QUANT
   get DUMMY1 long
   get DUMMY2 long
   get INFO_LOCATION long
next i
So far it only checks everything contained within the file. It must be executed into a decrypted .sdat file in question and renamed to .idm; the -V parameter is optional.
AnonBaiter
Posts: 1125
Joined: Tue Feb 02, 2016 2:35 am

Re: Quantic Dream Sample Thread

Post by AnonBaiter »

I'm surprised your script even works with the Remastered version of Fahrenheit/Indigo Prophecy, which now has its title: Fahrenheit: Indigo Prophecy Remastered.
fignyafsyakaya
Posts: 14
Joined: Fri Jul 27, 2018 6:19 am

Re: Fahrenheit/Indigo Prophecy (PS2/XBOX) - .DAT/.IDM/.D**

Post by fignyafsyakaya »

aluigi wrote:"data" is ok but it's really just data and not files to extract, you will have thousands of "things".


Recently I tried to split databanks into something useful - this is what I managed to cook up.

".partoffs" turned out to be essential for ".partitio"-files, but I haven't figured them out completely yet, situations came up that were unclear for me.
Maybe I'll try to describe things I understood - if I'll be able to, of course.

Code: Select all

idstring "DATABANK"
get VER long
get SIZE long
get FILES short
get DUMMY short
get DUMMY long
get INFO_SIZE long
get DUMMY long
PutArray 0 FILES 0

for i = 0 < FILES
    get SMTH long
    get ID short
    get UNK short
    get ZERO long
    get OFFSET long
    putarray 0 i SMTH
    putarray 1 i ID
    putarray 2 i OFFSET
next i

get ZISE asize
putarray 2 i ZISE
getarray ZISE 2 i


for i = 0 < FILES
    getarray SMTH 0 i
    getarray ID 1 i
    getarray OFFSET 2 i
    math i + 1
    getarray NEXT_OFFSET 2 i
    math i - 1
    math NEXT_OFFSET - OFFSET

    if SMTH == 0x00000FFC
          string ID += ".partoffs"
    elif SMTH == 0x000003F8
          string ID += ".filenames"
    elif SMTH == 0x00000FA7
          string ID += ".filename_single"
    elif SMTH == 0x00000FD3
          string ID += ".event"
    elif SMTH == 0x00000FFB
          string ID += ".language"
    Endif

    log ID OFFSET NEXT_OFFSET
next i
fignyafsyakaya
Posts: 14
Joined: Fri Jul 27, 2018 6:19 am

Re: Quantic Dream Sample Thread

Post by fignyafsyakaya »

After much trial and error, I wrote something for getting filenames and playable audio for speech files and it worked... at least, with files I tried out.
The collection of scripts is kind of "work_in_progress": at the moment it can extract names only for one language (UK) and I'm not sure if all the problems with audio extraction are solved - sometimes the files can be extracted either with empty useless data or not completely and I haven't figured out how to detect number of audio channels yet.

If you would like to benefit from this Frankenstein's monster, I would recommend to follow those steps:

1. Firstly, you'll have to extract files from archives using AnonBaiter's script (you can find it in the attachment if something goes wrong with the "Script Compendium" topic).
2. After that, use "1_databank.bms" on all the ".databank" files in "0007" folder and save result into any folder you want.
3. Put all the extracted ".filenames" files into 0ffb folder - that's where all the speech ".partitio" files should be located.
4. Use "2_filenames_UK.bms" on all the ".filenames" files and save the output into a separate folder - it's supposed to get files with their actual filenames.
5. Put all the extracted ".partoffs" files into the folder where you will have put the files with filenames.
6. And now, use "3_partitio-tables.bms" onto the ".partitio" files and save the extracted audio parts into a separate folder (again).
7. Put the programme called "vgmstream" and the remaining files from the attachment (".txth" and "for_vgmstream.bat") into the last mentioned folder.
8. Launch "for_vgmstream.bat".

Now it should get the audio files playable. Sometimes they might have 2 channels instead of 1 - in this case you have to change the "channels" value in the ".txth".
Also, this whole operation extracts audio as 6 seconds parts - it was the problem I couldn't see a way to resolve.

P.S. Useful information for audio seems to be located in "STREAMAB" part of "PARTITIO" files, such as sampling frequency or (maybe) number of audio channels but I didn't realize how to use it specifically for each file.
Last edited by fignyafsyakaya on Sat Feb 19, 2022 9:16 am, edited 2 times in total.
fignyafsyakaya
Posts: 14
Joined: Fri Jul 27, 2018 6:19 am

Re: Quantic Dream Sample Thread

Post by fignyafsyakaya »

Eventually, after Fahrenheit, I got my hands on archives of Heavy Rain from PC (WIN) version.
All the speech .partitio-files turned out to be in "O-..." and "LanguageData".

Also, all the filenames were found inside the .dbg-files of the same names.

After I used AnonBaiter's script on the .idm-files of the archives mentioned above, I put .dbg-file into each according folder with .partitio-files and used the script below onto each one:

Code: Select all

endian big

idstring "QUANTICDREAMTABINDEX"
get SMTH long
get ALLFILES long

for i = 0 < ALLFILES
    get PARTITIO_ID long
    get SOME_NUMBER long
    get AUDIONAME long
    get NAME_LENGTH long
    getdstring FILENAME NAME_LENGTH
    savepos OFFSET
    math OFFSET += 0x18
    goto OFFSET
    string NAME p "%08x.%s" AUDIONAME partitio
    open FDSE NAME 1
    get SIZE asize 1
    log FILENAME 0 SIZE 1
next i


That was the way I've got files with their actual filenames.
Now, it's up to finding the .partoffs and using them to get a normally playable audio - they don't seem to be located in the archives above.

PS3-version might be significantly different in finding filenames, but I have no idea whether I'll be able to get to it.
fignyafsyakaya
Posts: 14
Joined: Fri Jul 27, 2018 6:19 am

Re: Quantic Dream Sample Thread

Post by fignyafsyakaya »

Also. getting files from PC-version of Beyond: Two Souls was difficult at first, but I slightly redrafted AnonBaiter's script for Fahrenheit for both .idm and .idx lists.
Now it seems to handle the extraction but .idm is likely to miss information of some assets.
fignyafsyakaya
Posts: 14
Joined: Fri Jul 27, 2018 6:19 am

Re: Quantic Dream Sample Thread

Post by fignyafsyakaya »

During exploration, I tried to interact with .dep-files in PC-version of Beyond.
After a couple of hours, I wrote something (in the attachment) that seems to print out the files and their connections to other files.

Sadly, it hasn't made any progress in finding either .partoffs or filenames - connections to "0ffc"-partoffs seem to be inside .segs-files, they are incomprehensible for me.
If somebody would like to take part in this "research" but doesn't have a game, I'll try to send some examples.
micTronic
Posts: 2
Joined: Sat Feb 06, 2021 3:03 pm

Re: Quantic Dream Sample Thread

Post by micTronic »

Thanks a lot fignyafsyakaya for your research on the QD games, it's extremely helpful :-)