mknkboot/beastpatcher: implement basic firmware validation

This imports the MD5 code used by other utilities and creates
a function for checking the provided NK.bin against known original
firmware checksums. Integration into mknkboot and beastpatcher is
also added.

For the sake of consistency with beastpatcher, mknkboot had its
printf statements rewrote to print to stderr like beastpatcher
does.

Change-Id: I0e52271d8d627a5b02302ab5cd1da2815b7cec1e
This commit is contained in:
James Buren 2021-06-12 06:25:25 +00:00
parent fe9bcd0468
commit a90ef8195b
6 changed files with 329 additions and 14 deletions

View file

@ -43,6 +43,7 @@ struct filebuf {
unsigned char* buf;
};
int verifyfirm(const struct filebuf* firmdata);
int mknkboot(const struct filebuf *indata, const struct filebuf *bootdata,
struct filebuf *outdata);
#endif