pub fn decrypt_in_place(
file_content: &mut [u8],
file_type: FileType,
) -> Result<(), Error>Expand description
Decrypts RPG Maker file content in-place using a temporary Decrypter instance.
This is a convenience wrapper around Decrypter::decrypt_in_place.
A new Decrypter is created internally, and the decryption key is
auto-determined from the provided file data.
This function modifies the provided buffer directly. After successful decryption, the decrypted data is valid starting at offset 16.
If you do not want to modify data in-place, use decrypt instead.
§Arguments
file_content- The data of RPG Maker file.file_type-FileType, representing whether passed file content is PNG, OGG or M4A.
§Returns
- [
Error] if the passed data has an invalid header or ends unexpectedly. - Nothing otherwise.
§Errors
Error::InvalidHeader– if the providedfile_contentdoes not start with the RPG Maker header.Error::UnexpectedEOF– if the data ends unexpectedly.