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.

[HELP] *.PAK (PK) archive

Featured Replies

  • Author
  • Localization

amVspR, posted Sun May 29, 2022 4:46 am (71717)


Hi there, I need help extracting this PAK (PK) archive from a decrypted PSV game (Gakuen K wonderful school days). Many thanks in advance. I tried the available PK scripts here but no luck.
Here're the samples:
Link: https://mega.nz/file/t9YXVbTR#-Noed9z0O ... qYcjawkMVc
  • Author
  • Localization

BloodRaynare, posted Sun May 29, 2022 4:50 am (71718)


Pretty sure this file is just a normal zip file, you can use 7-zip to extract it.
  • Author
  • Localization

amVspR, posted Sun May 29, 2022 4:54 am (71719)


BloodRaynare wrote:
Pretty sure this file is just a normal zip file, you can use 7-zip to extract it.

Thanks for replying! I tried 7-zip with the original PAK archive, but only 1 file "BG_001_a.DAT_" extracted.
  • Author
  • Localization

BloodRaynare, posted Sun May 29, 2022 4:57 am (71720)


amVspR wrote:
Thanks for replying! I tried 7-zip with the original PAK archive, but only 1 file "BG_001_a.DAT_" extracted.


If you open the original PAK with hex editor, does it has the multiple instances of "PK" followed by the filenames? (Normally, zip files has those things at the tail end of the file).
  • Author
  • Localization

amVspR, posted Sun May 29, 2022 5:02 am (71721)


BloodRaynare wrote:
amVspR wrote:
Thanks for replying! I tried 7-zip with the original PAK archive, but only 1 file "BG_001_a.DAT_" extracted.


If you open the original PAK with hex editor, does it has the multiple instances of "PK" followed by the filenames? (Normally, zip files has those things at the tail end of the file).

Here's what it looks like in Hex (attached), there's only 1 PK at the beginning
  • Author
  • Localization

BloodRaynare, posted Sun May 29, 2022 5:09 am (71722)


amVspR wrote:
Here's what it looks like in Hex (attached), there's only 1 PK at the beginning


Try use "Find" (Ctrl-F) then enter this in "hex-values" field: 504b0304 (or 504b0102), then choose "Search All" and post how many search "Hits" the HxD reports?
  • Author
  • Localization

amVspR, posted Sun May 29, 2022 5:14 am (71723)


BloodRaynare wrote:
amVspR wrote:
Here's what it looks like in Hex (attached), there's only 1 PK at the beginning


Try use "Find" (Ctrl-F) then enter this in "hex-values" field: 504b0304 (or 504b0102), then choose "Search All" and post how many search "Hits" the HxD reports?

1720 hits for 504b0102
1719 hits for 504b0304
  • Author
  • Localization

BloodRaynare, posted Sun May 29, 2022 5:17 am (71724)


amVspR wrote:
1720 hits for 504b0102
1719 hits for 504b0304


Okay, can you screenshot the contents of the few (not all) of those hits? (Double click on the results)
  • Author
  • Localization

amVspR, posted Sun May 29, 2022 5:21 am (71725)


BloodRaynare wrote:
amVspR wrote:
1720 hits for 504b0102
1719 hits for 504b0304


Okay, can you screenshot the contents of the few (not all) of those hits? (Double click on the results)

Here you go
  • Author
  • Localization

BloodRaynare, posted Sun May 29, 2022 5:35 am (71727)


amVspR wrote:
Here you go


Okay, after checking again the cutted file you posted here, I kind of understand what's going on here. The DATA.PAK is not an one big zip file, but rather a collection of zip files combined into one. Does the DATA directory also has kind of index file that weighs smaller than the PAK file, like DATA.IDX or something?
  • Author
  • Localization

amVspR, posted Sun May 29, 2022 6:19 am (71729)


BloodRaynare wrote:
amVspR wrote:
Here you go


Okay, after checking again the cutted file you posted here, I kind of understand what's going on here. The DATA.PAK is not an one big zip file, but rather a collection of zip files combined into one. Does the DATA directory also has kind of index file that weighs smaller than the PAK file, like DATA.IDX or something?

The Voice.Pak has an IDX file, but Data.PAK doesn't.
I uploaded some relevant files: https://mega.nz/file/E5RS0Irb#IIrBmGR_b ... g3MJmGy7hE [Core.dat and the Debug folder]
  • Author
  • Localization

BloodRaynare, posted Sun May 29, 2022 7:32 am (71730)


After some checking, turns out the index file for DATA.PAK (DATA.IDX) was indeed inside the CORE.DAT_ file which were nest-zipped inside CORE.DAT (Use 7-zip to extract it). To obtain the DATA.IDX file we need to run this BMS script to extract the contents of CORE.DAT_ file (note the underscore, don't confuse it with the zip-renamed CORE.DAT):

gakuen_k_dat.bms

Code:
IDString "DAT\x20"
get FILES long
for i = 0 < FILES
   getDstring NAME 0x20
   get SIZE long
   get OFFSET long
   log NAME OFFSET SIZE
next i


After that, you'll need to put the DATA.IDX on the same directory as the DATA.PAK file, then run this script:

gakuen_k_idx_pak.bms

Code:
open FDDE IDX
open FDDE PAK 1

IDString "PAK\x20"
get FILES long
for i = 0 < FILES
   get UNK1 long # Hash?
   get OFFSET long
   get SIZE long
   string NAME p "%s." UNK1
   log NAME OFFSET SIZE 1
next i


These scripts on the above requires to be run with QuickBMS
  • Author
  • Localization

amVspR, posted Sun May 29, 2022 5:06 pm (71734)


BloodRaynare wrote:
After some checking, turns out the index file for DATA.PAK (DATA.IDX) was indeed inside the CORE.DAT_ file which were nest-zipped inside CORE.DAT (Use 7-zip to extract it). To obtain the DATA.IDX file we need to run this BMS script to extract the contents of CORE.DAT_ file (note the underscore, don't confuse it with the zip-renamed CORE.DAT):

gakuen_k_dat.bms

Code:
IDString "DAT\x20"
get FILES long
for i = 0 < FILES
   getDstring NAME 0x20
   get SIZE long
   get OFFSET long
   log NAME OFFSET SIZE
next i


After that, you'll need to put the DATA.IDX on the same directory as the DATA.PAK file, then run this script:

gakuen_k_idx_pak.bms

Code:
open FDDE IDX
open FDDE PAK 1

IDString "PAK\x20"
get FILES long
for i = 0 < FILES
   get UNK1 long # Hash?
   get OFFSET long
   get SIZE long
   string NAME p "%s." UNK1
   log NAME OFFSET SIZE 1
next i


These scripts on the above requires to be run with QuickBMS

The scripts worked! Thank you so much!
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.