mirror of
https://github.com/flipperdevices/flipperzero-firmware.git
synced 2025-12-12 12:51:22 +04:00
NFC TRT Parser: Additional checks to prevent false positives (#3966)
* additional checks to prevent false positives * Update trt.c Co-authored-by: あく <alleteam@gmail.com>
This commit is contained in:
@@ -40,7 +40,10 @@ static bool trt_parse(const NfcDevice* device, FuriString* parsed_data) {
|
|||||||
const uint8_t* full_record_pointer = &data->page[FULL_SALE_TIME_STAMP_PAGE].data[0];
|
const uint8_t* full_record_pointer = &data->page[FULL_SALE_TIME_STAMP_PAGE].data[0];
|
||||||
uint32_t latest_sale_record = bit_lib_get_bits_32(partial_record_pointer, 3, 20);
|
uint32_t latest_sale_record = bit_lib_get_bits_32(partial_record_pointer, 3, 20);
|
||||||
uint32_t latest_sale_full_record = bit_lib_get_bits_32(full_record_pointer, 0, 27);
|
uint32_t latest_sale_full_record = bit_lib_get_bits_32(full_record_pointer, 0, 27);
|
||||||
if(latest_sale_record != (latest_sale_full_record & 0xFFFFF)) break;
|
if(latest_sale_record != (latest_sale_full_record & 0xFFFFF))
|
||||||
|
break; // check if the copy matches
|
||||||
|
if((latest_sale_record == 0) || (latest_sale_full_record == 0))
|
||||||
|
break; // prevent false positive
|
||||||
|
|
||||||
// Parse date
|
// Parse date
|
||||||
// yyy yyyymmmm dddddhhh hhnnnnnn
|
// yyy yyyymmmm dddddhhh hhnnnnnn
|
||||||
|
|||||||
Reference in New Issue
Block a user