[RELEASE] .pak file opener

Posts 16–30 of 44 · Page 2 of 3
nice to be helpful ...
Thnx looks cool.
But what can you exactly do with this tool ?
Quote Originally Posted by Stroop1337 View Post
Thnx looks cool.
But what can you exactly do with this tool ?
unpack .pak files, than you can change values
Now, how do we inject them back into the .pak file?
Quote Originally Posted by Ltlouis View Post
Now, how do we inject them back into the .pak file?
its not necessary, just recreate the same directory tree in the same directory.

example: you have pak in

\Electronic Arts\Crytek\Crysis 2\gamecrysis2

you want to edit nanosuit.xml in scripts\entities\nanosuit, extract it, and place it within the same tree

\Electronic Arts\Crytek\Crysis 2\gamecrysis2\Scripts\Entities\NanoSuit

the engine will overwrite directives using the uncompressed one
Quote Originally Posted by xqtm View Post
its not necessary, just recreate the same directory tree in the same directory.

example: you have pak in

\Electronic Arts\Crytek\Crysis 2\gamecrysis2

you want to edit nanosuit.xml in scripts\entities\nanosuit, extract it, and place it within the same tree

\Electronic Arts\Crytek\Crysis 2\gamecrysis2\Scripts\Entities\NanoSuit

the engine will overwrite directives using the uncompressed one
I actually did a texture mod. So, that would be different.
Quote Originally Posted by Ltlouis View Post
I actually did a texture mod. So, that would be different.
C:\Program Files\Crytek\Crysis 2\gamecrysis2\Textures\folder tree here?
Great thats Work

but if i want pak again how can i do ???

Becocse UK server ranked Kiked me when i use Scripts folder and not when i use Script.pak

i have creat file.bat with "quickbms.exe-w-r" but dosent work :/

i m wainting for answer ty for all
Just double click on quickbms and follow the prompts, it has a simple GUI you know.
you can read the manual but anyway ill post it there. be aware, recompression (injection) is not guaranteed.

you CANNOT increase the size of the files you want to reimport, so the new files must be minor or equal than the originals

EXTRACTION USAGE

Code:
Usage: quickbms [options] <script.BMS> <input_archive/folder> <output_folder>

 Options:
 -l     list the files without extracting them, you can use . as output folder
 -f W   filter the files to extract using the W wildcard, example -f "*.mp3"
 -F W   as above but works only with the files in the input folder (if used)
 -o     if the output files already exist this option will overwrite them
        automatically without asking the user's confirmation
 -r     experimental reimport option that should work with some archives:
          quickbms script.bms archive.pak output_folder
          modify the needed files in output_folder and maybe remove the others
          quickbms -w -r script.bms archive.pak output_folder
 -w     enable the write mode required to write phisical input files with Put*
 -d     automatically creates an additional output folder with the name of the
        input file processed without extension
 -E     experimental option for automatically reversing the endianess of any
        memory file simply reading it field by field
 -c     quick list of BMS commands and some notes about them and this tool
 -v     verbose debug informations, useful for verifying possible errors
 -L F   dump the offset/size/name of the files inside the file F
 -x     use the hexadecimal notation in myitoa (debug)
 -0     no extraction of files, useful for testing a script without using space

Reimporting the extracted files

Code:
As already said QuickBMS is a primarly an extraction tool, anyway from
version 0.4.9 it supports also the -r option that transforms the tool
in a simple reimporter/reinjector and so could be useful in some cases
for who wants to mod or translate a game.

The idea consists in being able to reimport ("inject back") the
modified files in the majority archives without touching a single line
of the script, yeah just reusing the same bms scripts that already
exist!

Using this feature is really trivial and the following is an example
step-by-step:

- make a backup copy of the original archive!

- extract the files or only those you want to modify (-f option) as you
  do normally via the GUI (double-click on quickbms.exe) or via
  command-line:

    quickbms script.bms archive.pak output_folder

- do your modifications to the extracted files and I suggest to delete
  the files that have not been modified so that the reimporting process
  will be faster, so if you can it's better if in the folder you leave
  only the files you have changed
  note that their size must be minor or equal than the original!

- reimport the files in the archive via the GUI (like the file.bat
  containing quickbms.exe -w -r) or command-line:

    quickbms -w -r script.bms archive.pak output_folder

- test the game with the modified archive

Obviously you can use the GUI also for the reimporting procedure
because it's enough to create a batch file called reimport.bat
containing the following line and then double clicking on it when you
need to do this job:

  quickbms.exe -w -r

Now some important notes about this particular reimporting process:
- you CANNOT increase the size of the files you want to reimport, so
  the new files must be minor or equal than the originals
- for the maximum compatibility within the thousands of available file
  formats I have decided to not use tricks for modifying the original
  size and compressed_size values (think to those formats that use
  encrypted information tables or the scripts that use MEMORY_FILEs
  for such tables or that use things like "math SIZE *= 0x800")
- the script is just the same for both the extraction and the
  reimporthing phase which means that many of the scripts written by me
  and the other users already work
- the reimporting of compressed files is perfectly possible because
  the tool automatically switches to the relative compression algorithm
  if available (for example zlib->zlib_compress)
- if the original archive uses complex encryptions that require the
  usage of MEMORY_FILEs to perform temporary decryptions then it's NOT
  supported and the same is valid for chunked content (like the usage
  of the command Append)
- FileXor, FileRot, Encryption and Filecrypt should work correctly
- things like CRCs and hashes can't be supported
- it's possible to reimport also the nameless files (log "" OFFSET SIZE)
  but you must first change their extension in DAT so that QuickBMS
  will find and load them, for example 00001234.txt must be renamed to
  00001234.dat
ok i understad what u say

But the probleme i have 0 files reimported :/

i dont understand is so strange

mmh file size are correct ? lemme see what file are you trying to repack and a logprint maybe
When I make a .bat file, and type inside:

quickbms -w -r Scripts.bms Scripts.pak C:\Users\Jerry\Documents\Crysis2 stuff\quickbms\Scripts

it creates a .pak file named "Scripts.pak" but 0 kb.

I successfully extracted the Scripts folder, which I Now have and can browse in, I changed some value and want to extract it back to a .pak and see if it works.

It doesnt work with only the edited .xml file in a new folder in Scripts/Events.xml, I dont get any xp bonus when I tried the several other already edited Events.xml
Because I saw another tutorial which said:
"For example, if the folder "Scripts" is present in the same directory as Scripts.pak, the game will read first from the folder, then if files are missing, it will read them from the archive." And I saw you mention it earlier in this post aswell xqtm.
Awesome , now i can get the soundtracks and look for hidden stuff

thanks to the OP , here's the music files
Posts 16–30 of 44 · Page 2 of 3
This thread is closed for replies.
Talk with us