Quote:
Originally Posted by pdurrant
Now, the problem I'm having is that I can't find a way to determine if these multibyte flags are present in a Mobipocket file or not.
|
That wasn't my problem. My problem was that I didn't understand that although trailing data entries and multibyes do not get compressed, the trailing multibytes in a utf8 encoded file
do get encrypted (although the other trailing data entries do not). So it's vital not to remove the count of trailing multibytes before trying to decrypt the file.
So it seems the test for whether the trailing data flags is valid is actually quote simple - version 5 or greater, and header length 0xE4 or greater. Although since I've never seen a version 5 Mobipocket file with a header length less than 0xE4, the latter condition might be redundant.
I've updated the wiki to clarify the situation for anyone else fool enough to poke about in Mobipocket file innards.