Time Crisis 2 (PS2) - FGI.BIN

Extraction and unpacking of game archives and compression, encryption, obfuscation, decoding of unknown files
BloodRaynare
Posts: 367
Joined: Fri Mar 10, 2017 7:23 am

Time Crisis 2 (PS2) - FGI.BIN

Post by BloodRaynare »

I tried to writing the script myself however the way it stores the offsets threw me off. By the way, the TOC is in the executables (SLUS_202.19)

https://drive.google.com/file/d/1_1cGss ... IBwTK/view

Update 05/06/22: Finally, I kinda figured out how the TOC works. Here's the script (Only works for US version ATM; If asks to overwrite the same files, just do it. Reason is there are duplicate entries):

Code: Select all

open FDSE SLUS_202.19
open FDSE FGI.BIN 1

get FGI_SIZE asize 1

math TOC = 0x25D650
goto TOC

math OFFSET = 0

for i = 0
   get FILE_ENTRY_OFF long
   if FILE_ENTRY_OFF == 0xffffffff
      break
   endif
   math FILE_ENTRY_OFF - 0xff000
   get FILE_ENTRY_LEN long
   get FILE_ENTRY_LEN long
   get FILE_ENTRY_NUM long
   savepos TOC
   goto FILE_ENTRY_OFF
   for j = 0 < FILE_ENTRY_NUM
      get NAME_OFF long
      math NAME_OFF - 0xff000
      savepos FILE_ENTRY
      goto NAME_OFF
      get NAME string
      goto FILE_ENTRY
      get UNK long
      get OFF_ADD long
      get SIZE long
      get ABS_OFF long
      math ABS_OFF + OFFSET
      if ABS_OFF >= FGI_SIZE
         break
      endif
      get ZERO long
      get UNK long
      get UNK long
      log NAME ABS_OFF SIZE 1
   next j
   math OFFSET + FILE_ENTRY_LEN
   goto TOC
next i
Last edited by BloodRaynare on Fri May 06, 2022 2:19 am, edited 2 times in total.
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Time Crisis 2 (PS2) - FGI.BIN

Post by aluigi »

http://aluigi.org/bms/time_crisis_2_fgi.bms

I don't know if there are other archives and no luck with the filenames (there are many but can' see any list of 689 elements)
kim_sama_999
Posts: 2
Joined: Tue Jul 28, 2020 5:43 am

Re: Time Crisis 2 (PS2) - FGI.BIN

Post by kim_sama_999 »

I think all the files in FGI.bin has all the files combined in 1 .BIN file. SLUS_202.19 has the file names (Example "/ps_db/stgall/tchunkH.bin") Since Time Crisis 3 uses the same game engine it also has FGI.bin and the elf files with the file names inside, it's the same for the arcade version, but the elf file is in the dongle. Time Crisis 4 uses the same game engine, but there packed in .CVM files which can extract with 7zip
tgm2
Posts: 4
Joined: Thu May 05, 2022 2:00 pm

Re: Time Crisis 2 (PS2) - FGI.BIN

Post by tgm2 »

has this been figured out yet? i wanted to extract the quick & crash sounds, you can see their name with strings slus_202.19|grep crash
BloodRaynare
Posts: 367
Joined: Fri Mar 10, 2017 7:23 am

Re: Time Crisis 2 (PS2) - FGI.BIN

Post by BloodRaynare »

tgm2 wrote:has this been figured out yet? i wanted to extract the quick & crash sounds, you can see their name with strings slus_202.19|grep crash


Check the updates of my initial post for the somewhat-proper BMS script. About those names, it was a part of filesystem within the SoundImg_SD_*.bin files. However, I haven't figured out yet where those names were linked to which SoundImg files within the game's executables. Anyway, if you still want to extract those sounds, you can use PSound (by using Wine since I assumed you were on a non-windows OS) then scan the SoundImg_SD_qc_english.bin (Where all the sounds for Quick & Crash minigames reside) file as a workaround.
tgm2
Posts: 4
Joined: Thu May 05, 2022 2:00 pm

Re: Time Crisis 2 (PS2) - FGI.BIN

Post by tgm2 »

appreciate it. I had to edit these two lines

Code: Select all

open FDSE SLUS_202.19
open FDSE FGI.BIN 1

to change the filenames to lowercase, since Linux is case-sensitive and it throws a file not found error.
tgm2
Posts: 4
Joined: Thu May 05, 2022 2:00 pm

Re: Time Crisis 2 (PS2) - FGI.BIN

Post by tgm2 »

the guy's voice seems a bit high pitched, what's the right sample rate? and do you know where the music is stored?
BloodRaynare
Posts: 367
Joined: Fri Mar 10, 2017 7:23 am

Re: Time Crisis 2 (PS2) - FGI.BIN

Post by BloodRaynare »

tgm2 wrote:the guy's voice seems a bit high pitched, what's the right sample rate? and do you know where the music is stored?


From the quick look at the game's executable using ps2dis, the sample rates is 20000Hz. The musics are located in "home\chris\data\sound\bgm\VGI" directory. Use this txth scripts to play the files with vgmstream plugin + media player that supports it:

Code: Select all

codec = PSX
channels = 2
sample_rate = 48000
interleave = 0x400
num_samples = data_size


Save those scripts above as ".vgi.txth", put it on the same directory as the VGI files. Then just play it with vgmstream + a media player that supports it (like foobar2000).
JeffMakesGames
Posts: 73
Joined: Fri Feb 03, 2017 8:47 pm

Re: Time Crisis 2 (PS2) - FGI.BIN

Post by JeffMakesGames »

Edit: Figured it out.
Last edited by JeffMakesGames on Wed May 18, 2022 2:55 am, edited 1 time in total.
BloodRaynare
Posts: 367
Joined: Fri Mar 10, 2017 7:23 am

Re: Time Crisis 2 (PS2) - FGI.BIN

Post by BloodRaynare »

JeffMakesGames wrote:I can't seem to make the script work.

error in src/file.c line 615: fdnum_open()
Error: No such file or directory


Did you put both of the game's executable (SLUS_202.19) and FGI.BIN file in the same directory?
Or probably you're on non-Windows OS (like Linux)? If that's the case change the filenames in "open FDSE..." lines to lowercase.
JeffMakesGames
Posts: 73
Joined: Fri Feb 03, 2017 8:47 pm

Re: Time Crisis 2 (PS2) - FGI.BIN

Post by JeffMakesGames »

I know Time Crisis 3 also uses a FGI.BIN but I wasn't able to extract anything from it.

Crisis Zone uses something different called dummy files.
BloodRaynare
Posts: 367
Joined: Fri Mar 10, 2017 7:23 am

Re: Time Crisis 2 (PS2) - FGI.BIN

Post by BloodRaynare »

JeffMakesGames wrote:I know Time Crisis 3 also uses a FGI.BIN but I wasn't able to extract anything from it.

Crisis Zone uses something different called dummy files.



TC3 uses same method as TC2 (TOC was inside the game's executable + FGI.BIN for the bigfile), but the offset where the TOC resides is different, so I have to make a separate script for it (But I do have the script here. Only supports US and Namco System 246 aka Arcade version for now). No idea about Crisis Zone as I haven't checked that one.

tc3.bms
JeffMakesGames
Posts: 73
Joined: Fri Feb 03, 2017 8:47 pm

Re: Time Crisis 2 (PS2) - FGI.BIN

Post by JeffMakesGames »

BloodRaynare wrote:

TC3 uses same method as TC2 (TOC was inside the game's executable + FGI.BIN for the bigfile), but the offset where the TOC resides is different, so I have to make a separate script for it (But I do have the script here. Only supports US and Namco System 246 aka Arcade version for now). No idea about Crisis Zone as I haven't checked that one.


My FGI.BIN comes off the ps2 disc of TC3, so this script probably won't work on it.

EDIT: I am an idiot for not reading the above more clearly. "US".
Just peeked inside the bms script and see it reference the FGI and loader.
Tried it and it works! Thanks!

Crisis Zone is definitely a different one though. On the PS2 disc, I see a CZ.BIN (368mb) and SLUS_209.27 (3mb) but I also see 3 files that are named dummy.000, dummy.001, and dummy.002. All 3 say they are 1GB in size. I don't know if they contain any data though.
BloodRaynare
Posts: 367
Joined: Fri Mar 10, 2017 7:23 am

Re: Time Crisis 2 (PS2) - FGI.BIN

Post by BloodRaynare »

JeffMakesGames wrote:My FGI.BIN comes off the ps2 disc of TC3, so this script probably won't work on it.

EDIT: I am an idiot for not reading the above more clearly. "US".
Just peeked inside the bms script and see it reference the FGI and loader.
Tried it and it works! Thanks!

Crisis Zone is definitely a different one though. On the PS2 disc, I see a CZ.BIN (368mb) and SLUS_209.27 (3mb) but I also see 3 files that are named dummy.000, dummy.001, and dummy.002. All 3 say they are 1GB in size. I don't know if they contain any data though.


By your description, the data file definitely were inside CZ.BIN, but we wouldn't know how the TOC was stored.
Might take a look at it later.
tgm2
Posts: 4
Joined: Thu May 05, 2022 2:00 pm

Re: Time Crisis 2 (PS2) - FGI.BIN

Post by tgm2 »

BloodRaynare wrote:
tgm2 wrote:has this been figured out yet? i wanted to extract the quick & crash sounds, you can see their name with strings slus_202.19|grep crash


Check the updates of my initial post for the somewhat-proper BMS script. About those names, it was a part of filesystem within the SoundImg_SD_*.bin files. However, I haven't figured out yet where those names were linked to which SoundImg files within the game's executables. Anyway, if you still want to extract those sounds, you can use PSound (by using Wine since I assumed you were on a non-windows OS) then scan the SoundImg_SD_qc_english.bin (Where all the sounds for Quick & Crash minigames reside) file as a workaround.

Looking in soundImg_SD_qc_english.bin with PSound it looks like most of sounds are there but some are missing, such as the announcer's "Ready?" "Go!" "Let's look at your overall ranking" and "Level 4 - this is the final phase, shoot the cup" sounds. PSound bug?