ZenHAX

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

All times are UTC




Post new topic  Reply to topic  [ 51 posts ]  Go to page Previous 1 2 3
Author Message
PostPosted: Mon Apr 08, 2019 7:05 pm 

Joined: Mon Apr 01, 2019 10:49 am
Posts: 70
Indeed it's really strange this Sega Mega CD version :mrgreen:

I have send to you everything i have, the ISO itself.

Here in another format :

https://we.tl/t-QM8IDVCsar


Top
   
PostPosted: Mon Apr 08, 2019 7:10 pm 

Joined: Mon Apr 01, 2019 10:49 am
Posts: 70
I got zero file extracted with the script.

I do something wrong ? :(

Code:
- GUI mode activated, remember that the tool works also from command-line
  where are available various options like folder scanning, filters and so on

- select BMS script. type ? for using the content of clipboard like a script
- select input archives/files, type * for the whole folder and subfolders
- select output folder where extracting files
- open input file D:\Jeux\QuickBMS\00000000000000a0.meg
- open script D:\Jeux\QuickBMS\DUNEMEG.bms
- set output folder D:\Jeux\QuickBMS\test

  offset           filesize   filename
--------------------------------------

- 0 files found in 0 seconds
  coverage file 0   100%   169595     169448     . offset 0000000000000000
  coverage file -10   0%   0          467        . offset 0000000000000000

Press ENTER or close the window to quit


BMS SCRIPT :

Code:
set MEMORY_FILE10 string "
int convert(unsigned char *data, int size, unsigned char *wav) {
    int read, write, i = 0, x = 0;
    while(i < size) {
        read = data[i++];
        {
            if(read < 0x80)
                write = 0x80 - read;
            else
                write = read;

            if(write == 0xFF)       
            {
                i += 12;
            }
            else
                    wav[x++] = write;
        }
    }
    return x;
}
"

for i = 0
    savepos OFFSET
    findloc EOF binary "PPPPPPPP"
    if OFFSET == EOF
        break
    endif
    math SIZE = EOF
    math SIZE - OFFSET

    string NAME p "%d.wav" i
    #log NAME OFFSET SIZE
    callfunction DUMP

    math EOF x 0x800
    goto EOF
next i

startfunction DUMP
    log MEMORY_FILE2 0 0
    putvarchr MEMORY_FILE2 SIZE 0

    log MEMORY_FILE OFFSET SIZE
    calldll MEMORY_FILE10 "convert" "tcc" SIZE MEMORY_FILE SIZE MEMORY_FILE2

    math CODEC = 1
    math BITS = 8
    math CHANNELS = 1
    math FREQUENCY = 22222

    math BLKALIGN = BITS
    math BLKALIGN / 8
    math BLKALIGN * CHANNELS
    math AVGBYTES = FREQUENCY
    math AVGBYTES * BLKALIGN

    log MEMORY_FILE 0 0
    putdstring "RIFF" 4 MEMORY_FILE
    put 0 long          MEMORY_FILE
    putdstring "WAVE" 4 MEMORY_FILE

    # "fmt "
    putdstring "fmt " 4 MEMORY_FILE
    put 0 long          MEMORY_FILE
    put CODEC short     MEMORY_FILE # wFormatTag: Microsoft PCM Format (0x0001)
    put CHANNELS short  MEMORY_FILE # wChannels
    put FREQUENCY long  MEMORY_FILE # dwSamplesPerSec
    put AVGBYTES long   MEMORY_FILE # dwAvgBytesPerSec
    put BLKALIGN short  MEMORY_FILE # wBlockAlign
    put BITS short      MEMORY_FILE # wBitsPerSample
    get MEM_SIZE asize MEMORY_FILE
    math RIFFTMP = MEM_SIZE
    math RIFFTMP - 0x14
    putvarchr MEMORY_FILE 0x10 RIFFTMP long

    # "data"
    putdstring "data" 4 MEMORY_FILE
    put SIZE long       MEMORY_FILE

    get MEM_SIZE asize MEMORY_FILE
    math RIFFTMP = SIZE
    math RIFFTMP + MEM_SIZE
    math RIFFTMP - 8
    putvarchr MEMORY_FILE 4 RIFFTMP long

    log NAME 0 MEM_SIZE MEMORY_FILE
    append
    log NAME 0 SIZE MEMORY_FILE2
    append
endfunction


If i try directly on the DUNE.DAT i got this :

Code:
 the script needs to load a pre-compiled function from the dll or code
  MEMORY_FILE10
  do you want to continue with this and any other requested dll/code (y/N)?


Last edited by Tgames on Mon Apr 08, 2019 7:14 pm, edited 1 time in total.

Top
   
PostPosted: Mon Apr 08, 2019 7:13 pm 
Site Admin
User avatar

Joined: Wed Jul 30, 2014 9:32 pm
Posts: 10256
Input file must be DUNE.DAT


Top
   
PostPosted: Mon Apr 08, 2019 7:15 pm 

Joined: Mon Apr 01, 2019 10:49 am
Posts: 70
Ah good it's better indeed to work directly on DUNE.DAT but i got this when trying with DUNE.DAT :

Code:
- select BMS script. type ? for using the content of clipboard like a script
- select input archives/files, type * for the whole folder and subfolders
- select output folder where extracting files
- open input file D:\Jeux\QuickBMS\DUNE.DAT
- open script D:\Jeux\QuickBMS\DUNEMEG.bms
- set output folder D:\Jeux\QuickBMS\test

  offset           filesize   filename
--------------------------------------

- the script needs to load a pre-compiled function from the dll or code
  MEMORY_FILE10
  do you want to continue with this and any other requested dll/code (y/N)?
  y
- library MEMORY_FILE10 loaded at address 011F6910
- function found at offset 011F0700
  0000000000000000 44         0.wav

- The following output file already exists:
  0.wav
  Do you want to overwrite it?
    y = overwrite (you can use also the 'o' key)
    n = skip (default, just press ENTER)
    a = overwrite all the files without asking
    r = automatically rename the files with the same name
    s = skip all the existent files without asking

a
+ 0000000000000000 54630540896220017 0.wav

-------------------
*EXCEPTION HANDLER*
-------------------
An error or crash occurred:

*EH* ExceptionCode      c0000005 access violation
*EH* ExceptionFlags     00000000
*EH* ExceptionAddress   76D6BE07
                        76CE0000 + 0008be07 msvcrt.dll
*EH* NumberParameters   00000002
*EH*                    00000001
*EH*                    06FDE000

Last script line before the error or that produced the error:
  90  log NAME 0 SIZE MEMORY_FILE2

Press ENTER or close the window to quit


I got a "ExceptionHandler".


Top
   
PostPosted: Mon Apr 08, 2019 7:29 pm 
Site Admin
User avatar

Joined: Wed Jul 30, 2014 9:32 pm
Posts: 10256
Use ever quickbms.exe.
quickbms_4gb_files.exe must be used only in specific situations.

Anyway I will check what's wrong although I'm 100% sure it's related to the C compiler which is 32bit.


Top
   
PostPosted: Mon Apr 08, 2019 7:33 pm 

Joined: Mon Apr 01, 2019 10:49 am
Posts: 70
Woahh you are incredible aLuigi !

It's work perfectly !!!!!

A huuuuge thanks for your hard work !!

I have every voices already perfect !


Top
   
PostPosted: Mon Apr 08, 2019 7:38 pm 
Site Admin
User avatar

Joined: Wed Jul 30, 2014 9:32 pm
Posts: 10256
They can be even more perfect if we select only the "Megative Voice" files and cut out that header from the output.


Top
   
PostPosted: Mon Apr 08, 2019 7:41 pm 

Joined: Mon Apr 01, 2019 10:49 am
Posts: 70
Yes good voices start at 63.wav.

But it's really a huge improvement !


Top
   
PostPosted: Mon Apr 08, 2019 8:05 pm 

Joined: Mon Apr 01, 2019 10:49 am
Posts: 70
Acewell wrote:
this will replace that spider man script and will extract all files as opposed
to just uncompressed wav and bik files, at least from my tests. :)
Code:
idstring "PKR3"
get INFO_OFF long
goto INFO_OFF
get UKN long
get NUM_FOLDERS long
get TOTAL_FILES long
savepos FOLDERSTART
math TMP = NUM_FOLDERS
math TMP * 40
math TMP + FOLDERSTART
for i = 0 < NUM_FOLDERS
    goto FOLDERSTART
    getdstring FOLDERNAME 0x20
    get TPF long
    get FILES long
    savepos FOLDERSTART
    goto TMP
    for j = 0 < FILES
        getdstring FNAME 0x20
        get UKN2 long
        get FLAG long
        get OFFSET long
        get SIZE long
        get ZSIZE long
        string NAME p "%s%s" FOLDERNAME FNAME
        if FLAG < 2
            log NAME OFFSET ZSIZE
        else
            clog NAME OFFSET ZSIZE SIZE
        endif
    next j
    savepos TMP
next i


Works perfectly fine with normal QuickBMS !
A huge thanks to you too, Acewell !

@Acewell, do you have a full script also for the PS1 version of Spider Man ?
To extract each voices from COMPILED.XA and files from CD.WAD ?
For @Acewell : https://we.tl/t-iLerGIgo37


Top
   
PostPosted: Mon Apr 08, 2019 9:43 pm 
Site Admin
User avatar

Joined: Wed Jul 30, 2014 9:32 pm
Posts: 10256
Code:
set MEMORY_FILE10 string "
int convert(unsigned char *data, int size, unsigned char *wav) {
    int read, write, i = 0, x = 0;
    while(i < size) {
        read = data[i++];
        {
            if(read < 0x80)
                write = 0x80 - read;
            else
                write = read;

            if(write == 0xFF)       
            {
                i += 12;
            }
            else
                    wav[x++] = write;
        }
    }
    return x;
}
"

for i = 0
    savepos OFFSET
    findloc EOF binary "PPPPPPPP"
    if OFFSET == EOF
        break
    endif
    math SIZE = EOF
    math SIZE - OFFSET

    getdstring MAGIC 8
    if MAGIC u== "Megative"
        math OFFSET + 0x800
        math SIZE   - 0x800
        string NAME p "%d.wav" i
        callfunction DUMP
    else
        string NAME p "DAT/%d.dat" i
        log NAME OFFSET SIZE
    endif

    math EOF x 0x800
    goto EOF
next i

startfunction DUMP
    log MEMORY_FILE2 0 0
    putvarchr MEMORY_FILE2 SIZE 0

    log MEMORY_FILE OFFSET SIZE
    calldll MEMORY_FILE10 "convert" "tcc" SIZE MEMORY_FILE SIZE MEMORY_FILE2

    math CODEC = 1
    math BITS = 8
    math CHANNELS = 1
    math FREQUENCY = 22222

    math BLKALIGN = BITS
    math BLKALIGN / 8
    math BLKALIGN * CHANNELS
    math AVGBYTES = FREQUENCY
    math AVGBYTES * BLKALIGN

    log MEMORY_FILE 0 0
    putdstring "RIFF" 4 MEMORY_FILE
    put 0 long          MEMORY_FILE
    putdstring "WAVE" 4 MEMORY_FILE

    # "fmt "
    putdstring "fmt " 4 MEMORY_FILE
    put 0 long          MEMORY_FILE
    put CODEC short     MEMORY_FILE # wFormatTag: Microsoft PCM Format (0x0001)
    put CHANNELS short  MEMORY_FILE # wChannels
    put FREQUENCY long  MEMORY_FILE # dwSamplesPerSec
    put AVGBYTES long   MEMORY_FILE # dwAvgBytesPerSec
    put BLKALIGN short  MEMORY_FILE # wBlockAlign
    put BITS short      MEMORY_FILE # wBitsPerSample
    get MEM_SIZE asize MEMORY_FILE
    math RIFFTMP = MEM_SIZE
    math RIFFTMP - 0x14
    putvarchr MEMORY_FILE 0x10 RIFFTMP long

    # "data"
    putdstring "data" 4 MEMORY_FILE
    put SIZE long       MEMORY_FILE

    get MEM_SIZE asize MEMORY_FILE
    math RIFFTMP = SIZE
    math RIFFTMP + MEM_SIZE
    math RIFFTMP - 8
    putvarchr MEMORY_FILE 4 RIFFTMP long

    log NAME 0 MEM_SIZE MEMORY_FILE
    append
    log NAME 0 SIZE MEMORY_FILE2
    append
endfunction


Top
   
PostPosted: Mon Apr 08, 2019 10:44 pm 

Joined: Mon Apr 01, 2019 10:49 am
Posts: 70
Woah :D

No more glitch on beginning of each WAV.

Thanks a lot aLuigi !!

Now the script is perfect for me !


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 51 posts ]  Go to page Previous 1 2 3

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