Documents about dual UnityFS headers?

Extraction and unpacking of game archives and compression, encryption, obfuscation, decoding of unknown files
LiangZong
Posts: 19
Joined: Tue Jun 09, 2020 11:49 pm

Documents about dual UnityFS headers?

Post by LiangZong »

Hello everyone!
I found that many games have two UnityFS headers. All data before the second UnityFS header must be deleted to correctly identify the file.
However, many games have a lot of files, and the offset of the second UnityFS header of many files is different. Manual modification is very troublesome. . .
I have a bms script that determines the offset and then deletes it, which is not what I want.

Code: Select all

get ArcName filename
set Name string "new\\"
string Name + ArcName
get Size asize
math Size - 0x04
log Name 0x04 Size


My idea is to determine the offset of the second header through the bms script, and then use math Size-the offset of the second header. I don't know how to write this script.
help me. . .

.

The following samples belong to the same game:

yewan4.zip
timeline_egg_02.zip
avatar_11008.zip
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Documents about dual UnityFS headers?

Post by aluigi »

Code: Select all

goto 8  # skip the first one
findloc OFFSET binary "UnityFS"
get SIZE asize
math SIZE - OFFSET
get NAME filename
string NAME + ".unityfs"
log NAME OFFSET SIZE