From 86370592aff4b425502640599fa085b8d23b5c2c Mon Sep 17 00:00:00 2001 From: "Queen Vinyl Da.i'gyu-Kazotetsu" Date: Wed, 18 Jun 2025 00:09:38 -0700 Subject: [PATCH] Update parse.py to accept JSON dumps --- parse.py | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/parse.py b/parse.py index 02902d9..b0cd5bd 100644 --- a/parse.py +++ b/parse.py @@ -6,6 +6,7 @@ import sys import re +import json from pathlib import Path from .lib import bytes_to_string, bytes_to_hex, bytes_to_int, bytes_to_float, bytes_to_date @@ -99,10 +100,20 @@ class ColorList(list): class Tag(): def __init__(self, filename, data): - # Check to make sure the data is 1KB or a known alternative + # Proxmark3 JSON dump + try: + json_data = json.loads(data) + if json_data.get("Created") == "proxmark3": + data = b"".join([bytes.fromhex(json_data["blocks"][key].replace("??", "00")) for key in json_data["blocks"]]) + except ValueError: + # We know that the data isn't JSON now + pass + + # Flipper NFC dump if data.startswith(b"Filetype: Flipper NFC"): - # Flipper NFC dump data = strip_flipper_data(data) + + # Check to make sure the data is 1KB or a known alternative if len(data) not in TOTAL_BYTES: raise TagLengthMismatchError(len(data))