ZenHAX

Free Game Research Forum | Official QuickBMS support | twitter @zenhax | SSL HTTPS://zenhax.com
It is currently Wed May 22, 2019 8:48 am

All times are UTC




Post new topic  Reply to topic  [ 4 posts ] 
Author Message
PostPosted: Thu Apr 04, 2019 6:58 pm 

Joined: Thu Jul 02, 2015 10:43 pm
Posts: 71
Hi all, im having no clue how to write an script for these files. From the thread https://zenhax.com/viewtopic.php?f=6&t=1116&start=220 Excuse my sorry ass, but im just new at this

This is the format

0x00 - Id, long

now we skip some bytes since theyre useless for this (do this on EVERY file)

0x58 - data block 1 size/offset, gin/snr section begins after this
0x5c - data block 1 + gin/snr section size (audio data begins after this)

skip all the bytes till the offset given in 0x58, Gin and SNR section begins, each sample present in the file has an string of 36 bytes in ths section. It's easy to guess the number of audio files by just doing 0x5c - 0x58 and dividing by 36.

anyways, to the small section here.

0x00 - file format
0x04 - file enumeration (first file is always 00)
0x08 - audio data offset. To get the actual offset in the file, you must add the value you got frmo 0x5c at the beginning to this one

skip 8 bytes

0x14 - random byte is always 01

skip 4 bytes

0x1c - RPM of sample, used for SNR files since they're supposed to be recorded at a static rpm, gin files use a value of 1000

skip 4 bytes

0x24 next audio file string...

Getting to know the size of each audio file is easy substracting the offsets, the only "problem" is getting the size of the last file, it beings in the given offset and goes to the end of the file

When these audio description strings end, the audio data begins.

----------

On another topic from the same thread, is there any way to make quickbms parse data into a text file? On .gin files, there are 2 arrays, which size is specified in the header, every int32 has a value (numerical) and this relates to sound data, what Im needing is just to get all the values together so I can make a graph out of it and see this in depth.

If anyone can give me hand it would be great.


Top
   
PostPosted: Thu Apr 04, 2019 9:21 pm 
Site Admin
User avatar

Joined: Wed Jul 30, 2014 9:32 pm
Posts: 10256
I answer to the section question.
You can redirect the output of quickbms in a txt or csv file and then doing what you want with it.

For example I guess that a script like the following should generate a good csv file to open with Excel:
Code:
get FILES long
for i = 0 < FILES
    get OFFSET long
    print "%OFFSET%,"
next i

Then: quickbms.exe script.bms file.dat > output.csv

It's just an example but the concept is correct.


Top
   
PostPosted: Thu Apr 04, 2019 11:44 pm 

Joined: Thu Jul 02, 2015 10:43 pm
Posts: 71
aluigi wrote:
I answer to the section question.
You can redirect the output of quickbms in a txt or csv file and then doing what you want with it.

For example I guess that a script like the following should generate a good csv file to open with Excel:
Code:
get FILES long
for i = 0 < FILES
    get OFFSET long
    print "%OFFSET%,"
next i

Then: quickbms.exe script.bms file.dat > output.csv

It's just an example but the concept is correct.


It prints the values correctly on the cmd window, but there's no file (The option for "Save as type" is empty) Missing command maybe?


Top
   
PostPosted: Fri Apr 05, 2019 8:02 am 
Site Admin
User avatar

Joined: Wed Jul 30, 2014 9:32 pm
Posts: 10256
Ah sorry, I meant that you have to execute that command from the console's command-line.
> is the standard output redirector of the Windows console.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 4 posts ] 

All times are UTC


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:
Powered by phpBB® Forum Software © phpBB Limited