SHARE
TWEET

Wwise BNK Extractor

Nicknine Jan 3rd, 2019 (edited) 196 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # Wwise soundbanks (BNK)
  2. # Script for QuickBMS: https://aluigi.altervista.org/quickbms.htm
  3.  
  4. idstring "BKHD"
  5. get SEC_SIZE long
  6. endian guess SEC_SIZE
  7. get EOF asize
  8.  
  9. # May not be present which means there are no sounds in the bank.
  10. callfunction FIND_SECTION 1 "DIDX"
  11. set TABLE_OFF SEC_OFF
  12. set TABLE_SIZE SEC_SIZE
  13.  
  14. callfunction FIND_SECTION 1 "DATA"
  15. set DATA_OFF SEC_OFF
  16.  
  17. goto TABLE_OFF
  18. xmath FILES "TABLE_SIZE / 0x0c"
  19. for i = 0 < FILES
  20.     get ID long
  21.     get OFFSET long
  22.     get SIZE long
  23.    
  24.     math OFFSET + DATA_OFF
  25.     string NAME p "%u.wem" ID
  26.     log NAME OFFSET SIZE
  27. next i
  28.  
  29. startfunction FIND_SECTION
  30.     savepos PREV_OFF
  31.     goto 0x00
  32.  
  33.     do
  34.         getdstring SEC_ID 0x04
  35.         get SEC_SIZE long
  36.         savepos SEC_OFF
  37.         xmath SEC_END "SEC_OFF + SEC_SIZE"
  38.         goto SEC_END
  39.     while SEC_ID != FIND_SECTION_ARG1 && SEC_END != EOF
  40.    
  41.     if SEC_ID != FIND_SECTION_ARG1
  42.         print "Section %FIND_SECTION_ARG1% not found. The bank does not contain any sounds."
  43.         cleanexit
  44.     endif
  45.    
  46.     goto PREV_OFF
  47. endfunction
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top