Unity3D Engine *.assets extractor
Couldn't find an extractor anywhere, so I wrote my own. :) Long overdue but wasn't motivated enough to go through the pain of the format. ;)
If you experience any problems, pm me and I'll take a look. The outsorted file types are only the ones I found.
Else, if anyone can identify some of the missing extensions, I'd be grateful!
lateste updates:
- if type 49 contains png or xml, it is recognized and the size adjusted
- included variant with file tale at the end (some resources.assets use those)
- mp3 detection included
# extract Unity3D engine *.assets files# © 2012-10-15 by AlphaTwentyThree of XeNTaXget EXT extensionif EXT == "resS" # no TOC -> scan cleanexitendifendian bigget FSIZE asizegoto 0xcget BIAS longif BIAS != 0 # var1 endian little goto 0x28 get FILES longelse # var2 goto 0 get INFOSIZE long get INFO long # actually file size math INFO -= INFOSIZE math INFO += 0x15 goto INFO endian little get FILES longendiffor i = 1 <= FILES set SKIP 0 set EXT "" set FNAME "" set WNAME "" get FID long get OFFSET long math OFFSET += BIAS # zero in var2 get SIZE long get TYPE long get DUMMY long # same as TYPE (?) savepos MYOFF callfunction distTYPE 1 if SKIP == 0 if EXT = "" set EXT "." string EXT += TYPE endif get FOLDERNAME basename string FOLDERNAME += "/" if FNAME == "" get FNAME basename string FNAME += "_" string FNAME += FID endif string FNAME += EXT set WNAME FOLDERNAME string WNAME += FNAME if FID == FILES # probably not needed, just a precaution get SIZE asize math SIZE -= OFFSET endif log WNAME OFFSET SIZE endif goto MYOFFnext istartfunction distTYPE if TYPE == 1 elif TYPE == 2 elif TYPE == 3 elif TYPE == 4 elif TYPE == 5 elif TYPE == 6 elif TYPE == 7 elif TYPE == 8 elif TYPE == 9 elif TYPE == 10 elif TYPE == 11 elif TYPE == 12 elif TYPE == 13 elif TYPE == 14 elif TYPE == 15 elif TYPE == 16 elif TYPE == 17 elif TYPE == 18 elif TYPE == 19 elif TYPE == 20 elif TYPE == 21 callfunction getname 1 set EXT ".mat" elif TYPE == 23 elif TYPE == 26 elif TYPE == 28 callfunction getname 1 set EXT ".tex" elif TYPE == 33 elif TYPE == 43 callfunction getname 1 elif TYPE == 48 callfunction getname 1 set EXT ".shader" goto OFFSET get SIZE long math OFFSET += 4 elif TYPE == 49 # ingame movies/xml/backgrounds callfunction getname 1 callfunction getType 1 elif TYPE == 54 elif TYPE == 64 elif TYPE == 65 elif TYPE == 74 callfunction getname 1 set EXT ".ani" elif TYPE == 82 elif TYPE == 83 # can be empty (some pointer maybe) callfunction getname 1 set TEST SIZE math TEST -= 0x18 if TEST == 0 set SKIP 1 else math OFFSET += 0x10 goto OFFSET get SIZE long savepos OFFSET getDstring TYPE2 3 if TYPE2 == "RIF" set EXT ".wav" elif TYPE2 == "Ogg" set EXT ".ogg" elif TYPE2 == "ID3" set EXT ".mp3" else goto OFFSET get TYPE2 byte if TYPE2 == 0xff set EXT ".mp3" endif endif endif elif TYPE == 89 callfunction getname 1 elif TYPE == 96 elif TYPE == 108 elif TYPE == 111 elif TYPE == 115 callfunction getname 1 elif TYPE == 123 elif TYPE == 128 callfunction getname 1 set EXT ".ttf" elif TYPE == 131 elif TYPE == 135 elif TYPE == 150 elif TYPE == 152 callfunction getname 1 math OFFSET += 0x10 math SIZE -= 0x10 set EXT ".ogm" elif TYPE == 159 callfunction getname 1 elif TYPE == 198 elif TYPE == 199 elif TYPE == 3584 # last file else endifendfunction startfunction getname goto OFFSET get NAMEL long set TEST NAMEL math TEST %= 4 if TEST != 0 # round to next 4byte math NAMEL /= 4 math NAMEL += 1 math NAMEL *= 4 endif getDstring FNAME NAMEL savepos NBIAS math NBIAS -= OFFSET math OFFSET += NBIAS math SIZE -= NBIASendfunctionstartfunction getType goto OFFSET get DUMMY long get TYPE long if TYPE == 0x6d783f3c math OFFSET += 4 set SIZE DUMMY set EXT ".xml" elif TYPE == 0x474e5089 math OFFSET += 4 set SIZE DUMMY set EXT ".png" endifendfunction