Help with BMS Script

Extraction and unpacking of game archives and compression, encryption, obfuscation, decoding of unknown files
dartobul
Posts: 5
Joined: Sat Mar 05, 2022 7:19 am

Help with BMS Script

Post by dartobul »

Hi, I need to extract Image Files from this file
Last edited by dartobul on Tue Apr 26, 2022 12:20 pm, edited 2 times in total.
dartobul
Posts: 5
Joined: Sat Mar 05, 2022 7:19 am

Re: Help with BMS Script for Mighty Goose Assets.dat file [Chowdren]

Post by dartobul »

bump
Last edited by dartobul on Tue Apr 26, 2022 12:20 pm, edited 1 time in total.
dartobul
Posts: 5
Joined: Sat Mar 05, 2022 7:19 am

Re: Help with BMS Script for Mighty Goose Assets.dat file [Chowdren]

Post by dartobul »

bump
dartobul
Posts: 5
Joined: Sat Mar 05, 2022 7:19 am

Re: Help with BMS Script for Mighty Goose Assets.dat file [Chowdren]

Post by dartobul »

bump
h3x3r
Posts: 165
Joined: Wed Jun 01, 2016 5:53 pm

Re: Help with BMS Script for Mighty Goose Assets.dat file [Chowdren]

Post by h3x3r »

O.K it was messy but it's done. Don't expect re-import.

Code: Select all

##################################
comtype zlib_noerror
get FNAME BASENAME
getdstring DUMMY 0x1AF0
math FILES = 0xF54 # 3924

for i = 0 < FILES
   get OFFSET long
   savepos OFFSET_POS
   string NAME p "%s/%d.dat" FNAME OFFSET
   string FNTNAME p "%s/%s/%d.dat" FNAME Fonts OFFSET
   string IMGNAME p "%s/%s/%d.dat" FNAME Images OFFSET
   string OGGNAME p "%s/%s/%d.ogg" FNAME OggS OFFSET
   string WEBMNAME p "%s/%s/%d.webm" FNAME webm OFFSET
   
   goto OFFSET
   getdstring DUMMY 0x11 # 17
   get ZLIBMAGIC0 short
   goto OFFSET
   getdstring DUMMY 0x19 # 25
   get ZLIBMAGIC1 short
   goto OFFSET
   getdstring DUMMY 0x21 # 33
   get ZLIBMAGIC2 short
   goto OFFSET
   getdstring DUMMY 0x29 # 41
   get ZLIBMAGIC3 short
   goto OFFSET
   getdstring DUMMY 0x31 # 49
   get ZLIBMAGIC4 short   
   goto OFFSET
   getdstring DUMMY 0x39 # 57
   get ZLIBMAGIC5 short
   goto OFFSET
   getdstring DUMMY 0x41 # 65
   get ZLIBMAGIC6 short
   goto OFFSET
   getdstring DUMMY 0x59 # 89
   get ZLIBMAGIC7 short
   
   goto OFFSET
   getdstring DUMMY 0x14 # 20
   get OGGMAGIC long
   
   goto OFFSET
   getdstring DUMMY 0x1C # 28
   get WEBMMAGIC long
   
   goto OFFSET
   if ZLIBMAGIC0 == 40056
      get WIDTH short
      get HEIGHT short
      getdstring DUMMY 0x9
      get SIZE long
      savepos TMP_OFFSET
      clog IMGNAME TMP_OFFSET SIZE SIZE
   elif ZLIBMAGIC1 == 40056
      get WIDTH short
      get HEIGHT short
      getdstring DUMMY 0x11
      get SIZE long
      savepos TMP_OFFSET
      clog IMGNAME TMP_OFFSET SIZE SIZE
   elif ZLIBMAGIC2 == 40056
      get WIDTH short
      get HEIGHT short
      getdstring DUMMY 0x19
      get SIZE long
      savepos TMP_OFFSET
      clog IMGNAME TMP_OFFSET SIZE SIZE
   elif ZLIBMAGIC3 == 40056
      get WIDTH short
      get HEIGHT short
      getdstring DUMMY 0x21
      get SIZE long
      savepos TMP_OFFSET
      clog IMGNAME TMP_OFFSET SIZE SIZE
   elif ZLIBMAGIC4 == 40056
      get WIDTH short
      get HEIGHT short
      getdstring DUMMY 0x29
      get SIZE long
      savepos TMP_OFFSET
      clog IMGNAME TMP_OFFSET SIZE SIZE
   elif ZLIBMAGIC5 == 40056
      get WIDTH short
      get HEIGHT short
      getdstring DUMMY 0x31
      get SIZE long
      savepos TMP_OFFSET
      clog IMGNAME TMP_OFFSET SIZE SIZE
   elif ZLIBMAGIC6 == 40056
      get WIDTH short
      get HEIGHT short
      getdstring DUMMY 0x39
      get SIZE long
      savepos TMP_OFFSET
      clog IMGNAME TMP_OFFSET SIZE SIZE
   elif ZLIBMAGIC7 == 40056
      get WIDTH short
      get HEIGHT short
      getdstring DUMMY 0x51
      get SIZE long
      savepos TMP_OFFSET
      clog IMGNAME TMP_OFFSET SIZE SIZE
   elif OGGMAGIC == 1399285583
      getdstring DUMMY 0x10
      get SIZE long
      savepos TMP_OFFSET
      log OGGNAME TMP_OFFSET SIZE
   elif WEBMMAGIC == 1835165047
      get SIZE long
      savepos TMP_OFFSET
      log WEBMNAME TMP_OFFSET SIZE
   elif OFFSET == 56374342
      log FNTNAME OFFSET 7454
   elif OFFSET == 56381796
      log FNTNAME OFFSET 232616
   elif OFFSET == 56614412
      log FNTNAME OFFSET 21813
   elif OFFSET == 56636225
      log FNTNAME OFFSET 17727
   elif OFFSET == 56653952
      log FNTNAME OFFSET 7310
   elif OFFSET == 56661262
      log FNTNAME OFFSET 10418
   elif OFFSET == 56671680
      log FNTNAME OFFSET 87235
   elif OFFSET == 56758915
      log FNTNAME OFFSET 24032
   elif OFFSET == 56782947
      log FNTNAME OFFSET 16004
   elif OFFSET == 56798951
      log FNTNAME OFFSET 98232
   elif OFFSET == 56897183
      log FNTNAME OFFSET 116959
   elif OFFSET == 57014142
      log FNTNAME OFFSET 611456
   elif OFFSET == 57625598
      log FNTNAME OFFSET 213820
   elif OFFSET == 57839418
      log FNTNAME OFFSET 112980
   elif OFFSET == 57952398
      log FNTNAME OFFSET 85601
   elif OFFSET == 58037999
      log FNTNAME OFFSET 7347
   elif OFFSET == 58045346
      log FNTNAME OFFSET 313519
   else
      get SIZE long
      savepos TMP_OFFSET
      log NAME TMP_OFFSET SIZE
   endif
   goto OFFSET_POS
next i


For textures use viewtopic.php?t=7099. Just drop *.dat on it and set width height. Tool will generate dds file from it. Image dimension are in attached txt file. Image are mostly r8g8b8a8.

Or you can use bat file which will do it for you. You must just copy RawtexCmd.exe and RawtexCmd.bat and texconv.exe into the Assets\Images folder and run bat file. It will take some time to convert.
dartobul
Posts: 5
Joined: Sat Mar 05, 2022 7:19 am

Re: Help with BMS Script for Mighty Goose Assets.dat file [Chowdren]

Post by dartobul »

Thank you very much for this, I would never managed to do all this by myself and it works !