HearthSim / UnityPack

Python deserialization library for Unity3D Asset format
https://hearthsim.info/
MIT License
720 stars 153 forks source link

Cannot examine packages from Unity 2019.2 #93

Closed stevenvergenz closed 4 years ago

stevenvergenz commented 4 years ago

When trying to load an asset bundle built in Unity 2019.2.12f1, I get the following exception. A test bundle is also attached below.

Traceback (most recent call last):
  File "validate_asset_bundle.py", line 44, in <module>
    objects = len(asset.objects)
  File "/home/stvergen/.local/lib/python3.6/site-packages/unitypack/asset.py", line 84, in objects
    self.load()
  File "/home/stvergen/.local/lib/python3.6/site-packages/unitypack/asset.py", line 110, in load
    self.tree.load(buf)
  File "/home/stvergen/.local/lib/python3.6/site-packages/unitypack/type.py", line 147, in load
    tree.load(buf)
  File "/home/stvergen/.local/lib/python3.6/site-packages/unitypack/type.py", line 33, in load
    self.load_blob(buf)
  File "/home/stvergen/.local/lib/python3.6/site-packages/unitypack/type.py", line 78, in load_blob
    curr.name = self.get_string(buf.read_int())
  File "/home/stvergen/.local/lib/python3.6/site-packages/unitypack/type.py", line 91, in get_string
    return data[offset:].partition(b"\0")[0].decode("utf-8")
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xff in position 0: invalid start byte

template.zip