gue5t
As far I've seen, there don't exists PNGs without the IHDR-Chunk at the start:
(...) This signature indicates that the remainder of the file contains a single PNG image, consisting of a series of chunks beginning with an IHDR chunk and ending with an IEND chunk.
(...)
A decoder may further verify that the next eight bytes contain an IHDR chunk header with the correct chunk length; this will catch bad transfers that drop or alter null (zero) bytes. (...)
See 3.1:
You must be registered to see the links
Also 12.12.
You must be registered to see the links
(...) A valid PNG image must contain an IHDR chunk, one or more IDAT chunks, and an IEND chunk. (...)
See:
You must be registered to see the links
-------------
So as far I understood the first 16 bytes of all valid PNGs are always the same, if its different it doesn't meet the PNG-Specifications. So if a malformed PNG is thrown in there, the File would be corrupted. But I don't think the game or any other program would show it too, so it wouldn't make sense. Also the new Method can only restore Encrypted .rpgmvp-Files -> PNG-Files, if people have PNGs, they are not meant to be restored anyway (Because they are already PNGs).
RPG-Maker MV only encrypts PNG-Files, so if a Game-Creator would rename a PNG to a JPG, it would be in your folder as original =)
If a JPG was renamed to a PNG some programs can't open it, I'm unsure if even the RPG-Maker engine could handle it (Not tested)... Because it would have the JPG-Header and not a valid PNG-Header, but expecting a PNG~
I could add an optional File-Header verification for to RPG-Maker-MV-Header to the new method (Like in the Decryption). But I would love to keep it optional because the RPG-Maker-MV-File-Header isn't needed for anything than detecting that it is an RPGMMV-Encrypted-File
I hope these information help a little. If something is wrong or other people know more about feel free to correct me or add the missing informations
PS: When rewriting the Java-Tool, I will add more checks (Because it messes with files directly), but in the Web-Version I think there are enough checks/barriers to avoid choosing the wrong files. Usually its bad to rely on HTML-Restrictions, but the whole Web-Version runs client-side, so I can also only use client-side checks (such as limiting File-Input-File-Types)
But when there are ideas suggestion what to implement/check, please let me know~