QuickBMS - Reimporting files in the archives

Videos, guides, manuals, documents and tutorials about using tools and performing tasks
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

QuickBMS - Reimporting files in the archives

Post by aluigi »

An interesting feature of quickbms is the possibility to reimport/reinject the extracted files back in the archives.
It does NOT work with 100% of the scripts and there are some limitations but it's a great alternative to spending hours writing a repacker.

Details in section 3 of quickbms.txt:
http://aluigi.org/papers/quickbms.txt

Sometimes you don't need to reimport or rebuild an archive because probably the game already has the ability to load the files outside the archive.
Other times it's necessary to specify a command-line option to allow that operation.

If all the solutions fail, it's time to use the reimporting mode.

Things to know and limitations:
  • you can reinject the files only if they have a size equal or smaller than the original ones
  • only the most used compression algorithms are used, like zlib/deflate, lzma, lzo, lzss and many others
  • the scripts that dump the file from the memory file (for example for chunked files) are not supported

To use this feature you must:
  • make a backup copy of the archive
  • extract the files using the necessary script
  • edit the files you want to modify
  • delete all the files that have not been modified
  • double click on reimport.bat
  • do the SAME steps you did for extracting the archive.
    Seriously, do the same just like if you are extracting the files to the same folder.
    QuickBMS will do the job automatically
  • quickbms will show the names of the files that have been reimported
  • try the game with the new archive

Yes, it's really extremely simple.
shekofte
Posts: 42
Joined: Sun Aug 10, 2014 9:22 am

Re: QuickBMS - Reimporting files in the archives

Post by shekofte »

Hello Luigi Auriemma and congratulation on zenhax :)

what is the simplest BMS script to compress a single file to .gzip by reimporting ability of Qbms ? just like a file compressor !
(i guess i must define an imaginary extracted archive first)
if you show me such example you will release my obsession .
your sincerely shekofte
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: QuickBMS - Reimporting files in the archives

Post by aluigi »

So you had a gzip file and you want to extract the content and then reinjecting it, right?

Code: Select all

comtype gzip
get SIZE asize
clog "dump.dat" 0 SIZE SIZE

I don't think that gzip is the best example because it's a format that is already widely supported, like zip :)
shekofte
Posts: 42
Joined: Sun Aug 10, 2014 9:22 am

Re: QuickBMS - Reimporting files in the archives

Post by shekofte »

aluigi wrote:So you had a gzip file and you want to extract the content and then reinjecting it, right?


suppose i have a large story.txt file that i just want to compress it as .gzip or other recompression supported algorithms !
how to fully programmaticly read the file and save it as zip extensions ?
is there such facility or trick for doing this ?
i wish there was a command like zlog that is inverse of clog and outputs compressed data !
excuse me if my request is foolish :(

anyway i am so eager to see some nice examples that you offer ?
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: QuickBMS - Reimporting files in the archives

Post by aluigi »

Now I undestand what you mean.
Quickbms has the compress algorithms that do just that so if you want to compress a file without instead of reimporting it, you can do it:

Code: Select all

comtype gzip_compress
get SIZE asize
clog "dump.gz" 0 SIZE SIZE
No size limits, it's just a compression and not a reimporting.
If you need a list of supported algorithms take a look at quickbms.txt and search "recompression algorithms".
shekofte
Posts: 42
Joined: Sun Aug 10, 2014 9:22 am

Re: QuickBMS - Reimporting files in the archives

Post by shekofte »

thanks man Qbms is really glorious
although i already read the guide but i can't recognize it , i feel sorry for myself ...
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: QuickBMS - Reimporting files in the archives

Post by aluigi »

I will release more tutorials in the next weeks
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: QuickBMS - Reimporting files in the archives

Post by aluigi »

Currently it's not possible to reimport the files that have been renamed during the extraction.

For example when two files have the same name you can rename the second one manually or automatically with the 'r' choice.

I'm trying to think to some solutions but it's not so easy.
raykingnihong
Posts: 71
Joined: Fri Oct 24, 2014 3:13 pm

Re: QuickBMS - Reimporting files in the archives

Post by raykingnihong »

Hi aluigi my friend very good tutorial I am learning
Amsal
Posts: 3
Joined: Sun Feb 14, 2016 7:00 am

Re: QuickBMS - Reimporting files in the archives

Post by Amsal »

How can I give the script.bms and the files and the output file in the reimport.bat directly without the GUI!
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: QuickBMS - Reimporting files in the archives

Post by aluigi »

quickbms.exe -r -w script.bms archive.dat folder

The -G option in reimport.bat is an option to force the GUI mode.
lastdreamer
Posts: 6
Joined: Sun Jul 03, 2016 12:20 pm

Re: QuickBMS - Reimporting files in the archives

Post by lastdreamer »

Hi,

I would like to make a french translation for the game Zero Escape : Zero Time Dilemma, so I used Quick BMS to extract files. But I saw that I can only reimport if the file have a size equal or smaller than the original ones. But French sentences is bigger than English sentences, so it is a big problem for me. Have you another way to reimporte bigger files ?

Thank you !
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: QuickBMS - Reimporting files in the archives

Post by aluigi »

It's a problem of physical space, so there is no ready solution except writing a rebuilder from scratch (the format is not complex) or just appending the new content to the file and then modifying the OFFSET and SIZE field in the archive (something that requires manual work but may be easy with the help of quickbms -l -V).

Are you 100% sure that the game isn't able to load the extracted files?
Maybe check that with Process Monitor and the File filter, because often the games work without archives too.
lastdreamer
Posts: 6
Joined: Sun Jul 03, 2016 12:20 pm

Re: QuickBMS - Reimporting files in the archives

Post by lastdreamer »

Finaly I made my own rebuilder and it work :). It was more easier than I thought.
SADEKFCB
Posts: 4
Joined: Thu Sep 15, 2016 10:17 pm

i'Can not Reimporting file

Post by SADEKFCB »

Image[/URL

[URL=http://www.m5zn.com/out.php?code=16449280]Image


after extracting the file dds from file arch00 And modify it I try Reimport it but dos'nt work

O0 files reimported in 4 seconds

I hope you give me a solution And give us an explanation for video
and Thanks for everything

:geek: :|
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: QuickBMS - Reimporting files in the archives

Post by aluigi »

Please read section 3 of quickbms.txt very carefully:
http://aluigi.org/papers/quickbms.txt

You must select THE SAME input script, input file and output folder you selected during extraction!
SADEKFCB
Posts: 4
Joined: Thu Sep 15, 2016 10:17 pm

Re: QuickBMS - Reimporting files in the archives

Post by SADEKFCB »

iFollowed the instructions But the way did not work

https://www.facebook.com/njimo.jsk/vide ... 002334700/

Watch the video and Tell me where error

:geek: :| :|
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: QuickBMS - Reimporting files in the archives

Post by aluigi »

@SADEKFCB
Show me the video of the extraction.
The one you linked simply show a possible wrong selection of the folder which is why quickbms can't find the files to reimport.
In case I wasn't clear before:
You must select THE SAME input script, input file and output folder you selected during extraction!

Additionally note that fear.bms is not 100% valid in reimporting because some files are built in memory before being extracted and so reimporting will not work with some files.
SADEKFCB
Posts: 4
Joined: Thu Sep 15, 2016 10:17 pm

Re: QuickBMS - Reimporting files in the archives

Post by SADEKFCB »

This is the extraction Video
https://www.facebook.com/njimo.jsk/vide ... 966918814/

I hope you will help me


:| :| :|
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: QuickBMS - Reimporting files in the archives

Post by aluigi »

I already helped you, the problem is the selection of the folder which is different than the one of the extraction.
It's very easy: extraction steps = reimporting steps.
Nothing else to add.