Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
0x07E5 opened this issue May 30, 2024 · 1 comment
Open

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

0x07E5 opened this issue May 30, 2024 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@0x07E5
Copy link
Contributor

0x07E5 commented May 30, 2024

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

  • a copy of the file that causes the problem
    examples.zip
    Inside the package:

    • example-android.unity3d Android sample, AssetStudio can load.
    • example-ios.unity3d iOS sample, AssetStudio can load.
    • example-android-2.unity3d Android sample, AssetStudio can't load as well, idk why. This is not an isolated case, and I have a lot samples. I confirmed they are not encrypted.
  • following data:

    • Python version 3.10.1
    • UnityPy version 1.10.13
@0x07E5 0x07E5 added the bug Something isn't working label May 30, 2024
0x07E5 added a commit to 0x07E5/UnityPy that referenced this issue Jul 20, 2024
K0lb3 added a commit that referenced this issue Sep 4, 2024
* CompressionHelper - lzma - add option to read/save length and use better params for compression
* BundleFile - web - decompress lzma with decompressed size
* CompresseionHelper - lzma - use the size of the compressed_data for the struct string formating



closes #250
closes #253
solves #237
@K0lb3
Copy link
Owner

K0lb3 commented Sep 17, 2024

UnityPy can load the same files as AssetStudio for the given samples.
Some of the samples can't be loaded by either, which still has to be investigated.

Either these not working samples are corrupted, or the loader still has to be adjusted.

@K0lb3 K0lb3 self-assigned this Sep 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants