Page 1 of 1

Emergency 2012/2013 QuickBMS script needed

Posted: Fri Jan 04, 2013 1:21 pm
by Oleg
Hello.

Can someone write a very simply BMS script for Emergency 2012/2013 files? All files are LZ compressed and ZLib's deflate unpacks them fine, but I would like to have a batch script to unpack and repack files.

each file has a header of 20 bytes:
DWORD 0x1337C0D3 //magic#1
DWORD 0x00000001
DWORD deflateSize
DWORD 0x00000000
DWORD 0xECC83F2C //magic#2

and followed by LZ-packed data until the end of file.

I would like the script to check magic#1 and magic#2 on all files and unpack (with replace of original) all packed files recursively (including subfolders).

An example files are attached.

Thank you.

Re: Emergency 2012/2013 QuickBMS script needed

Posted: Mon Jan 28, 2013 3:01 pm
by aluigi

Code: Select all

idstring "\xd3\xc0\x37\x13"
get VER long
get SIZE long
get DUMMY long
get DUMMY long
savepos OFFSET
get ZSIZE asize
math ZSIZE -= OFFSET

get TMP basename
get EXT extension
string NAME p= "%s_unpack.%s" TMP EXT
clog NAME OFFSET ZSIZE SIZE

Re: Emergency 2012/2013 QuickBMS script needed

Posted: Mon Jan 28, 2013 3:44 pm
by Oleg
Thanks.

Is it possible to force it run recursive on subfolders and make inplace/replacement unpack?

I've altered the script with

Code: Select all

string NAME p= "%s.%s" TMP EXT
to unpack over existen files and ran it with command line:

Code: Select all

quickbms.exe -w -o em.bms . .
It does go deep into subfolders, but it unpacks all files into current folder. May be I'm missing some option argument?

(using QuickBMS 0.4.8a)

Re: Emergency 2012/2013 QuickBMS script needed

Posted: Mon Jan 28, 2013 3:50 pm
by Ekey
Emergency 2012 file decompressor

http://www.nullsecurity.org/gametools
Oleg wrote:It does go deep into subfolders, but it unpacks all files into current folder. May be I'm missing some option argument?

(using QuickBMS 0.4.8a)

Code: Select all

quickbms.exe -9 "C:\em.bms" "C:\Games\E2012\Superarchive.ggg" "C:\Extracted"

Re: Emergency 2012/2013 QuickBMS script needed

Posted: Mon Jan 28, 2013 4:07 pm
by Oleg
strange, it wasn't linked statically against zlib, it took some time to find zlib1.dll...

I get

Code: Select all

decompressing...
woops, something went wrong. (FFIND:3)
Done!
whichever command I try. even copied some files into c:\temp just to check if it works or not.