PAC file from Alpine Racer 3 (Namco PS2)

Extraction and unpacking of game archives and compression, encryption, obfuscation, decoding of unknown files
Shiruba
Posts: 10
Joined: Tue Sep 06, 2022 9:51 pm

PAC file from Alpine Racer 3 (Namco PS2)

Post by Shiruba »

Hello, I discovered this game has Klonoa (a Namco character) in it so I wanted to get the voice clips from the files.

Game : Alpine Racer 3
Platform : PS2 (also on Arcade but I extracted the files from the PS2 version)

For the file structure, the music and videos are in their own directories and are extractable. The rest is in a directory named "DAT". In it there are lots of .PAC files. All these files have "DPAC" as header when opened with an hex editor. So after some research I found DPAC is a format from Yuke and downloaded the script from this link : http://aluigi.altervista.org/bms/yuke.bms
The script didn't give any error but prints "0 files found in 0 seconds". So it's a failure but I guess the file structure is similar or at least easy to understand because I've checked quickly and there are some filenames that appear sometime.

I don't know if there are differences between every .PAC so I included every of them in the following link :
https://drive.google.com/file/d/1qRAf3c ... sp=sharing

Thanks.
BloodRaynare
Posts: 367
Joined: Fri Mar 10, 2017 7:23 am

Re: PAC file from Alpine Racer 3 (Namco PS2)

Post by BloodRaynare »

Or you can use this BMS script that I wrote specifically for this game:

ar3_pac.bms
Note: Doesn't work on DJ1.PAC to DJ5.PAC. That one has a different TOC spec.
Note2: If you are looking for voices, check the LANG1.PAC.


Code: Select all

math TOC = 0x800

IDString "DPAC"
get TOC_SZ long
get PAC_SZ long
get OFF_ADD_MUL long
get UNK long
goto TOC

xmath TOC_END "TOC + TOC_SZ"
math TOC_END - 8

math OFF_ADD_MUL + 1
math OFF_ADD_MUL * 0x800

getdstring DIRNAME 4
get UNK long
do
   savepos CURRPOS
   getDstring FNAME 4
   get OFFSET short
   get SIZE short
   
   string TEST_CHAR_1 = FNAME
   string TEST_CHAR_2 = FNAME
   string TEST_CHAR_3 = FNAME
   string TEST_CHAR_4 = FNAME
   
   string TEST_CHAR_1 - 3
   
   string TEST_CHAR_2 - 2
   string TEST_CHAR_2 < 1
   
   string TEST_CHAR_3 - 1
   string TEST_CHAR_3 < 2
   
   string TEST_CHAR_4 < 3
   
   math OFFSET * 0x800
   math SIZE * 0x100
   math OFFSET + OFF_ADD_MUL
   
   if OFFSET < PAC_SZ
      xmath OFFSET_TMP "OFFSET - 4"
      savepos TOC
      goto OFFSET_TMP
      get ZERO_CHECK long
      goto TOC
   endif
   
   if TEST_CHAR_1 > "~" || TEST_CHAR_2 > "~" || TEST_CHAR_3 > "~" || TEST_CHAR_4 > "~"
      continue
   elif TEST_CHAR_1 < " " || TEST_CHAR_2 < " "  || TEST_CHAR_3 < " "  || TEST_CHAR_4 < " "
      continue
   elif OFFSET > PAC_SZ
      continue
   elif ZERO_CHECK != 0
      continue
   else
      string NAME = DIRNAME
      string NAME + \
      string NAME + FNAME
      string NAME + .
      log NAME OFFSET SIZE
   endif
while CURRPOS < TOC_END


And here's the TXTH file for the adp file (save this as ".adp.txth" then put it on the same directory as the .adp files)

Code: Select all

subsong_count = @0x04
base_offset = 0x10
subsong_spacing = 0x10

data_size = @0x00
start_offset = (subsong_count * 0x10) + base_offset + @0x04
sample_rate = @0x0a$2

codec = PSX
channels = 1

num_samples = data_size
loop_flag = auto


Use foobar2000 with vgmstream plugin to play the file.
If foobar2000 shows a "?" duration, Make sure the "Enable unknown exts" is checked in the vgmstream's foobar preferences.
Shiruba
Posts: 10
Joined: Tue Sep 06, 2022 9:51 pm

Re: PAC file from Alpine Racer 3 (Namco PS2)

Post by Shiruba »

Thank you very much! I was already familiar with foobar2000 and .txth so all the explanations weren't needed but in case another person would like to do the same it's very well explained.