Fix lf em 410x watch and standalone bug introduced with Electra changes

This commit is contained in:
Philippe Teuwen 2021-08-28 19:10:14 +02:00
parent 9e57d20262
commit 2ce30201b2
2 changed files with 46 additions and 44 deletions

View file

@ -98,7 +98,7 @@ static uint32_t IceEM410xdemod(void) {
int type = Em410xDecode(dest, &size, &idx, &hi, &lo);
// Did we find a Short EM or a Long EM?
if ((type & (0x1 | 0x2)) == 0) {
if ((type < 0) || ((type & (0x1 | 0x2)) == 0)) {
BigBuf_free();
return PM3_ESOFT;
}

View file

@ -1477,6 +1477,7 @@ int lf_em410x_watch(int findone, uint32_t *high, uint64_t *low) {
WDT_HIT();
int type = Em410xDecode(dest, &size, &idx, &hi, &lo);
if (type > 0) {
if (type & 0x1) {
Dbprintf("EM TAG ID: " _GREEN_("%02x%08x") " - ( %05d_%03d_%08d )",
(uint32_t)(lo >> 32),
@ -1517,11 +1518,12 @@ int lf_em410x_watch(int findone, uint32_t *high, uint64_t *low) {
(uint32_t)data);
}
}
if ((type > 0) && findone) {
if (findone) {
*high = hi;
*low = lo;
break;
}
}
hi = lo = size = idx = 0;
clk = invert = 0;
}