关于资产列表文件(OOY文件头)

一开始以为是私有格式,但是看见几个后感觉不对了。网络没能找到任何信息,求指点
见到OOY 2.0.0和OOY 1.5.2了,认不出是啥格式
样本:
PackageManifest_DefaultPackage_202503211524.rar (568.2 KB)

这是YooAsset, 很简单的格式, 直接看hex, 推算它的结构, 可以很容易还原为json

   PackageManifest_DefaultPackage:
       sign : [4 bytes, bytes]
       FileVersion : [2 bytes : str]
       EnableAddressable : [1 bytes, bool]
       LocationToLower : [1 bytes, bool]
       IncludeAssetGUID : [1 bytes, bool]
       OutputNameStyle : [4 bytes, int]
       PackageName : [2 bytes, str]
       PackageVersion : [2 bytes, str]
       AssetCount : [4 bytes, int]:
           Address : [2 bytes : str]
           AssetPath : [2 bytes : str]
           AssetGUID : [2 bytes : str]
           AssetTags : [2 bytes : int]:
               [2 bytes : str]
           BundleID : [4 bytes, int]
           DependIDs : [read 2 bytes : int]:
               [4 bytes, int]
       BundleCount : [4 bytes, int]:
           BundleName : [2 bytes : str]
           UnityCRC : [4 bytes : uint]
           FileHash : [2 bytes : str]
           FileCRC : [2 bytes : str]
           FileSize : [8 bytes : int]
           IsRawFile : [1 bytes, bool]
           LoadMethod : [1 bytes, int]
           Tags : [2 bytes : int]:
               [2 bytes : str]
           ReferenceIDs : [read 2 bytes : int]:
               [4 bytes, int]

结构大概就这样

1 个赞

是挺简单的,不过和 FlatBuffers这类一样要人工推测结构,我看了下一个游戏还能有两种不同结构的YooAsset,所以我选择,暴力处理。。。

这个格式变动不大的, 写个读取函数, 然后添加一些判断条件就行了, 当然你不需要详细解析的话那就直接re匹配字符串位置