Closed zhangbo closed 7 years ago
Can you upload the file you're trying to open?
I'm not familiar to python syntax (such as * notation), so I'm just pasting my quick fix of this problem. I refered this url: http://stackoverflow.com/questions/5773607/python-what-is-the-most-efficient-way-to-generate-padding
In utils.py,
def read(self, *args):
return self.buf.read(*args)
to this:
def read(self, args):
readResult = self.buf.read(args)
if (len(readResult) < args):
readResult = readResult .ljust(args, b'\0')
return readResult
I omitted * of args
for just make it run with least effort ;). Sorry for that.
Sorry for not uploading problematic asset file, for it's confidential one.
Thank you.
That will prevent the crash but it won't actually help reading. All it's doing is feeding in garbage instead of feeding in nothing.
This was probably fixed by 11c22bc.
Sadly, error still occur:
unityextract.py --all -o D:\TUM\UnityPack globalgamemanagers.assets
output:
Traceback (most recent call last):
File "%USERPROFILE%\AppData\Local\Programs\Python\Python36-32\Scripts\unityextract.py", line 153, in <module>
main()
File "%USERPROFILE%\AppData\Local\Programs\Python\Python36-32\Scripts\unityextract.py", line 149, in main
exit(app.run())
File "%USERPROFILE%\AppData\Local\Programs\Python\Python36-32\Scripts\unityextract.py", line 49, in run
self.handle_asset(asset)
File "%USERPROFILE%\AppData\Local\Programs\Python\Python36-32\Scripts\unityextract.py", line 91, in handle_asset
d = obj.read()
File "%USERPROFILE%\appdata\local\programs\python\python36-32\lib\site-packages\unitypack\object.py", line 74, in read
return self.read_value(self.type_tree, buf)
File "%USERPROFILE%\appdata\local\programs\python\python36-32\lib\site-packages\unitypack\object.py", line 132, in read_value
result[child.name] = self.read_value(child, buf)
File "%USERPROFILE%\appdata\local\programs\python\python36-32\lib\site-packages\unitypack\object.py", line 100, in read_value
size = buf.read_uint()
File "%USERPROFILE%\appdata\local\programs\python\python36-32\lib\site-packages\unitypack\utils.py", line 105, in read_uint
return struct.unpack(self.endian + "I", self.read(4))[0]
struct.error: unpack requires a bytes object of length 4
Unity version: 5.4.0f3 Assets file in attachment: globalgamemanagers.zip
Your version of unitypack appears to be out of date; for example, this is the current object.py at line 132, whereas the traceback states result[child.name] = self.read_value(child, buf)
command: unityextract --all -o . sharedassets0.assets
When I install unityPack with './setup.py install', I got this : command line : unityextract --all -o . resources.assets