K0lb3 / UnityPy

UnityPy is python module that makes it possible to extract/unpack and edit Unity assets
MIT License
761 stars 113 forks source link

Can't load Unity 4.7.2f1 files while AssetStudio does. #237

Open 0x07E5 opened 1 month ago

0x07E5 commented 1 month ago

Code A snippet of the code section that cases the bug or error.

env = UnityPy.load("example.unity3d")

Error The error message that is produced by python.

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\0x07E5\AppData\Local\Programs\Python\Python310\lib\site-packages\UnityPy\__init__.py", line 8, in load
    return Environment(*args, fs=fs, **kwargs)
  File "C:\Users\0x07E5\AppData\Local\Programs\Python\Python310\lib\site-packages\UnityPy\environment.py", line 46, in __init__
    self.load_file(arg)
  File "C:\Users\0x07E5\AppData\Local\Programs\Python\Python310\lib\site-packages\UnityPy\environment.py", line 137, in load_file
    f = ImportHelper.parse_file(
  File "C:\Users\0x07E5\AppData\Local\Programs\Python\Python310\lib\site-packages\UnityPy\helpers\ImportHelper.py", line 139, in parse_file
    f = files.BundleFile(reader, parent, name=name, is_dependency=is_dependency)
  File "C:\Users\0x07E5\AppData\Local\Programs\Python\Python310\lib\site-packages\UnityPy\files\BundleFile.py", line 40, in __init__
    m_DirectoryInfo, blocksReader = self.read_web_raw(reader)
  File "C:\Users\0x07E5\AppData\Local\Programs\Python\Python310\lib\site-packages\UnityPy\files\BundleFile.py", line 72, in read_web_raw
    uncompressedBytes = CompressionHelper.decompress_lzma(
  File "C:\Users\0x07E5\AppData\Local\Programs\Python\Python310\lib\site-packages\UnityPy\helpers\CompressionHelper.py", line 39, in decompress_lzma
    return dec.decompress(data[5:])
_lzma.LZMAError: Corrupt input data

Bug A description of what you expect to happen/see and what actually happens.

Can't load Unity 4.7.2f1 files.

To Reproduce