From 9d61e76b5dbbc4d2ea2e04279e053777268543b9 Mon Sep 17 00:00:00 2001 From: "Queen Vinyl Da.i'gyu-Kazotetsu" Date: Tue, 26 Nov 2024 03:33:02 -0800 Subject: [PATCH] parse.py: Handle dumps from fm11rf08 script --- parse.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/parse.py b/parse.py index 04a90e4..03d5b3c 100644 --- a/parse.py +++ b/parse.py @@ -17,8 +17,8 @@ COMPARISON_BLOCKS = [1, 2, 4, 5, 6, 8, 9, 10, 12, 13, 14] IMPORTANT_BLOCKS = [0] + COMPARISON_BLOCKS BYTES_PER_BLOCK = 16 -BLOCKS_PER_TAG = 64 -TOTAL_BYTES = BLOCKS_PER_TAG * BYTES_PER_BLOCK +BLOCKS_PER_TAG = [64, 72] # 64 = 1KB, 72 = Output from Proxmark fm11rf08 script +TOTAL_BYTES = [blocks * BYTES_PER_BLOCK for blocks in BLOCKS_PER_TAG] # Byte conversions def bytes_to_string(data): @@ -109,8 +109,8 @@ class ColorList(list): class Tag(): def __init__(self, filename, data): - # Check to make sure the data is 1KB - if len(data) != TOTAL_BYTES: + # Check to make sure the data is 1KB or a known alternative + if len(data) not in TOTAL_BYTES: raise TagLengthMismatchError(len(data)) # Store the raw data