XeNTaX Forum Index
Forum MultiEx Commander Tools Tools Home
It is currently Fri Dec 14, 2018 4:37 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 27 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: Scripting Help (from Troubleshooting forum)
PostPosted: Fri Jan 07, 2005 8:52 pm 
Offline
VIP member
VIP member

Joined: Tue Dec 14, 2004 11:28 am
Posts: 18
Has thanked: 0 time
Have thanks: 0 time
Well, as promised, here's the script I "Guest ;)" wrote for the You Don't Know Jack games (it reads all 'QFold' files only, the files on hard drives or the bigger archives are a different format, which I'll need help on)

I'll post it as a bms, so it can be loaded in MexScriptor and pulled apart or otherwise studied.

As a script, I think the politest term to use for it is 'functional' - in a bid to make things a little clearer i've used the odd DUMMYL to skip past longs rather than anything more elegant.

I assure you, this works 100% on every file of this format I've tried it on (The STR information isn't directly connected to the filenames).

Don't expect to be able to use the extracted files just yet, I think it's a standard Apple sound format (ima4 is present, suggesting something like .snd), but I can't find out the exact details needed to play it.


Attachments:


You do not have the required permissions to view the files attached to this post. Register to gain access.



Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 07, 2005 9:08 pm 
Offline
VIP member
VIP member

Joined: Tue Dec 14, 2004 11:28 am
Posts: 18
Has thanked: 0 time
Have thanks: 0 time
I wonder if someone can help with this:

Basically, I found another SRF format (the one I've coded for already seems to be bulletproof now, but that's the 'quick access' style as opposed to the 'big archive' one).

The files are so big I can't really do much about sending a sample, so bear with my explanation for a second (all mathematical longs are big endian, like the other example).

The first long is an ID, 'srf1' (I think this was supposed to be different to the other one, to show the difference in layout, but no example I've seen has an alternate ID string).
The second long is big endian, and is the overall size of the file, while the third is the total size of the 'header' portion (the data starts immediately after it), However, this is where the fun really starts.

The fourth long is a recognisable text string, such as Mb01. My experiments with the actual executable suggest that the 'M' just acts as a marker, and the real filename is the three other bytes (e.g. b01) So far, so simple, but the next long after one of these M??? strings is a file counter, which leads to a loop of filenumber, file offset, file size, with the last ID being equal to the file counter. We then move back to an M??? string, and the whole process repeats.

How can I get all of these files out (assuming that name duplication is permitted by MEX3, having the three byte code as markers would be fine)? I've noticed that the obvious nested loops approach (setting up one loop looking for M??? strings until we run out of header, while using another internal loop to log the file info until all files between M??? strings are accounted for) seems to confuse the parser and crash the engine.

Since I can't copy out of the MexScriptor directly, I include a JPG of the scripting window


Attachments:


You do not have the required permissions to view the files attached to this post. Register to gain access.



Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 07, 2005 11:12 pm 
Offline
Site Admin
User avatar

Joined: Wed Jan 15, 2003 6:45 pm
Posts: 4025
Location: Dungeons of Doom
Has thanked: 417 times
Have thanks: 566 times
First, thanks for the script, I'm sure going to try it and then add it to the next release! (crediting you of course). ;)

As to that other format, you can actually copy the text right out of Mex3Scriptor. Just select it all (ctrl+a) and copy it (ctrl+c). Voila.

In the script you make the engine search for an 'M' which is not really the way to go. There may be a lot of bytes in a file, and chances are you will stumble upon an M that is just part of something else and not anything related to your header.

I also noticed that you load up a long variable in FILENAME (a variable I would expect to be a string) and Reversing it even and then logging it with the Log command. Do you know I never even tried that? I just assumed my code would not be able to handle that, but it does I noticed from the script you attach above!! LOL! Excellent! :D
However, I'm pretty sure you can't use a "Math FILENAME += FILEID ;" construction, as the engine has no way to tell whether you wish to append a character to a string, it will just tell you a variable type mismatch occured.

As for the crash, that is bound to happen if you take account the above. Besides that, IF the script finds an M that is not part of the marker, it might be that your FILECNTL gets a number that is completely inappropriate.

Hope that helps. :)


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jan 08, 2005 8:37 pm 
Offline
VIP member
VIP member

Joined: Tue Dec 14, 2004 11:28 am
Posts: 18
Has thanked: 0 time
Have thanks: 0 time
Quote:
However, I'm pretty sure you can't use a "Math FILENAME += FILEID ;" construction, as the engine has no way to tell whether you wish to append a character to a string, it will just tell you a variable type mismatch occured.


I took this out of the script, so that no appending occurs - and the crash still happens.

Basically, what I've got to try to figure out is how I can get two concurrent routines, the one which locates and logs the main name, and the one which actually does the extraction (My information on the format shows that the 'M' character does not occur in anything other than these main filenames when in the header portion, where it apparently stands for Media).


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jan 08, 2005 10:51 pm 
Offline
Site Admin
User avatar

Joined: Wed Jan 15, 2003 6:45 pm
Posts: 4025
Location: Dungeons of Doom
Has thanked: 417 times
Have thanks: 566 times
Ahh.. I wish I could take a look at that file! :)

Perhaps it is possible to attach just a small portion of the file (enough to expose the format) ?


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jan 09, 2005 9:06 pm 
Offline
VIP member
VIP member

Joined: Tue Dec 14, 2004 11:28 am
Posts: 18
Has thanked: 0 time
Have thanks: 0 time
I'll have to try to get hold of some webspace, because I can't find a file small enough to fit here.

Bear with me, I'll have something ready by the end of this week.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jan 09, 2005 9:41 pm 
Offline
Site Admin
User avatar

Joined: Wed Jan 15, 2003 6:25 pm
Posts: 252
Location: Home
Has thanked: 2 times
Have thanks: 61 times
elcondor wrote:
I'll have to try to get hold of some webspace, because I can't find a file small enough to fit here.

Bear with me, I'll have something ready by the end of this week.

How big is this file? I can open up a public ftp for you if you want...


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 11, 2005 3:03 pm 
Offline
VIP member
VIP member

Joined: Tue Dec 14, 2004 11:28 am
Posts: 18
Has thanked: 0 time
Have thanks: 0 time
It's OK, I have a lot of filespace, just wanted to get off dialup first ;)

http://www.mametesters.org/elcondor/JACKSND1.SRF is one example, as is
http://www.mametesters.org/elcondor/SHORTVAR.SRF and

http://www.mametesters.org/elcondor/COMRCIAL.SRF

Shortvar is the smallest, but the others have more info.

PS. If anyone knows of a utility that can play MAC System 7 audio files or SFIL filetypes, but on a Windows platform, I'd like to know about it, because that's the audio format used.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 11, 2005 3:38 pm 
Offline
VIP member
VIP member

Joined: Tue Dec 14, 2004 11:28 am
Posts: 18
Has thanked: 0 time
Have thanks: 0 time
Repeat after me: SRF stands for Script/Resource File - the fork is included already.

If that's right, then the scripting is going to be easier than I thought for the original format, but the new format will still need looking at.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 11, 2005 3:41 pm 
Offline
Site Admin
User avatar

Joined: Wed Jan 15, 2003 6:45 pm
Posts: 4025
Location: Dungeons of Doom
Has thanked: 417 times
Have thanks: 566 times
Okay thanks, I will download them and take a good look at them!


Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 21, 2005 7:37 am 
Offline
VIP member
VIP member

Joined: Wed Dec 21, 2005 7:24 am
Posts: 4
Has thanked: 0 time
Have thanks: 1 time
Hi guys.

I'm sorry to pull up such an old topic, but i've been trying to deal with the SRF files in the UK version of "You don't know jack" pretty much solidly for the last 7 days now.

Unfortunately MultiEx couldn't deal with the SRF's properly, so I wrote a script in visual basic. I don't know the scripting language that MultiEx uses, so if anybody fancies having a shot at converting my vb code into a script for multiex, go ahead ;) - This script can handle any srf.

Anyway, my main issue is the format of the audio files.

They appear to be SFIL/SND (Macintosh System 7 sound archive) with IMA4 ADPCM compression.

The closest i've come so far to decoding the audio is to stick a RIFF/WAV header on it with an MS IMA ADPCM compression tag, but the sound is VERY distorted.

Do we have any Mac users who might be able to either a) try and play / convert an extracted SFIL or b) might know how to do so in windows?

Many Thanks

Tom.

Link to the SND sample: http://www.bolt7.com/Mb04.1.snd
Link to the same sample with a WAV header: http://www.bolt7.com/Mb04.1.wav


Attachments:


You do not have the required permissions to view the files attached to this post. Register to gain access.



Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 21, 2005 7:42 am 
Offline
Site Admin
User avatar

Joined: Wed Jan 15, 2003 6:45 pm
Posts: 4025
Location: Dungeons of Doom
Has thanked: 417 times
Have thanks: 566 times
Hi Tom. Thanks for the donation, once again.

I will go through your code. :)


Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 21, 2005 8:56 pm 
Offline
VIP member
VIP member

Joined: Tue Dec 14, 2004 11:28 am
Posts: 18
Has thanked: 0 time
Have thanks: 0 time
Can I just point out here that the problem you may be having with the YDKJUK SRF files (Not the sound stuff) may be due to me not submitting the revised script correctly?


There's a script on the XeNTaX wiki for You Don't Know Jack that is supposed to open any SRF file, including YDKJUK ones, but I didn't send it in time for the latest MultiEx release.

How would I go about submitting the new version?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 21, 2005 9:19 pm 
Offline
Site Admin
User avatar

Joined: Wed Jan 15, 2003 6:45 pm
Posts: 4025
Location: Dungeons of Doom
Has thanked: 417 times
Have thanks: 566 times
Well, you can actually just sign up at the WIKI and add your new script there, or add it to the page. If you think the script there is not correct, then please do update it with your better one! 8) The WIKI is open to everyone!


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 23, 2005 7:42 pm 
Offline
Site Admin
User avatar

Joined: Mon Sep 13, 2004 1:55 am
Posts: 706
Location: The wiki.
Has thanked: 107 times
Have thanks: 125 times
...Except spambots. :wink:

_________________
Welcome to Xentax!

Rules | Requests | Wiki

If you run across a post that breaks the rules, please PM Craptain, Mr.Mouse, or myself - we will handle it from there.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 27 posts ]  Go to page 1, 2  Next

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group