K0lb3 / UnityPy

UnityPy is python module that makes it possible to extract/unpack and edit Unity assets

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

extract_assets() in extractor.py gives 'str' object has no attribute 'type'

Numendacil opened this issue · comments

Code
A snippet of the code section that cases the bug or error.

extractor.py

Error
The error message that is produced by python.

'str' object has no attribute 'type'

Bug
A description of what you expect to happen/see and what actually happens.

Call sorted on the dict only returns the key, to obtain the key value pairs i think .items() should be added

container = sorted(env.container.items(), key=lambda x: defaulted_export_index(x[1].type))

To Reproduce

  • a copy of the file that causes the problem
  • following data:
    • Python version 3.9
    • UnityPy version 1.9.16
from UnityPy.tools.extractor import extract_assets

extract_assets(src='/path/to/src', dst='/path/to/dst', use_container=True)

Sorry for the late response,
but it's fixed now.