Switch PAK archive

Extraction and unpacking of game archives and compression, encryption, obfuscation, decoding of unknown files
Riesz
Posts: 9
Joined: Mon Nov 15, 2021 8:56 pm

Switch PAK archive

Post by Riesz »

I've been trying to extract files from a Switch game called Taisho x Alice and although the game files are .PAK, none of the various PAK tools or 7zip I've tried are able to extract these files.

Here's an example of one of the PAK archives:
https://www.mediafire.com/file/1fa0obmt ... G.PAK/file
rabatini
Posts: 179
Joined: Tue Jan 18, 2022 12:21 am

Re: Switch PAK archive

Post by rabatini »

Riesz wrote:I've been trying to extract files from a Switch game called Taisho x Alice and although the game files are .PAK, none of the various PAK tools or 7zip I've tried are able to extract these files.

Here's an example of one of the PAK archives:
https://www.mediafire.com/file/1fa0obmt ... G.PAK/file


This will extract the pak.
i dont know if it will work with all files.
if not, send more samples.

Code: Select all

get NOIDEA long
get ENTRIES long
getdstring NOIDEA 0x24
for RIP = 1 to ENTRIES
get OFFSET long
xmath OFFSET "(OFFSET * 0X800)"
get SIZE long
log "" OFFSET SIZE
next RIP
Riesz
Posts: 9
Joined: Mon Nov 15, 2021 8:56 pm

Re: Switch PAK archive

Post by Riesz »

rabatini
Posts: 179
Joined: Tue Jan 18, 2022 12:21 am

Re: Switch PAK archive

Post by rabatini »

Here

Taisho x Alice.bms


Code: Select all

# Script by Rabatini (Luke)
# Taisho x Alice - SWITCH (.PAK)
# Version 0.1b

get NOIDEA long
get ENTRIES long
get NOIDEA long
get matematica long
getdstring zeros 0x10
get check long
if check == 0x00000200
get name_table long
savepos pointer_table
goto name_table
get name string
savepos name_table
goto pointer_table

for RIP = 1 to ENTRIES
       
   get OFFSET long
   xmath OFFSET "(OFFSET * matematica)"
   get SIZE long
   savepos table
   log name OFFSET SIZE
   goto name_table
   get name string
   savepos name_table
   goto table

next RIP
else
goto 0x08
getdstring NOIDEA 0x20
get check long
  if check == 0
for RIP = 1 to ENTRIES

   get OFFSET long
   xmath OFFSET "(OFFSET * MATEMATICA)"
   get SIZE long
   log "" OFFSET SIZE
next rip
   elif check > 0
get zeros longlong
for RIP = 1 to ENTRIES

   get OFFSET long
   xmath OFFSET "(OFFSET * MATEMATICA)"
   get SIZE long
   log "" OFFSET SIZE

next RIP
   

endif




Ugly but works.
Riesz
Posts: 9
Joined: Mon Nov 15, 2021 8:56 pm

Re: Switch PAK archive

Post by Riesz »

Thank you so much!!