ZenHAX

Free Game Research Forum | Official QuickBMS support | twitter @zenhax | SSL HTTPS://zenhax.com
It is currently Thu Dec 05, 2019 3:22 pm

All times are UTC




Post new topic  Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Wed Jun 24, 2015 4:58 pm 

Joined: Mon Sep 22, 2014 5:13 pm
Posts: 72
So long story short I know how to extract these files manually, but it's a huge burden to do so. I tried building an 010 Editor script as seen below, but I think a few things were off. Hopefully that helps with making short work of a QuickBMS script. File extensions can be either .ZSM or .ZSS. These will extract to standard XMA, which I can then use ToWav on. Thanks much! (see attached)

010 script
Code:
//--------------------------------------
//--- 010 Editor v2.1.3 Script File
//
// File:
// Author: Teancum
// ZSS ripper
// 1) start with RIFF (4 bytes), record location of 'R'
// 2) next four bytes, file size (chunk_size)
// 3) add 8 bytes to chunk_size to cover header
// 4) return to this 'R' location
// 5) select from 'R' to chunk_size
// 6) export

// AUTO-FIND
// 1) Find first '.xma'
// 2) Go backward, find first 4-byte 00 set (filenames may be short or long, so we need to find the first set to ensure we're past the beginning of the name)
// 3) Go back 16 bytes
// 4) Record next 4 bytes as offset
// 5) Record next 4 bytes after that as size
// 6) Go forward 12 bytes
// 7) Record next 20 bytes as file name


//--------------------------------------

char filename[];
const char file_ext[]=".xma
uint chunk_offset;
const char find_xma[4]={'.','x','m','a'} //find XMA file name
const char chunk_type[4]={'R','I','F','F'}; // "RIFF"
char chunk_name[];
uint chunk_begin;
int i;
int filenum;

filename=InputOpenFileName(
    "Open ZSM/ZSS ile",
    "All files (*.zsm/zss)|*.zss",
    "*.zsm" );
FileOpen(filename);
filenum = GetFileNum();

TFindResults find_chunk=FindAll(
//Find all XMA files
    find_xma,
    true,
    true,
    false,
    0.0,
    1,
    0,
    0 );

for(i = 0; i < find_chunk.count; i++ )
//Start at first RIFF chunk, iterate through until done
  {
    chunk_begin=find_chunk.start[i]; //.xma
    chunk_offset=ReadInt(chunk_begin+4); //4 over from RIFF, read int
    //chunk_name=ReadString(chunk_begin+16);
    //Printf("%s\n", chunk_name+file_ext);

    SetSelection( chunk_begin, chunk_offset+8); //Start at RIFF, end at chunk_offset+8 (to account for header)
    CopyToClipboard(); //copy data
    FileNew(); //Start a new file
    PasteFromClipboard(); //paste into file
    FileSave(chunk_name+file_ext); //Save here (can I get the actual names, or prompt to save?)
    FileClose();
    FileSelect( filenum );
  };



Attachments:
venom_v.zip [3.27 MiB]
Downloaded 89 times
Top
   
PostPosted: Wed Jun 24, 2015 9:34 pm 
Site Admin
User avatar

Joined: Wed Jul 30, 2014 9:32 pm
Posts: 10822
http://aluigi.org/papers/bms/others/zsndxeno.bms


Top
   
PostPosted: Wed Jun 24, 2015 10:42 pm 

Joined: Mon Sep 22, 2014 5:13 pm
Posts: 72
Thanks! That was fast!


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 3 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