example:

Need decoder or converter.
one .xvag file from uncharted drake`s fortune.



vgmstream needs some external .dll files. Check the readme for download location and installation instructions.stephanehl wrote:Please i need help. I want to rip all god of wars 3 movies but it audio is in xvag but i cant use vgmstream. It dont works.
Any Help.




About interleave value finding:First, you need to find out the distance between each FFFB flag.
Then take that number and just keep multiplying it by 1, 2, 3 in a hex calculator until you find the correct interleave.
For example, let's say the distance between two FFFB flags is 0x300 or 768 bytes
300 x 1 = 300
300 x 2 = 600
300 x 3 = 900
Works with The Last of Us:Well, initially I just kept guessing and trying every number by adding or subtracting 0x300 to the number that didn't work (I started at 3000). But I just figured out an easier way. Keep looking at the contents of every frame (what's in between the FFFB values) and notice any patterns (usually, in the beginning, it's one repeated ascii character). Keep counting the frames, and when you see the pattern change, remember the number of that frame. Convert that number to hex, then multiply 0x300 by that number. (Here's a hex calculator: http://www.squarebox.co.uk/hcalc.html) So if the number you counted was 16, the interleave would be 3000. If you get it wrong, try adding 0x300 or subtracting 0x300. If it still doesn't work, look at the patterns more carefully.
Oh, and btw, the frame value is the address of the character that's before the first frame (for example, if the first frame starts with 11 00 FF FB D4, the frame value would be the address of the 00)


Code: Select all
set HEADER 0x1B4 # zero if skip is at end of block, otherwise = first skip at start


Code: Select all
set INTSIZE 0x2700 # size of one single interleave block. Set Blocksize to zero to take this value instead.
Code: Select all
set LAYERS 6Code: Select all
set HEADER 0x1B4 # zero if skip is at end of block, otherwise = first skip at start
set PRESERVE 1
set ADJUST 0
set BLOCKSIZE 0 # size of one complete block
set INTSIZE 0x2700 # size of one single interleave block. Set Blocksize to zero to take this value instead.
set LAYERS 6
set SKIP 0 # area at start of each block to skip
Code: Select all
set HEADER 0x133 # zero if skip is at end of block, otherwise = first skip at start
set PRESERVE 1
set ADJUST 0
set BLOCKSIZE 0 # size of one complete block
set INTSIZE 0x1800 # size of one single interleave block. Set Blocksize to zero to take this value instead.
set LAYERS 2
set SKIP 0 # area at start of each block to skipCode: Select all
set HEADER 0x133 # zero if skip is at end of block, otherwise = first skip at start
set PRESERVE 1
set ADJUST 0
set BLOCKSIZE 0 # size of one complete block
set INTSIZE 0x1800 # size of one single interleave block. Set Blocksize to zero to take this value instead.
set LAYERS 2
set SKIP 0 # area at start of each block to skip
set JUMP INTERL
math JUMP *= LAYERS # JUMP = size of one block
math INTERL -= SKIP
get TEST asize
math TEST %= LAYERS
if TEST != 0
print "Illegal deinterleave parameters! Aborting..."
cleanexit
endif
get CYCLES asize
math CYCLES /= JUMP # number of interleave blocks
get RES asize
math RES %= JUMP # size of last interleave block
#print "residuum: %RES%"
math RES /= LAYERS # size of single last interleave
if RES != 0
print "Warning: last block is incomplete! Check your parameters!"
endif
for i = 1 <= LAYERS
log MEMORY_FILE 0 0
set OFFSET i
math OFFSET -= 1
math OFFSET *= INTERL
math OFFSET += HEADER
append
for k = 1 <= CYCLES
log MEMORY_FILE OFFSET INTERL
math OFFSET += JUMP
math OFFET += SKIP
NEXT k
if RES != 0 # incomplete but valid last block
set OFF i
math OFF -= 1
math OFF *= RES
math OFFSET -= JUMP
math OFFSET -= SKIP
math OFFSET += OFF
log MEMORY_FILE OFFSET RES
endif
append
get SIZE asize MEMORY_FILE
get NAME basename
if LAYERS != 1
string NAME += "_"
string NAME += i
endif
log NAME 0 SIZE MEMORY_FILE
next i
Code: Select all
# deinterleave file by different parameters
# (c) 2012-09-05 by AlphaTwentyThree of XeNTaX
# notes:
# HEADER - area which is untouched by the deinterleaving
# PRESERVE 0/1 - set to 1 to write the skipped area from
# HEADER to each deinterleaved file
# ADJUST 0/1 - if the header needs to be adjusted, set
# this to 1 and write your code to the function
# "adjustheader" at the end of this script
# BLOCKSIZE - size of one complete interleave block
# INTSIZE - size of a single interleave block (set blocksize to zero to take this value)
# LAYERS - the numbers of (equal-sized) files you want
# to deinterleave to
# SKIP - number of bytes to skip at the start of each block
#
# examples:
# split channels of stereo wave file: # HEADER 0x2c, PRESERVE 1, ADJUST 1 (adjust function), BLOCKSIZE 4, LAYERS 2, SKIP 0
# leave out 2 bytes each 0x10 bytes: # BLOCKSIZE 0x10, LAYERS 1, SKIP 2
# split channels of Playstation ADPCM file: # HEADER 0x2c, PRESERVE 1, ADJUST 1 (adjust function), BLOCKSIZE 2*Interleave, SKIP 0
set HEADER 0x1B4 # zero if skip is at end of block, otherwise = first skip at start
set PRESERVE 1
set ADJUST 0
set BLOCKSIZE 0 # size of one complete block
set INTSIZE 0x2700 # size of one single interleave block. Set Blocksize to zero to take this value instead.
set LAYERS 6
set SKIP 0 # area at start of each block to skip
if BLOCKSIZE == 0
set BLOCKSIZE INTSIZE
math BLOCKSIZE *= LAYERS
math BLOCKSIZE += SKIP
endif
callfunction testparameters 1
get EXT extension
set WSIZE BLOCKSIZE
math WSIZE -= SKIP
math WSIZE /= LAYERS # data to write: (BLOCKSIZE - SKIP)/LAYERS
get CYCLES asize
math CYCLES -= HEADER
math CYCLES /= BLOCKSIZE
if LAYERS == 1
callfunction desingle # for faster running time
else
callfunction demulti
endif
startfunction testparameters
# test 1: (BLOCKSIZE-SKIP)/LAYERS must be integer (one block must be dividable into skip and layers)
set TEST BLOCKSIZE
math TEST -= SKIP
math TEST %= LAYERS # single layer -> always ok
if TEST != 0
print "Error: blocksize minus skip isn't dividable by layer count! Aborting..."
cleanexit
endif
# test 2: (ASIZE-HEADER)/BLOCKSIZE must be integer (no incomplete blocks at end)
get TEST asize
math TEST -= HEADER
math TEST %= BLOCKSIZE
if TEST != 0
print "Error: file size minus header isn't dividable by blocksize! Aborting..."
cleanexit
endif
# test 3: ASIZE-HEADER-BLOCKSIZE must be greater null (at least one deinterleave cycle)
get TEST asize
math TEST -= HEADER
math TEST -= BLOCKSIZE
if FSIZE <= 0
print "Error: file too small to deinterleave! Aborting..."
cleanexit
endif
endfunction
startfunction desingle
set PSIZE CYCLES
math PSIZE *= WSIZE
get NAME basename
string NAME += ".stripped"
if PRESERVE == 1
math PSIZE += HEADER
string NAME += "."
string NAME += EXT
endif
putVarChr MEMORY_FILE PSIZE 0
log MEMORY_FILE 0 0
if PRESERVE == 1
goto 0
getDstring HDATA HEADER
putDstring HDATA HEADER MEMORY_FILE
endif
goto HEADER
for i = 1 <= CYCLES
getDstring DUMMY SKIP
getDstring WDATA WSIZE
putDstring WDATA WSIZE MEMORY_FILE
math OFFSET += WSIZE # set OFFSET to current cursor (WDATA + SKIP = BLOCKSIZE)
next i
get SIZE asize MEMORY_FILE
if ADJUST == 1
callfunction adjustheader 1
endif
log NAME 0 SIZE MEMORY_FILE
endfunction
startfunction demulti
set PSIZE CYCLES
math PSIZE *= WSIZE
if PRESERVE == 1
math PSIZE += HEADER
goto 0
getDstring HDATA HEADER
endif
for i = 1 <= LAYERS
putVarChr MEMORY_FILE PSIZE 0
log MEMORY_FILE 0 0
get NAME basename
string NAME += "_"
string NAME += i
if PRESERVE == 1
putDstring HDATA HEADER MEMORY_FILE
string NAME += "."
string NAME += EXT
endif
set BIAS_A i
math BIAS_A -= 1
math BIAS_A *= WSIZE
math BIAS_A += SKIP # bias at start
set BIAS_B BLOCKSIZE
math BIAS_B -= BIAS_A
math BIAS_B -= WSIZE # bias at end
goto HEADER
for k = 1 <= CYCLES
getDstring DUMMY BIAS_A
getDstring WDATA WSIZE
putDstring WDATA WSIZE MEMORY_FILE
getDstring DUMMY BIAS_B
next k
get SIZE asize MEMORY_FILE
if ADJUST == 1
callfunction adjustheader 1
endif
log NAME 0 SIZE MEMORY_FILE
next i
endfunction
startfunction adjustheader # adjust this according to your needs
putVarChr MEMORY_FILE 4 1 long
get SSIZE asize MEMORY_FILE
math SSIZE -= HEADER
putVarChr MEMORY_FILE 0x10 SSIZE long
endfunction