How to split apart an uncompressed .pac file?

Game_Master001

Well-Known Member
OP
Newcomer
Joined
Dec 9, 2007
Messages
47
Trophies
1
XP
278
Country
Netherlands
I know there are no tools for regular compressed .pac files from NDS games, but what I'm having here are uncompressed .pac files (from the Yu-Gi-Oh games World Championship 2007 and 2008). It's literally just files grouped together without any compression whatsoever: the files within and the contents of those files within can be seen just by opening it with a hex editor. I was wondering if this makes any difference, if there are any tools or tricks to extract the files from these kind of .pac files?
 

FAST6191

Techromancer
Editorial Team
Joined
Nov 21, 2005
Messages
36,798
Trophies
3
XP
28,348
Country
United Kingdom
.pac is a fairly generic extension and I know of at least 6 different variations on the DS. Can't remember if I did something with any of the yugioh games here though (most times people just want deck cheats and to change the limited deck customistion against AI not knowing that breaks AI in a hurry)

In most cases then usually at the start of the fie will be some kind of indicator as to how large each each sub file within is or its location (in which case next address-current address = file size), other times said info might be in a separate file in the same directory.

I did a similar thing the other day in
https://gbatemp.net/threads/need-help-ripping-files-from-call-of-duty-black-ops-ds.633221/

The main tool I used is https://web.archive.org/web/20170218180937/http://min.midco.net/cracker/filecutter.zip if you just need a quick thing to say slice up this much of the file starting at this address (tweak your hex editor to dump the addresses in a nice list, stuff that in a spreadsheet, easy enough to built up the command to get a little batch file going on, hard to then rebuild the thing after editing but there are still ways and if you only want to poke around then hey).
 

mn1712trungson

Member
Newcomer
Joined
Oct 15, 2022
Messages
13
Trophies
0
Age
30
XP
260
Country
Vietnam
If you can find the offset table (list pointer to the file) and size,
you can write the simple QuickBMS script and parse the whole package.

The sample PAC header:
1684991528004.png


Or use the spreadsheet and make the batch with the filecutter, like FAST said:
1684991690947.png


With QuickBMS, you can write the extract script and reimport the modified file with the same script.
In a basic way, you can cut the PAC header and the data chunk. Use batch and parse the whole data chunk.
After editing files, use the simple tool copy on Windows (https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/copy) or cat on Linux


to combine the whole binary package with:
COPY /V /B *.dat \combine\dat_chunk.pac
combine edited header with:
COPY /V /B dat_chunk.pac+header.pac \combine\dat.pac
 
Last edited by mn1712trungson,

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • No one is chatting at the moment.
    Veho @ Veho: It's how we used to cheat at Pokewalker.