Help with making a script

Extraction and unpacking of game archives and compression, encryption, obfuscation, decoding of unknown files
Jun
Posts: 4
Joined: Tue Dec 20, 2022 8:49 am

Help with making a script

Post by Jun »

Hello everyone,

I'm hoping one of you guys can help me figure out a way to delete the dummy Unity Header and the following data so the actually Unity Header can be used and read in Asset Studio. I can do it in a hex editor but there's so many files to go through and I just need a quick script to automate it all.
Screenshot 2022-12-20 004021.png
masagrator
Posts: 82
Joined: Sat Dec 22, 2018 10:03 am

Re: Help with making a script

Post by masagrator »

And you're sure every file has the same dummy header of size 0xf4?
Jun
Posts: 4
Joined: Tue Dec 20, 2022 8:49 am

Re: Help with making a script

Post by Jun »

I think they're all different sizes but I hope another picture can make things clear for you.

Screenshot 2022-12-21 014159.png
Jun
Posts: 4
Joined: Tue Dec 20, 2022 8:49 am

Re: Help with making a script

Post by Jun »

Screenshot 2023-01-18 040734.png
Is there a script to delete the first UnityFs header since its a dummy.?
ssh
Posts: 33
Joined: Sun Aug 17, 2014 5:50 pm

Re: Help with making a script

Post by ssh »

Code: Select all

get SIZE asize

if SIZE > 8
	idstring "UnityFS"
	findloc OFFSET string "UnityFS" 0 ""
	
	if OFFSET == ""
		cleanexit
	endif
	
	math SIZE - OFFSET
	get NAME filename
	string NAME p "_OUTPUT/%s" NAME
	log NAME OFFSET SIZE
endif
Jun
Posts: 4
Joined: Tue Dec 20, 2022 8:49 am

Re: Help with making a script

Post by Jun »

Works great.! Thank you so much.!