K0lb3 / UnityPy

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

BundleFile: fix exception on file.save("original") #178

Closed astiob closed 1 year ago

astiob commented 1 year ago

Regression in commit https://github.com/K0lb3/UnityPy/commit/9232cdd57e93f140b2d7431905baff40e05488bc (release 1.9.21), which renamed _data_flags to dataflags.

astiob commented 1 year ago

On a slightly related note (I’d open a separate GitHub issue, but it isn’t exactly a bug), save_fs should maybe throw if the data_flags argument includes the encryption flag, because (as far as I can tell) UnityPy doesn’t implement encryption upon saving. But this isn’t entirely trivial to implement because the argument may be passed as a raw integer, so you’d need to duplicate the version-dependent logic from read_fs just to figure out what the integer means.

K0lb3 commented 1 year ago

Thanks for noticing and fixing the issue. And you're right, it should error in case it's supposed to store an encrypted bundle.