K0lb3 / UnityPy

UnityPy is python module that makes it possible to extract/unpack and edit Unity assets
MIT License
771 stars 114 forks source link

Some data structures cause crashes when trying to read the GameObject. #169

Closed ablegao closed 1 year ago

ablegao commented 1 year ago

Code

def ExportGameObject(self, item: GameObject):
        # data01 = item.read()
        # print(json.dumps(data01,indent=4))
        try:
            data = GameObject(item).read()
            out = {
                "m_Name": data.name,
                "m_IsActive": data.m_IsActive,
            }
            return out
        except Exception as e:
            print(e)
            return {}

Error

    sitionHandling - _ISSetPhysicalKeyboardCapsLockLED Inhibit
    /opt/concourse/worker/volumes/live/c1a1a6ef-e724-4ad9-52a7-d6d68451dacb/volume/python-split_1631807121927/work/Objects/listobject.c:138: bad argument to internal function
    /opt/concourse/worker/volumes/live/c1a1a6ef-e724-4ad9-52a7-d6d68451dacb/volume/python-split_1631807121927/work/Objects/listobject.c:138: bad argument to internal function
    /opt/concourse/worker/volumes/live/c1a1a6ef-e724-4ad9-52a7-d6d68451dacb/volume/python-split_1631807121927/work/Objects/listobject.c:138: bad argument to internal function
    /opt/concourse/worker/volumes/live/c1a1a6ef-e724-4ad9-52a7-d6d68451dacb/volume/python-split_1631807121927/work/Objects/listobject.c:138: bad argument to internal function

Bug

I forget when it started, but there's an error that occurs when trying to access the GameObject structure.In the past, I would ignore some unimportant details, but now the scope of its crashes is getting larger and larger. Is there anything I can help you with, even though I don't know where to start?

To Reproduce