WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

LZ4 decompession failed #353

@smpial

Description

@smpial

Code

import os
import UnityPy


UnityPy.config.FALLBACK_UNITY_VERSION = '2022.3.52f1'

env = UnityPy.load('avgbg_assets_bg0001_q_15caadfac7a047db4ea676ea62806d56.bundle')
for obj in env.objects:
    print(obj.type.name)
print('End')

Error

C:\Users\user\AppData\Local\Programs\Python\Python310\lib\site-packages\UnityPy\files\BundleFile.py:526: UnityVersionFallbackWarning: No valid Unity version found, defaulting to UnityPy.config.FALLBACK_UNITY_VERSION (2022.3.52f1)
  version_str = config.get_fallback_version()
Traceback (most recent call last):
  File "E:\code\unity_unpack\test.py", line 7, in <module>
    env = UnityPy.load('avgbg_assets_bg0001_q_15caadfac7a047db4ea676ea62806d56.bundle')
  File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\site-packages\UnityPy\environment.py", line 63, in __init__
    self.load_file(arg)
  File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\site-packages\UnityPy\environment.py", line 152, in load_file
    f = parse_file(reader, self, name=stream_name, typ=typ, is_dependency=is_dependency)
  File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\site-packages\UnityPy\helpers\ImportHelper.py", line 141, in parse_file
    f = files.BundleFile(reader, parent, name=name, is_dependency=is_dependency)
  File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\site-packages\UnityPy\files\BundleFile.py", line 46, in __init__
    m_DirectoryInfo, blocksReader = self.read_fs(reader)
  File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\site-packages\UnityPy\files\BundleFile.py", line 174, in read_fs
    b"".join(
  File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\site-packages\UnityPy\files\BundleFile.py", line 175, in <genexpr>
    self.decompress_data(
  File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\site-packages\UnityPy\files\BundleFile.py", line 511, in decompress_data
    CompressionHelper.DECOMPRESSION_MAP[comp_flag](compressed_data, uncompressed_size),
  File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\site-packages\UnityPy\helpers\CompressionHelper.py", line 94, in decompress_lz4
    return lz4.block.decompress(data, uncompressed_size)
_block.LZ4BlockError: Decompression failed: corrupt input or insufficient space in destination buffer. Error code: 33627

Bug
Lib should load file, but raises an exception

To Reproduce

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions