ZenHAX

Free Game Research Forum | Official QuickBMS support | twitter @zenhax | SSL HTTPS://zenhax.com
It is currently Wed Jan 17, 2018 1:28 am

All times are UTC




Post new topic  Reply to topic  [ 155 posts ]  Go to page Previous 1 2 3 4 58 Next
Author Message
PostPosted: Tue Mar 24, 2015 8:24 am 

Joined: Sat Aug 09, 2014 11:21 am
Posts: 616
Hey Luigi! I've enhanced your script with some type distinctions (function disttype) and thus changed the name creation. Take a look and decide if you want to use this or parts of it! The advantage could be that others can contribute and add other identified file types.


Attachments:
GRAF~unity.zip [1.68 KiB]
Downloaded 243 times
Top
   
PostPosted: Tue Mar 24, 2015 4:15 pm 
Site Admin
User avatar

Joined: Wed Jul 30, 2014 9:32 pm
Posts: 7426
Very cool idea, I have updated the script accordingly.
The only thing I changed was the FNAME generation that I have set just like it was before plus the extension.


Top
   
PostPosted: Wed Mar 25, 2015 10:38 am 

Joined: Sat Aug 09, 2014 11:21 am
Posts: 616
Updated disttype function with aif:
Code:
startfunction disttype
   string EXT p= ".%d" TYPE
   if TYPE == 21
      set EXT ".mat"
   elif TYPE == 28
      set EXT ".tex"
   elif TYPE == 48
      set EXT ".shader"
   elif TYPE == 49
      savepos MYOFF
      goto OFFSET
      get DUMMY long
      getDstring TEST 4
      if TEST == "<?xm"
         math OFFSET += 4
         math SIZE -= 4
         set EXT ".xml"
      endif
      goto MYOFF
   elif TYPE == 74
      set EXT ".ani"
   elif TYPE == 83
      set EXT ".snd"
      savepos MYOFF
      goto OFFSET
      getDstring DUMMY 0x14
      getDstring TEMP 4
      if TEMP == "OggS"
         set EXT ".ogg"
         math OFFSET += 0x14
         math SIZE -= 0x14
      elif TEMP == "RIFF"
         set EXT ".wav"
         math OFFSET += 0x14
         math SIZE -= 0x14
      elif TEMO == "FORM"
         set EXT ".aif"
         math OFFSET += 0x14
         math SIZE -= 0x14
      endif
      goto MYOFF
   elif TYPE == 115
      set EXT ".script"
   elif TYPE == 128
      set EXT ".ttf"
   elif TYPE == 150
      set EXT ".bin"
   elif TYPE == 152
      math OFFSET += 0x10
      math SIZE -= 0x10
      set EXT ".ogm"
   elif TYPE == 156
      set EXT ".ter"
   elif TYPE == 184
      set EXT ".sbam"
   elif TYPE == 194
      set EXT ".tes"
   endif
endfunction


Top
   
PostPosted: Fri Mar 27, 2015 10:46 pm 
User avatar

Joined: Thu Aug 07, 2014 9:43 pm
Posts: 52
AlphaTwentyThree
Quote:
elif TEMO == "FORM"

TEMO → TEMP

_________________
-= GP-team =-
https://twitter.com/Haoose


Top
   
PostPosted: Sat Mar 28, 2015 9:12 am 

Joined: Sat Aug 09, 2014 11:21 am
Posts: 616
Haoose wrote:
AlphaTwentyThree
Quote:
elif TEMO == "FORM"

TEMO → TEMP

Whoops, sorry. ;)


Top
   
PostPosted: Sat Mar 28, 2015 9:14 am 

Joined: Sat Aug 09, 2014 11:21 am
Posts: 616
Here's an updated version of disttype with mp3 added! :D
Code:
startfunction disttype
   string EXT p= ".%d" TYPE
   if TYPE == 21
      set EXT ".mat"
   elif TYPE == 28
      set EXT ".tex"
   elif TYPE == 48
      set EXT ".shader"
   elif TYPE == 49
      savepos MYOFF
      goto OFFSET
      get DUMMY long
      getDstring TEST 4
      if TEST == "<?xm"
         math OFFSET += 4
         math SIZE -= 4
         set EXT ".xml"
      endif
      goto MYOFF
   elif TYPE == 74
      set EXT ".ani"
   elif TYPE == 83
      set EXT ".snd"
      savepos MYOFF
      math OFFSET += 0x14
      math SIZE -= 0x14
      goto OFFSET
      getDstring TEMP 4
      if TEMP == "OggS"
         set EXT ".ogg"
      elif TEMP == "RIFF"
         set EXT ".wav"
      elif TEMP == "FORM"
         set EXT ".aif"
      else
         goto OFFSET
         get TEMP byte
         if TEMP == 0xff
            set EXT ".mp3"
         elif TEMP == 0x49
            savepos MYOFF
            math MYOFF -= 1
            goto MYOFF
            getDstring TEMP 3
            if TEMP == "ID3"
               set EXT ".mp3"
            else
               math OFFSET -= 0x14
               math SIZE += 0x14
            endif
         else # roll back changes
            math OFFSET -= 0x14
            math SIZE += 0x14
         endif
      endif
      goto MYOFF
   elif TYPE == 115
      set EXT ".script"
   elif TYPE == 128
      set EXT ".ttf"
   elif TYPE == 150
      set EXT ".bin"
   elif TYPE == 152
      math OFFSET += 0x10
      math SIZE -= 0x10
      set EXT ".ogm"
   elif TYPE == 156
      set EXT ".ter"
   elif TYPE == 184
      set EXT ".sbam"
   elif TYPE == 194
      set EXT ".tes"
   endif
endfunction


Last edited by AlphaTwentyThree on Sat Mar 28, 2015 11:13 am, edited 2 times in total.

Top
   
PostPosted: Sat Mar 28, 2015 9:51 am 

Joined: Sat Aug 09, 2014 11:21 am
Posts: 616
I've encountered Android games the have split assets archives. Here's a little bit of code that will take care of these (always apply to the *.assets.split0 obviously):
Code:
get EXT extension
if EXT == "split0"
   callfunction combine 1
endif
startfunction combine
   get BNAME basename
   set CSIZE 0
   for i = 0
      string ONAME p= "%s.split%d" BNAME i
      open FDSE ONAME 0 EXIST
      if EXIST == 0
         break
      else
         get SIZE asize
         append
         log MEMORY_FILE 0 SIZE
         append
      endif
   next i
   get SIZE asize MEMORY_FILE
   log BNAME 0 SIZE MEMORY_FILE
   open FDSE BNAME 0
endfunction


Top
   
PostPosted: Sat Mar 28, 2015 11:13 am 

Joined: Sat Aug 09, 2014 11:21 am
Posts: 616
Just made another update on the disttype function above for MP3 files with an ID3 tag at the start. :)


Top
   
PostPosted: Sat Mar 28, 2015 4:36 pm 
Site Admin
User avatar

Joined: Wed Jul 30, 2014 9:32 pm
Posts: 7426
Well done, I have updated the script.


Top
   
PostPosted: Mon Mar 30, 2015 1:43 pm 

Joined: Sat Aug 09, 2014 11:21 am
Posts: 616
aluigi wrote:
Well done, I have updated the script.

Hm, what about the split files support?


Top
   
PostPosted: Mon Mar 30, 2015 2:06 pm 
Site Admin
User avatar

Joined: Wed Jul 30, 2014 9:32 pm
Posts: 7426
I thought yours is a standalone script.
I think it's difficult to implement it in unity.bms because it reads from file 0, while if you combile the splits you have a memory file or a new local file that probably can't be opened by quickbms because it's in the output folder.


Top
   
PostPosted: Tue Mar 31, 2015 12:19 pm 

Joined: Sat Aug 09, 2014 11:21 am
Posts: 616
Huh? ;)
I've just implemented it and it works perfectly fine:
Code:
get EXT extension
if EXT == "unity3d"
    print "Error: you must use the unity3d_webplayer.bms script for this archive"
    cleanexit
elif EXT == "split0"
   callfunction combine 1
   open FDSE BNAME 0
endif

startfunction combine
   get BNAME basename
   set CSIZE 0
   for i = 0
      string ONAME p= "%s.split%d" BNAME i
      open FDSE ONAME 0 EXIST
      if EXIST == 0
         break
      else
         get SIZE asize
         append
         log MEMORY_FILE 0 SIZE
         append
      endif
   next i
   get SIZE asize MEMORY_FILE
   log BNAME 0 SIZE MEMORY_FILE
endfunction

goto 0

# rest of script


Top
   
PostPosted: Tue Mar 31, 2015 1:47 pm 
Site Admin
User avatar

Joined: Wed Jul 30, 2014 9:32 pm
Posts: 7426
Cool, quickbms rocks :)
I have updated the script with minimal modifications to your code but I think it works.


Top
   
PostPosted: Tue Mar 31, 2015 2:07 pm 

Joined: Sat Aug 09, 2014 11:21 am
Posts: 616
Here are some archives that produce an error: http://*USE_ANOTHER_FILEHOSTING*/3641934 ... ts_prob.7z
An update would be cool :)


Top
   
PostPosted: Tue Mar 31, 2015 2:09 pm 

Joined: Sat Aug 09, 2014 11:21 am
Posts: 616
aluigi wrote:
Cool, quickbms rocks :)
I have updated the script with minimal modifications to your code but I think it works.

line 264: "append" instead of "ppend" will work slightly better. ;)
Cool thing you implemented my suggestion! :)


Top
   
PostPosted: Tue Mar 31, 2015 2:19 pm 
Site Admin
User avatar

Joined: Wed Jul 30, 2014 9:32 pm
Posts: 7426
Ah ah ah, I'm not even good at using copy&paste.


Top
   
PostPosted: Tue Mar 31, 2015 2:21 pm 

Joined: Sat Aug 09, 2014 11:21 am
Posts: 616
lol :D
Don't miss my little post in-between about the error archives. ;)


Top
   
PostPosted: Tue Mar 31, 2015 2:38 pm 
Site Admin
User avatar

Joined: Wed Jul 30, 2014 9:32 pm
Posts: 7426
I have fixed the disttype function because you didn't return to the original information offset.
Now it does it automatically so you don't even need to save it and use "goto OFFSET" because it's already done.


Top
   
PostPosted: Tue Mar 31, 2015 4:38 pm 

Joined: Sat Aug 09, 2014 11:21 am
Posts: 616
aluigi wrote:
I have fixed the disttype function because you didn't return to the original information offset.
Now it does it automatically so you don't even need to save it and use "goto OFFSET" because it's already done.

whoops... ;) Thanks for that :)


Top
   
PostPosted: Thu Apr 02, 2015 3:43 am 

Joined: Sun Aug 24, 2014 8:54 am
Posts: 139
hi~~aluigi
script not support 5.0.1f1,get some error

offset filesize filename
--------------------------------------
- SCRIPT's MESSAGE:
5.0.1f1

001a8494 104 TYPE_21/DirectionalLight.mat
001a8494 108 TYPE_120/DirectionalLight.120
001a8483 0 TYPE_248/resources_2.248
001a8480 4 TYPE_0/DirectionalLight.0
00198495 0 TYPE_5/resources_4.5
001a8495 4294901781 TYPE_0/resources_5.0

Error: impossible to write 0xffff0015 bytes (total 0xffff0015)
Check your disk space

Last script line before the error or that produced the error:
157 log FNAME OFFSET SIZE
================================================================

offset filesize filename
--------------------------------------
- SCRIPT's MESSAGE:
5.0.1f1

00024004 80 TYPE_150/sharedassets0_0.bin
0000a0c0 106392 TYPE_360/EmptyBrush.360
0000a0b3 0 TYPE_106768/sharedassets0_2.106768
0000a0b0 4 TYPE_0/EmptyBrush.0

Error: incomplete input file 0: D:\Unity 5\sharedassets0.assets
Can't read 4 bytes from offset ffffa0c5.
Anyway don't worry, it's possible that the BMS script has been written
to exit in this way if it's reached the end of the archive so check it
or contact its author or verify that all the files have been extracted.
Please check the following coverage information to know if it's ok.

coverage file 0 0% 107897 73012508

Last script line before the error or that produced the error:
122 get NAMESZ long


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

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