Important information: this site is currently scheduled to go offline indefinitely by end of the year.
Rebuilding archives with QuickBMS
- aluigi
- VVIP member
- Posts: 1916
- Joined: Thu Dec 08, 2005 12:26 pm
- Location: www.ZENHAX.com
- Has thanked: 4 times
- Been thanked: 664 times
- Contact:
Rebuilding archives with QuickBMS
The contents of this post was deleted because of possible forum rules violation.
- shekofte
- mega-veteran
- Posts: 221
- Joined: Sun Jan 18, 2009 1:45 pm
- Location: Sagittarius
- Has thanked: 301 times
- Been thanked: 20 times
- Contact:
Re: Rebuilding archives with QuickBMS
adding more rebuilding functions to QuickBMS make it an acme tool ...
ILLUSORY VIDEO GAMES ARE MORE IMPORTANT THAN PRECIOUS INTERNATIONAL FOOTBALLs
-
- VIP member
- Posts: 288
- Joined: Mon May 02, 2005 1:48 pm
- Location: Louisville, KY
- Has thanked: 10 times
- Been thanked: 70 times
- Contact:
Re: Rebuilding archives with QuickBMS
Yeah, I made a script to rebuild headers on pac files that the files are all the same size. Came in handy for what I used it for.
Re: Rebuilding archives with QuickBMS
is there a script to rebuild Svr 2010 pac files with quickbms?
- aluigi
- VVIP member
- Posts: 1916
- Joined: Thu Dec 08, 2005 12:26 pm
- Location: www.ZENHAX.com
- Has thanked: 4 times
- Been thanked: 664 times
- Contact:
Re: Rebuilding archives with QuickBMS
I already tried to write that script just for my tests and was ok except for 2 things:
- quickbms doesn't have a crc function and the zip archives need the crc of each archived file otherwise the extraction program doesn't extract them (yes I have already tried using the magic crc 0xdebb20e3)
- you can only store the files because quickbms doesn't support recompression (it's an extractor)
- aluigi
- VVIP member
- Posts: 1916
- Joined: Thu Dec 08, 2005 12:26 pm
- Location: www.ZENHAX.com
- Has thanked: 4 times
- Been thanked: 664 times
- Contact:
Re: Rebuilding archives with QuickBMS
first an update for my previous post: both the "exception" have been solved some versions ago, indeed quickbms supports a complete crc engine (plus tons of hashing algorithms) and supports also some recompression algorithms (zlib, xmem, lzo and so on).
instead now I want to talk about a feature I have implemented in version 0.4.6 for providing a solution for the current requests about endianess conversions.
I have implemented the -E option that costed me only 3 lines of code and automatically convert the endianess of any number read from a file.
imagine to have a file with the following format:
the script for reading it would be:
if you add the -E and -w options at the command-line of quickbms the SAME reading/extracting script will automatically change the endianess of those 3 values :)
it's also possible to avoid to add the -w option by loading the file into a memory file, like the following example:cool :)
instead now I want to talk about a feature I have implemented in version 0.4.6 for providing a solution for the current requests about endianess conversions.
I have implemented the -E option that costed me only 3 lines of code and automatically convert the endianess of any number read from a file.
imagine to have a file with the following format:
Code: Select all
32bit signature
32bit size
16bit crc
Code: Select all
get signature long
get size long
get crc short
it's also possible to avoid to add the -w option by loading the file into a memory file, like the following example:
Code: Select all
get file_size asize
log MEMORY_FILE 0 file_size
get signature long MEMORY_FILE
get size long MEMORY_FILE
get crc short MEMORY_FILE
log dump.dat 0 file_size MEMORY_FILE
- aluigi
- VVIP member
- Posts: 1916
- Joined: Thu Dec 08, 2005 12:26 pm
- Location: www.ZENHAX.com
- Has thanked: 4 times
- Been thanked: 664 times
- Contact:
Re: Rebuilding archives with QuickBMS
I have just released version 0.4.9 of QuickBMS which contains a feature that will make happy a lot of people :)
from now it's possible to use QuickBMS also for reimporting files back in the archives without modifying the original script, so just an automatic inverted operation.
obviously there are some limitations, the first of which is the size of the imported files that must be equal or minor than the original one (that's why it's a reimported and not a real rebuilder).
the following is the detail I have added in the documentation of quickbms.txt:anyway keep in mind that this is not guarantee with all the file formats and you can find an exaustive list of "exceptions" in the relative section quickbms.txt
@jurko
maybe you can try with this new feature but the result could not work, in any case I can't help.
but probably exist tools that already do the rebuilding job for that specific format
from now it's possible to use QuickBMS also for reimporting files back in the archives without modifying the original script, so just an automatic inverted operation.
obviously there are some limitations, the first of which is the size of the imported files that must be equal or minor than the original one (that's why it's a reimported and not a real rebuilder).
the following is the detail I have added in the documentation of quickbms.txt:
Code: Select all
The idea consists in being able to reimport the modified files for the
less complex archives without touching a single line of the script,
yeah just reusing the same bms scripts that already exist!
The function is experimental and it must be used in the following way:
- make a backup copy of the original archive!
- extract the files you want to modify (-f option) or just all the
files as you do normally via the GUI or by command-line:
quickbms script.bms archive.pak output_folder
- do your modifications to the extracted files and delete the files
that have not been modified so that the reimporting process will be
faster
- reimport the files in the archive:
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 file.bat containing the following line
and then double clicking it when you need to do this job:
quickbms.exe -w -r
@jurko
maybe you can try with this new feature but the result could not work, in any case I can't help.
but probably exist tools that already do the rebuilding job for that specific format
Re: Rebuilding archives with QuickBMS
Thanx for the new features in a great tool,but when i come to rebuild the files back in a .cpk file the files are the same ones,i tested by filling the files with 1 byte,and the result is the same - 1650 files reimported in 5 seconds
Im` using the bms script for cpk files in a line command:-
quickbms cpk.bms *.cpk extracted
and to reimport:-
quickbms -w -r cpk.bms *.cpk extracted
thanx cozy
Im` using the bms script for cpk files in a line command:-
quickbms cpk.bms *.cpk extracted
and to reimport:-
quickbms -w -r cpk.bms *.cpk extracted
thanx cozy
- aluigi
- VVIP member
- Posts: 1916
- Joined: Thu Dec 08, 2005 12:26 pm
- Location: www.ZENHAX.com
- Has thanked: 4 times
- Been thanked: 664 times
- Contact:
Re: Rebuilding archives with QuickBMS
oh finally a feedback about the new feature :)
can you check if you have the current version of quickbms?
it's 0.4.10, I have fixed various things lately after having implemented this feature
then the tool has reported that over 1600 files have been reimported so it seems correct, indeed the reimported files are counted only when each operation succeded at 100%.
are you sure the directory you selected contains the modified files?
if you have not modified all the 1600 files would be better to delete those that have not been modified.
as final test make a binary comparison between the original archive and the modified one.
I have verified the cpk.bms script and it uses a compression algorithm not supported in recompression mode so you can reimport in the archive ONLY the files that weren't compressed.
as far as I know doesn't exist code of the recompressor available publicly
can you check if you have the current version of quickbms?
it's 0.4.10, I have fixed various things lately after having implemented this feature
then the tool has reported that over 1600 files have been reimported so it seems correct, indeed the reimported files are counted only when each operation succeded at 100%.
are you sure the directory you selected contains the modified files?
if you have not modified all the 1600 files would be better to delete those that have not been modified.
as final test make a binary comparison between the original archive and the modified one.
I have verified the cpk.bms script and it uses a compression algorithm not supported in recompression mode so you can reimport in the archive ONLY the files that weren't compressed.
as far as I know doesn't exist code of the recompressor available publicly
Re: Rebuilding archives with QuickBMS
aluigi wrote:oh finally a feedback about the new feature
I have verified the cpk.bms script and it uses a compression algorithm not supported in recompression mode so you can reimport in the archive ONLY the files that weren't compressed.
as far as I know doesn't exist code of the recompressor available publicly
I`ve got the new 0.4.10,and yes the files are compressed as i`ve looked at them using the CriPackedFileMaker.exe,so i guess thats why the files was not added,thanks for the reply,and keep up the good work!!!
- aluigi
- VVIP member
- Posts: 1916
- Joined: Thu Dec 08, 2005 12:26 pm
- Location: www.ZENHAX.com
- Has thanked: 4 times
- Been thanked: 664 times
- Contact:
Re: Rebuilding archives with QuickBMS
quickbms reports an error if the recompression algorithm is not available, so if you didn't see the error then it's something else
- shekofte
- mega-veteran
- Posts: 221
- Joined: Sun Jan 18, 2009 1:45 pm
- Location: Sagittarius
- Has thanked: 301 times
- Been thanked: 20 times
- Contact:
Re: Rebuilding archives with QuickBMS
thanks Luigi
your tool is like a magic wand
your tool is like a magic wand
ILLUSORY VIDEO GAMES ARE MORE IMPORTANT THAN PRECIOUS INTERNATIONAL FOOTBALLs
- aluigi
- VVIP member
- Posts: 1916
- Joined: Thu Dec 08, 2005 12:26 pm
- Location: www.ZENHAX.com
- Has thanked: 4 times
- Been thanked: 664 times
- Contact:
Re: Rebuilding archives with QuickBMS
I'm almost ready to release a new version of quickbms so if you have crazy ideas or suggestions, that's the moment to tell me :)