Help us keep the site up! Got some change to spare? Why not donate a few bits and buy us a coffee. Image

ALL CURRENT MEXCOM SCRIPTS!

Get all the latest plugins for MultiEx Commander here, such as MexCom and Rahly's Plugin Manager plugins.
User avatar
aluigi
VVIP member
VVIP member
Posts: 1917
Joined: Thu Dec 08, 2005 12:26 pm
Location: www.ZENHAX.com
Has thanked: 4 times
Been thanked: 653 times
Contact:

Re: ALL CURRENT MEXCOM SCRIPTS!

Post by aluigi »

I have a doubt about FindLoc.
what happens if the string is not found?
should the script terminate or what value is assigned to the variable in this case?
Mr.Mouse
Site Admin
Posts: 4057
Joined: Wed Jan 15, 2003 6:45 pm
Location: Dungeons of Doom
Has thanked: 432 times
Been thanked: 633 times
Contact:

Re: ALL CURRENT MEXCOM SCRIPTS!

Post by Mr.Mouse »

It terminates.
snakemeat
advanced
Posts: 45
Joined: Tue Jan 27, 2009 5:00 pm
Has thanked: 12 times
Been thanked: 22 times

Re: ALL CURRENT MEXCOM SCRIPTS!

Post by snakemeat »

I hope this is the right place for this. I wanted to learn about QuickBMS scripts and converted an old extractor to QuickBMS. I left the "print" statements in (commented out for now) for easier debugging if desired. I noticed other posts include installation instructions. Unfortunately, I don't have MulitEx Commander (yet).

Game: Robot Alchemic Drive [PS2][SLUS-20445]
File Extension: Various
Magic Bytes: "VFS\0"

Here's the code:

Code: Select all

# Robot Alchemic Drive [PS2][SLUS-20445]
# script for QuickBMS http://aluigi.org/papers.htm#quickbms
#
# Tested against REMOTE.DAN, CONTROL.DY files 
#
# Some filenames contain kanji chars, please adjust your OS as needed to
#  support such chars.  REMOTE.DAN contains duplicate names.

idstring "VFS\x00"
get NUMFOLDERS long
get DUMMY long
get HEADERSIZE long

#print "Number of folders: %NUMFOLDERS%\n"

for i = 0 < NUMFOLDERS
  
  # save position at start of this folders info line
  savepos FOLDER_INFO_LINE_BEGIN
  
  # get folder information
  get RELATIVE_OFFSET_FOLDERNAME long
  get FILES_IN_THIS_FOLDER long
  get FOLDER_HEADER_OFFSET long
  get FOLDER_HEADER_LENGTH long
  
  # goto the location of the folder name
  math RELATIVE_OFFSET_FOLDERNAME += FOLDER_INFO_LINE_BEGIN
  goto RELATIVE_OFFSET_FOLDERNAME
  # print "Folder %i% offset: %RELATIVE_OFFSET_FOLDERNAME%\n"
    
  # get the folder name
  get FOLDERNAME string
  # print "Folder %i% name: %FOLDERNAME%\n"
  
  # print number of files
  #print "Folder %i% has %FILES_IN_THIS_FOLDER% files\n"
  
  # goto the location of the file headers for this folder
  goto FOLDER_HEADER_OFFSET
  
  for j = 0 < FILES_IN_THIS_FOLDER
  
    savepos FILE_INFO_LINE_BEGIN
  
    get FILESIZE long
    get FILEOFFSET long
    get RELATIVE_OFFSET_FILENAME long
  
    # goto the location of the file name
    math RELATIVE_OFFSET_FILENAME += FILE_INFO_LINE_BEGIN
    goto RELATIVE_OFFSET_FILENAME      
    # print "Filename %j% offset: %RELATIVE_OFFSET_FILENAME%\n"

    # get the file name
    get FILENAME string
    # print "Filename %j%: %FILENAME%\n"  
  
    # build the output path
    set FULLNAME string FOLDERNAME
    string FULLNAME += FILENAME 
    # print "Fullname %j%: %FULLNAME%\n"  
  
    # extract the file
    log FULLNAME FILEOFFSET FILESIZE
    # print "Fullname %j%: has been extracted\n"  
  
    # return to the next line in the file information area
    math FILE_INFO_LINE_BEGIN += 0x10
    goto FILE_INFO_LINE_BEGIN
  
  next j
  
  # return to the next line in the folder information area
  math FOLDER_INFO_LINE_BEGIN += 0x10
  goto FOLDER_INFO_LINE_BEGIN
  
next i
User avatar
aluigi
VVIP member
VVIP member
Posts: 1917
Joined: Thu Dec 08, 2005 12:26 pm
Location: www.ZENHAX.com
Has thanked: 4 times
Been thanked: 653 times
Contact:

Re: ALL CURRENT MEXCOM SCRIPTS!

Post by aluigi »

very good.
do you have also one of these (small) archives for a quick verification/curiosity?
have you also verified the files extracted with the old extractors with those extracted with the new script?

I have a tool that I use for this job called dircomp so when I need to make this type of verification I extract the files with the first extractor and then with the other one in two different folders and then I compare their content with:

Code: Select all

dircomp c:\old c:\new
hope it helps :)
snakemeat
advanced
Posts: 45
Joined: Tue Jan 27, 2009 5:00 pm
Has thanked: 12 times
Been thanked: 22 times

Re: ALL CURRENT MEXCOM SCRIPTS!

Post by snakemeat »

aluigi wrote:very good.
do you have also one of these (small) archives for a quick verification/curiosity?
have you also verified the files extracted with the old extractors with those extracted with the new script?

I have a tool that I use for this job called...
Sorry, but the files are too large to share. The test samples I worked with were ~150mb and ~210mb. I'll take another look when I return home for a smaller file. Hopefully I can find a smaller one, since it's always helpful to have a second opinion on these things.

I compared a few random files using size and CRC32, but I'll also try your tool.

Thanks for the input, and, of course, QuickBMS.
User avatar
aluigi
VVIP member
VVIP member
Posts: 1917
Joined: Thu Dec 08, 2005 12:26 pm
Location: www.ZENHAX.com
Has thanked: 4 times
Been thanked: 653 times
Contact:

Re: ALL CURRENT MEXCOM SCRIPTS!

Post by aluigi »

a note about the scripts in complete_scripts.txt regarding the Battlefield series.
they can't work because many of the files in these RFA archives are compressed with chunks of LZO1x.
I have released a quickbms script for them.
Mr.Mouse
Site Admin
Posts: 4057
Joined: Wed Jan 15, 2003 6:45 pm
Location: Dungeons of Doom
Has thanked: 432 times
Been thanked: 633 times
Contact:

Re: ALL CURRENT MEXCOM SCRIPTS!

Post by Mr.Mouse »

A bit of a dead topic, but here is a new one to be used in MultiEx Commander:

Code: Select all

#Total Annihilation: Kingdoms *.HPI files
#Extraction mexscript by Mr.Mouse 
Get D1 Long 0 ;
Get D2 Long 0 ;
Get FIOff Long 0 ;
Get FISize Long 0 ;
Get NIOff Long 0 ;
Get NISize Long 0 ;
Get DataOff Long 0 ;
Get DataSize Long 0 ;
Math FIOff += 32 ;
Set ST Long FIOff ;
Math ST += FISize ;
Set CP Long FIOff ;
GoTo FIOff 0 ;
Get D3 Long 0 ;
Get FNum Long 0 ;
SavePos SP 0 ;
For T = 1 To FNum ;
GoTo SP 0 ;
Get FNPOS Long 0 ;
Get OffSet Long 0 ;
Get Size Long 0 ;
Get D4 Long 0 ;
Get D5 Long 0 ;
Get D6 Long 0 ;
SavePos SP 0 ;
Set FNO Long NIOff ;
Math FNO += FNPOS ;
GoTo FNO 0 ;
Get FNAME String 0 ;
Log FNAME OffSet Size 0 0 ;
Next T ;
Post Reply