-
Notifications
You must be signed in to change notification settings - Fork 31
Description
I was implementing verification for evic-sdk binaries and I found out that the verification in python-evic is not fully compliant with the original updater. This is not some high priority issue, just a heads up.
First, the official updater checks for "Joyetech APROM" as a sequence of bytes (no null terminator required), just like python-evic does. But the string needs to start at least 26 bytes from the end of the file (i.e. there must be at least 25 bytes after the 'J'). The second check, that python-evic also does, is for the device string ("E052" for the eVic VTC Mini). This must start at least 9 bytes from the end of the file.
Immediately after the device string there are three bytes. Let's call them, in order, A, B and C. Those encode the hardware version A.BC (e.g. 01 02 03 -> 1.23). This is the maximum hardware version supported by the firmware and is checked to be greater than or equal to the device hardware version. It makes sense since the display driver defaults to SSD1306, so newer hardware versions with SSD1327 would not work with older firmwares.
In my opinion the at-least-X-bytes-from-end thing is not really important, but the hardware version verification could be nice to have.