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

Files extractors scripting

The Original Forum. Game archives, full of resources. How to open them? Get help here.
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: Files extractors scripting

Post by aluigi »

the version is displayed when you launche the tool just after its name, for example:
"QuickBMS generic files extractor 0.1.2"

for the question about the index and data file the BMS language allows to use the "Open" command. basicly the first file that you must open is "ever" the data one (because the log and clog commands don't have a "filenumber" specifier) and then using "Open" to open the index file using the filenumber 1 and specifying it all the times you need to load data from it.

for the other 2 games now I take a look to them and I will let you know if they can be handled through the BMS language.
User avatar
Dinoguy1000
Site Admin
Posts: 786
Joined: Mon Sep 13, 2004 1:55 am
Has thanked: 154 times
Been thanked: 163 times

Re: Files extractors scripting

Post by Dinoguy1000 »

I'd be cautious about adding new features to MexScript, there's another forum member working on a new version of it.
Welcome to Xentax!

Rules | Requests | Wiki | Discord

If you run across a post that breaks the rules, please report the post - a mod or admin will handle it from there.
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: Files extractors scripting

Post by aluigi »

the "so blonde" archive has been very useful because has allowed me to test the Open function and correcting some other bugs, the scripts for both the games are attached.
You do not have the required permissions to view the files attached to this post.
stevenx
veteran
Posts: 130
Joined: Sat Nov 01, 2008 12:02 pm
Has thanked: 3 times
Been thanked: 1 time

Re: Files extractors scripting

Post by stevenx »

How about the archive be compressed twice?
I means the archive has been compressed and the sub file is compressed too.
For example ,after extracing still life 2 Sl2fnt.dat ,i get a ARIAL 64.RU.
This file with string id XCPK ,so i think this file be compressed too.

Can you take a look it ?
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: Files extractors scripting

Post by aluigi »

@Dinoguy1000:
uhmmm I have taken a quick look at that thread but it's stopped from years and then there are some things which are not so useful:
- 64 bit fields: handling a script already takes lot of cycles if compared to a native extraction program and handling 64 bit numbers on native 32 bit operating systems (the majority) takes a lot of more cycles and then the file formats which use 64 bit numbers are very very rare
- endianess on the number: uhmm doesn't look useful, the games use the same endianess for all the fields of the file so it's useless to specify each time the type of endianes to use
- 1000 fields: too chaotic
- complex Set+Math command: could be good in some occasions, thumb half up :)

@stevenx:
I don't have idea of the format used by those 2 files
chrrox
Moderator
Posts: 2602
Joined: Sun May 18, 2008 3:01 pm
Has thanked: 57 times
Been thanked: 1422 times

Re: Files extractors scripting

Post by chrrox »

stevenx wrote:How about the archive be compressed twice?
I means the archive has been compressed and the sub file is compressed too.
For example ,after extracing still life 2 Sl2fnt.dat ,i get a ARIAL 64.RU.
This file with string id XCPK ,so i think this file be compressed too.

Can you take a look it ?
I did not try this but this may open your files.
http://gbatemp.net/index.php?showtopic=109433
stevenx
veteran
Posts: 130
Joined: Sat Nov 01, 2008 12:02 pm
Has thanked: 3 times
Been thanked: 1 time

Re: Files extractors scripting

Post by stevenx »

Another test.

Posted to wrong thread.
viewtopic.php?f=10&t=1476&p=28887#p28887
Mr.Mouse
Site Admin
Posts: 4073
Joined: Wed Jan 15, 2003 6:45 pm
Location: Dungeons of Doom
Has thanked: 450 times
Been thanked: 682 times
Contact:

Re: Files extractors scripting

Post by Mr.Mouse »

I personally think it's a great idea to 'fork' away from my original BMS script. I know that some people have implemented BMS as a way to increase the number of supported games (e.g. Watto has build in a nice BMS editor in his Java-built Game Extractor and there are also some linux implementations). Indeed, we as Xentax have at some point created OpenMex (Craptain did) in Python that also used the BMS language. At this time, Rahly is working on a new version of the language and when he finishes it, this will effectively replace my own BMS interpreter (multiex.dll) in MexCom. Nevertheless, I applaud you building on it, as there are many features to add (the original BMS is rather limited). :)

Your QuickBMS tool looks a lot like my own 16-bit multiex.exe (Dos) that was the first implementation of BMS ever. ;) 1997. LOL. :)

By the way, ZLib IS supported. You can specify ComType ZLib1 in BMS. Then you must use the CLog instead of the Log command in MexScript to tell a little bit more about uncompressed size and compressed size and so on.

Code: Select all

    *  ComType 

   Specify the compression type
   ZLib1 : Standard Zlib compression
   ComType <ComType>

    * CLog 

   when you have specified a compression type you MUST use
   this log event instead of 'Log'
   CLog <var name> <var offset> <var size> <var/num 
   offoff> <var/num sizeoff> 
   <var/num OrSize> <var/num OrSizeOff>
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: Files extractors scripting

Post by aluigi »

uhmmm my idea was not that of creating a fork (like a new derived language) but only an enhancement of the original BMS language otherwise there is the risk of having 1000 different and incompatible languages.
indeed the current BMS language is not bad because it can be used for all those file formats (the majority as visible in these threads) which are enough basic to avoid to write boring stand-alone extractors, so imho it's already good.

so the enhancements about I talk are mainly those in the BMS syntax for making it simpler to read like:
- avoiding the final semicolon
- optional filenumber (in the 90% of the cases it's ever 0)
- micro enhancements of some commands, for example a negative "pos" in "GoTo" could be used to specify a SEEK_END offset or making more clear the "substract" operation in the "String" command

for the rest I see only the need to implement some new commands for the usual operations which we have seen in the recent times for handling the so called "obfuscations" implemented by the games (like xor) and some new compressions (the first one is the standard deflate, which is zlib initialized with windowbits set to -15).

do you know where are visible (other than in the old thread linked by dinoguy) the improvements that rahly wants to add or is adding?
User avatar
Dinoguy1000
Site Admin
Posts: 786
Joined: Mon Sep 13, 2004 1:55 am
Has thanked: 154 times
Been thanked: 163 times

Re: Files extractors scripting

Post by Dinoguy1000 »

On the topic of semicolons, Mr.Mouse actually added the requirement for them at one point IIRC. He had originally planned the MexScript language to have support for multiple commands per line, but never did anything with it, so in one of the recent versions, he cleaned up the formatting related to it. IMHO, it actually feels far cleaner with terminating semicolons than without. ;)
Welcome to Xentax!

Rules | Requests | Wiki | Discord

If you run across a post that breaks the rules, please report the post - a mod or admin will handle it from there.
chrrox
Moderator
Posts: 2602
Joined: Sun May 18, 2008 3:01 pm
Has thanked: 57 times
Been thanked: 1422 times

Re: Files extractors scripting

Post by chrrox »

Can anyone show me how to write a script for this file. I have figured out the format I am just not good with the script. I would like to add scripts here if someone can show me this example. Thanks in advance.
I had to xor this file to get it in readable form how would I specify a fixed size to xor only that part?
The format details are in the lazeska thread.
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: Files extractors scripting

Post by aluigi »

I have attached a script example.
note that handling that type of folder is not that easy so I have tried to use at least the last directory name found in the archive
I have also released a new beta of QuickBMS
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: Files extractors scripting

Post by aluigi »

just for fun I have attached the script for listing and extracting the files from the ZIP archives, maybe it's a good example to learn how to use the scripts
You do not have the required permissions to view the files attached to this post.
chrrox
Moderator
Posts: 2602
Joined: Sun May 18, 2008 3:01 pm
Has thanked: 57 times
Been thanked: 1422 times

Re: Files extractors scripting

Post by chrrox »

Thanks :) the folder creation worked great and it seems to of extracted everything.
chrrox
Moderator
Posts: 2602
Joined: Sun May 18, 2008 3:01 pm
Has thanked: 57 times
Been thanked: 1422 times

Re: Files extractors scripting

Post by chrrox »

Is there a way to specify how long the xor operation will last in an archive. I manually xored the file table I posted then pasted it back into the original file and commented out the xor operation and your script worked perfectly. can I make the xor operation only apply to the file table, or when it reads a certain string it stops, or at a certain offset the xor stops? Thanks in advance for all your great work :) any of these 3 methods would work for lazeska archive to stop the xor command.
Post Reply