Atvaark / BinderTool

Dark Souls II / Dark Souls III / Bloodborne / Elden Ring bdt, bhd, bnd, dcx, tpf, fmg and param unpacking tool
MIT License
310 stars 50 forks source link

Unencrypted save file support #46

Closed gomsoup closed 2 years ago

gomsoup commented 2 years ago

Added support for unencrypted SaveLoad2 format save files like Elden Ring.

For DecryptedUserData in the existing elden-ring branch, it is initialized to null. Through this commit, the constructor of Sl2UserData checks whether the key exists and stores it in the newly added member _encrypted. When DecryptedUserData is called after parsing the sl2 file, the plaintext of the unencrypted file is saved according to the status of the _encrypted member. Or, if it is encrypted, proceed with AES decryption.

I'm sorry I couldn't write better code because I didn't have deep knowledge of C#. If there is a better way, let's discuss it.

Atvaark commented 2 years ago

Looks good to me. Thank your for your contribution.

@googleben would you mind also pulling this into your WIP fork?

googleben commented 2 years ago

Will do.