HearthSim / UnityPack

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

OverflowError when unpacking file #24

Closed Triple3T closed 7 years ago

Triple3T commented 7 years ago

I tried python unityextract --images (File Name) but it returned

Traceback (most recent call last):
  File "unityextract", line 146, in <module>
    main()
  File "unityextract", line 143, in main
    exit(app.run())
  File "unityextract", line 56, in run
    self.handle_asset(asset)
  File "unityextract", line 81, in handle_asset
    for id, obj in asset.objects.items():
  File "%userprofile%\AppData\Local\Programs\Python\Python35-32\lib\site-packages\unitypack-0.6.1-py3.5.egg\unitypack\asset.py", line 83, in objects
    self.load()
  File "%userprofile%\AppData\Local\Programs\Python\Python35-32\lib\site-packages\unitypack-0.6.1-py3.5.egg\unitypack\asset.py", line 108, in load
    self.tree.load(buf)
  File "%userprofile%\AppData\Local\Programs\Python\Python35-32\lib\site-packages\unitypack-0.6.1-py3.5.egg\unitypack\type.py", line 132, in load
    tree.load(buf)
  File "%userprofile%\AppData\Local\Programs\Python\Python35-32\lib\site-packages\unitypack-0.6.1-py3.5.egg\unitypack\type.py", line 32, in load
    self.load_blob(buf)
  File "%userprofile%\AppData\Local\Programs\Python\Python35-32\lib\site-packages\unitypack-0.6.1-py3.5.egg\unitypack\type.py", line 54, in load_blob
    node_data = BytesIO(buf.read(24 * num_nodes))
  File "%userprofile%\AppData\Local\Programs\Python\Python35-32\lib\site-packages\unitypack-0.6.1-py3.5.egg\unitypack\utils.py", line 60, in read
    return self.buf.read(*args)
  File "%userprofile%\AppData\Local\Programs\Python\Python35-32\lib\site-packages\unitypack-0.6.1-py3.5.egg\unitypack\assetbundle.py", line 189, in read
    part = self.current_stream.read(size)
OverflowError: Python int too large to convert to C ssize_t

Actually it's not Hearthstone texture, but it's unity resource(UnityFS type, version 5.4.1f1). Is this error caused by big file size? How can I fix this error and get unpacked file?

jleclanche commented 7 years ago

I'll need the file to test it. Can you upload it somewhere?

Triple3T commented 7 years ago

@jleclanche I uploaded the file here: https://drive.google.com/open?id=0B-GoIZl8MLgaNExVc180T19lVEE Its size is 4.37MiB. Is it too big to extract?

robert-nix commented 7 years ago

This was fixed by 11c22bcc.