Add a fingerprint of the ARM OS source files to detect when a client expects another ARM image

This commit is contained in:
Philippe Teuwen committed 2022-02-17 01:43:39 +01:00
1 parent d0526d3ba9
commit bbf49ab560
5 files changed
+21 -1

No files matched your search

+10
View File
@@ -1073,6 +1073,16 @@ void pm3_version(bool verbose, bool oneliner) {
struct p *payload = (struct p *)&resp.data.asBytes;
PrintAndLogEx(NORMAL, payload->versionstr);
char *ptr = strstr(payload->versionstr, " os: ");
if (ptr != NULL) {
ptr = strstr(ptr, "\n");
if (ptr != NULL) {
if (strncmp(ptr-9, g_version_information.armsrc, 9) != 0) {
PrintAndLogEx(NORMAL, "\n:warning: " _RED_("ARM os does not match the source at the time the client was compiled") " :warning:");
PrintAndLogEx(NORMAL, "Make sure to flash a correct and up-to-date version");
}
}
}
if (strstr(payload->versionstr, "2s30vq100") == NULL) {
PrintAndLogEx(NORMAL, " FPGA firmware... %s", _RED_("chip mismatch"));
}