Quick BMS

Read or post about compression. And decompression. Or ask questions how to decompress your files.
Post Reply
xboxmaniac
beginner
Posts: 39
Joined: Sat Apr 21, 2012 8:19 am
Has thanked: 1 time
Been thanked: 6 times

Quick BMS

Post by xboxmaniac »

Hi,
i'm using Quick BMS for repack some files. Quick BMS doesn't support repack bigger file original.
Is there some way how repack bigger files than original ?
Or reduce files what i want repack ?
Sorry for my bad english.
THX :)
chrrox
Moderator
Posts: 2602
Joined: Sun May 18, 2008 3:01 pm
Has thanked: 57 times
Been thanked: 1398 times

Re: Quick BMS

Post by chrrox »

the auto function wont let you put back bigger files.
you can code your own script to repack any file but you have to know what you are doing in quickbms.
he has provided a few examples of how to do it.
COOLak
ultra-n00b
Posts: 9
Joined: Mon Aug 13, 2012 7:19 pm

Re: Quick BMS

Post by COOLak »

Then can someone please rewrite the script for me so it could re-import files bigger than original?

Code: Select all

ImpType Standard

# signature 0x1234
IDString "\x34\x12\x00\x00"

Get TOC Long
GoTo TOC

# signature 0x5768
IDString "\x78\x56\x00\x00"

Get FileCount Long
Get TOCPkSize Long
# 256+4+4+4=268
Math TOCUnSize = FileCount
Math TOCUnSize *= 268
SavePos TOC
# skip deflate magic bytes
Math TOCPkSize -= 2
Math TOC += 2
# workaround fix for big TOC in some archives
Math TOCUnSize *= 2

# unpack TOC
ComType deflate
Clog MEMORY_FILE TOC TOCPkSize TOCUnSize
ComType copy

For I = 1 To FileCount
  GetDString FileName 256 MEMORY_FILE
  Get FileOffs Long MEMORY_FILE
  Get FilePack Long MEMORY_FILE
  Get FileSize Long MEMORY_FILE
# skip deflate magic bytes
  Math FileOffs += 2
  Math FilePack -= 2

  ComType deflate
  Clog FileName FileOffs FilePack FileSize
  ComType copy
Next I
Many thanks in advance.
finale00
M-M-M-Monster veteran
M-M-M-Monster veteran
Posts: 2382
Joined: Sat Apr 09, 2011 1:22 am
Has thanked: 170 times
Been thanked: 303 times

Re: Quick BMS

Post by finale00 »

Pretty sure the restriction that the filesize cannot be bigger than the original is program limitation, not a script limitation.
COOLak
ultra-n00b
Posts: 9
Joined: Mon Aug 13, 2012 7:19 pm

Re: Quick BMS

Post by COOLak »

finale00 wrote:Pretty sure the restriction that the filesize cannot be bigger than the original is program limitation, not a script limitation.
Well, I'm considering these words:
chrrox wrote:the auto function wont let you put back bigger files.
you can code your own script to repack any file but you have to know what you are doing in quickbms.
he has provided a few examples of how to do it.

And if this is still not possible, then I will be greatful for the way that can provide me such functionality. Because I know it is possible. Some modders have repacked this game's archives and they didn't care about filesize, they have exceeded it when localized the game, but it works.

Examples of files: http://narod.ru/disk/59467538001.12b045 ... 1.res.html
http://narod.ru/disk/59467548001.f5aa85 ... 3.res.html
User avatar
aluigi
VVIP member
VVIP member
Posts: 1916
Joined: Thu Dec 08, 2005 12:26 pm
Location: www.ZENHAX.com
Has thanked: 4 times
Been thanked: 654 times
Contact:

Re: Quick BMS

Post by aluigi »

the words of chrrox mean only that if you want to use bigger files you must code a repacker from scratch, and in that case a bms script is not a good solution because it doesn't grant the flexibility and the complexity needed for a repacker/rebuilder.

in short if the script is valid for reinjection (files <= originals, no crc/hash checks performed by the game and so on) then you have the perfect solution for replacing the modified files with no effort of the programmer who wrote the script and you.

if you want or need to write a repacker then you need the maximum effort which includes not only the programming work but also the reversing of the additional fields that you can ignore in extraction/reinjection work.

that's why the reinjection mode of quickbms is so incredibly cool for you (users) and moreover for me and other scripters who need to do zero work for the reinjection :)
COOLak
ultra-n00b
Posts: 9
Joined: Mon Aug 13, 2012 7:19 pm

Re: Quick BMS

Post by COOLak »

aluigi wrote:the words of chrrox mean only that if you want to use bigger files you must code a repacker from scratch, and in that case a bms script is not a good solution because it doesn't grant the flexibility and the complexity needed for a repacker/rebuilder.

in short if the script is valid for reinjection (files <= originals, no crc/hash checks performed by the game and so on) then you have the perfect solution for replacing the modified files with no effort of the programmer who wrote the script and you.

if you want or need to write a repacker then you need the maximum effort which includes not only the programming work but also the reversing of the additional fields that you can ignore in extraction/reinjection work.

that's why the reinjection mode of quickbms is so incredibly cool for you (users) and moreover for me and other scripters who need to do zero work for the reinjection :)
I understand this. But I still need to repack the archive with bigger files. The thing is that in 2001 Russian pirates have published this game here and they have localized it and overwrote these archives with bigger files with no problem. And Russian pirates are not some guru, they are just ordinary scripters. I just want to transfer their localization to patch 1.2 of this game (Cabela's 4x4 Off-Road Adventure 1), but I can't do it because of this problem. If you can help me, then please do it. I'm sorry for the trouble, but I really need this.
User avatar
aluigi
VVIP member
VVIP member
Posts: 1916
Joined: Thu Dec 08, 2005 12:26 pm
Location: www.ZENHAX.com
Has thanked: 4 times
Been thanked: 654 times
Contact:

Re: Quick BMS

Post by aluigi »

I no longer create stand-alone repackers, so I can't help.
Post Reply