REIMPORT2 mode - no size limits

Extraction and unpacking of game archives and compression, encryption, obfuscation, decoding of unknown files
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: REIMPORT2 mode - no size limits

Post by aluigi »

Have you select the same folder you selected during extraction?
Because the files are not found there and I suppose the folder was c:\qbms\export1
VObject
Posts: 5
Joined: Fri Oct 09, 2020 8:51 am

Re: REIMPORT2 mode - no size limits

Post by VObject »

aluigi wrote:Have you select the same folder you selected during extraction?
Because the files are not found there and I suppose the folder was c:\qbms\export1


Oh, of course, my embarrassing fail, I'm sorry. Unlike other scripts, this one creates an sfx folder, and I thought that when importing it need to select it, and not the original exported one.
Now the import was successful, thanks a lot, you are the best, aluigi :!:
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: REIMPORT2 mode - no size limits

Post by aluigi »

Don't worry, it's a mistake that happens ;)
Happy it works now
VObject
Posts: 5
Joined: Fri Oct 09, 2020 8:51 am

Re: REIMPORT2 mode - no size limits

Post by VObject »

aluigi wrote:Don't worry, it's a mistake that happens ;)
Happy it works now


Oh Luigi, I think I was in a hurry to rejoice :(
In your updated script, the import works fine, but when exporting, the files are exported as broken .WAV :( In original script it was correct .Wwise

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

Re: REIMPORT2 mode - no size limits

Post by aluigi »

The reason is that I dump the file directly to the disk.
In the original script it gets saved in a buffer, analyzed for getting the extension and the dumping the buffer to disk.
Anyway it's just an extension so it's not really a problem :)
VObject
Posts: 5
Joined: Fri Oct 09, 2020 8:51 am

Re: REIMPORT2 mode - no size limits

Post by VObject »

aluigi wrote:The reason is that I dump the file directly to the disk.
In the original script it gets saved in a buffer, analyzed for getting the extension and the dumping the buffer to disk.
Anyway it's just an extension so it's not really a problem :)


Hmm, but how to import new file correctly then?

I tried:
1) Converted new mp3 file to wem (through wwise audiokinetic program) and replace this wem file to the pck archive instead of the unpacked wav
https://drive.google.com/file/d/15E2_mC ... sp=sharing

2) Converted new mp3 file to wem (through wwise audiokinetic program), rename extension to wav and replace this 'wav' file to the pck archive instead of the unpacked wav

3) Converted new mp3 file to wav and replace this wav file to the pck archive instead of the unpacked wav
https://drive.google.com/file/d/118kyUL ... sp=sharing

But game cannot read it :(

Also I tried to replace one file exported by this script from the package with another, but, unfortunately, the game still could not read modified pck after importing :(
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: REIMPORT2 mode - no size limits

Post by aluigi »

I can only give support for the usage of the reimport features, which is just running reimport2.bat (or reimport.bat in some cases) and keep fingers crossed.
Samdou
Posts: 16
Joined: Mon Jul 19, 2021 12:48 am

Re: REIMPORT2 mode - no size limits

Post by Samdou »

aluigi wrote:Technical explanation:

Example of input archive

Code: Select all

###112233################DATADATADATA#######
   | | |                 |
   | | |                 file
   | | size
   | compressed size
   offset
Standard reimport mode

Code: Select all

###112233################DATADATADATA#######
                         |          |
                         | new file |
New reimport2 mode

Code: Select all

###112233################DATADATADATA#######DATADATADATADATADATA
   | | |                                    |                  |
   | | |                                    | new bigger file! |
   | | new size
   | new compressed size
   new offset

As usual you will find all the info and limits (don't expect miracles) in section 3 of http://aluigi.org/papers/quickbms.txt

Feel free to post your positive and negative feedback about reimport2 here in this topic :)

What's the difference between reimport2 and reimport3?
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: REIMPORT2 mode - no size limits

Post by aluigi »

The difference is that reimport3 replace the original file with the new one in the same position by shrinking or enlarging the archive depending by the new size.

It's a method which is only useful when working on an archive containing sequential files without offset, for example many localization packages.

Example:

Code: Select all

###112233################DATADATADATA#######
                         |          |
                         | file     |

###112233################DATADAT#######
                         |     |
                         | new |

###112233################DATADATADATADATADATADATA#######
                         |                      |
                         | new                  |
Samdou
Posts: 16
Joined: Mon Jul 19, 2021 12:48 am

Re: REIMPORT2 mode - no size limits

Post by Samdou »

How can I tell if an archive is sequential and doesn't have an offset?
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: REIMPORT2 mode - no size limits

Post by aluigi »

check if the script contains an instruction like "get OFFSET".
But usually reimport3 is only useful in very rare situations, often when the "slog" instruction is involved in localization files containing sequential text strings.
Samdou
Posts: 16
Joined: Mon Jul 19, 2021 12:48 am

Re: REIMPORT2 mode - no size limits

Post by Samdou »

Thanks for the info
snailtrauma
Posts: 4
Joined: Mon Nov 18, 2019 6:22 pm

Re: REIMPORT2 mode - no size limits

Post by snailtrauma »

Hi. Recently I've looked into the possibility of translating the japanese PC version of Mr. Driller into English. Fortunately, QuickBMS has a HARC compression/decompression scheme for the *.DAT files, which has allowed me to at least see the image files that need editing.

However the game has... quite a few peculiar things inside it. There are text files, documents and even what seem to be browsing files for JASC Paint Shop Pro. Most of these seem to have been compiled but are seemingly unused by the game, as no references are made in the executable.

It also has a fair amount of images with English text. The game seems to be somewhat of an arcade port (which had an english version), but not all options or text are translated.

Unfortunately, the real issue here is that the image files are *.TIM files, and I'm not sure about the best way to reinsert them. Even being careful to have them retain the same size as their original JP versions, QuickBMS refuses to reimport many files, including the *.TIM files. I suspect it's because the program expects the files to have the HARC scheme but this obviously isn't the case for all of them.

What could be done to remedy this? Am I doing something wrong, or is another script/compression scheme required?
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: REIMPORT2 mode - no size limits

Post by aluigi »

Is there any error message from quickbms when you use reimport2.bat with the driller2_dat.bms script?
It seems a very simple format using zlib so quite ideal for reimporting.
snailtrauma
Posts: 4
Joined: Mon Nov 18, 2019 6:22 pm

Re: REIMPORT2 mode - no size limits

Post by snailtrauma »

Yes, every attempt at reinserting the files will produce the following error:

- signature of 4 bytes at offset 0x00000000 doesn't match the one
expected by the script:

this one: "x"
83 8c 83 78 ...x

expected: "HARC"
48 41 52 43 HARC


It shows this for every file, actually, even unchanged ones.
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: REIMPORT2 mode - no size limits

Post by aluigi »

Because it has been used in the wrong way.
You must launch reimport2.bat and select the SAME file and folder you selected for extraction.

IIt's very simple but for any doubt please check section 3 of http://aluigi.org/papers/quickbms.txt
snailtrauma
Posts: 4
Joined: Mon Nov 18, 2019 6:22 pm

Re: REIMPORT2 mode - no size limits

Post by snailtrauma »

That's exactly what I did, and the issue still happens.
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: REIMPORT2 mode - no size limits

Post by aluigi »

In case it isn't clear:

Extraction:
- run quickbms.exe
- select driller2_dat.bms
- select ARCHIVE.DAT (whatever is the name)
- select the output folder, for example c:\output

Reimporting:
- run reimport2.bat
- select driller2_dat.bms
- select ARCHIVE.DAT (whatever is the name)
- select the previous output folder where are the extracted files, for example c:\output