Important information: this site is currently scheduled to go offline indefinitely by end of the year.

Emergency 2012/2013 QuickBMS script needed

The Original Forum. Game archives, full of resources. How to open them? Get help here.
Post Reply
Oleg
beginner
Posts: 27
Joined: Mon Feb 14, 2011 1:31 pm
Been thanked: 6 times
Contact:

Emergency 2012/2013 QuickBMS script needed

Post 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.
You do not have the required permissions to view the files attached to this post.
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: 664 times
Contact:

Re: Emergency 2012/2013 QuickBMS script needed

Post 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
Oleg
beginner
Posts: 27
Joined: Mon Feb 14, 2011 1:31 pm
Been thanked: 6 times
Contact:

Re: Emergency 2012/2013 QuickBMS script needed

Post 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)
Ekey
M-M-M-Monster veteran
M-M-M-Monster veteran
Posts: 1823
Joined: Wed Mar 31, 2010 6:54 am
Has thanked: 92 times
Been thanked: 1058 times

Re: Emergency 2012/2013 QuickBMS script needed

Post 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"
Oleg
beginner
Posts: 27
Joined: Mon Feb 14, 2011 1:31 pm
Been thanked: 6 times
Contact:

Re: Emergency 2012/2013 QuickBMS script needed

Post 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.
Post Reply