Code Monkey home page Code Monkey logo

Comments (6)

jleclanche avatar jleclanche commented on June 15, 2024

Can you upload the file you're trying to open?

from unitypack.

vehumet avatar vehumet commented on June 15, 2024

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.

from unitypack.

jleclanche avatar jleclanche commented on June 15, 2024

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.

from unitypack.

robert-nix avatar robert-nix commented on June 15, 2024

This was probably fixed by 11c22bc.

from unitypack.

 avatar commented on June 15, 2024

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

from unitypack.

robert-nix avatar robert-nix commented on June 15, 2024

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)

from unitypack.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.