From 27fee070908f35659f799110636b841016a42f1d Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Thu, 7 Nov 2024 21:34:35 +0100 Subject: [PATCH] style --- client/pyscripts/findbits.py | 2 +- client/pyscripts/spi_flash_decode.py | 7 +++++++ client/pyscripts/theremin.py | 3 +-- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/client/pyscripts/findbits.py b/client/pyscripts/findbits.py index 809465a2e..4cc3b92d9 100755 --- a/client/pyscripts/findbits.py +++ b/client/pyscripts/findbits.py @@ -31,7 +31,7 @@ def invert(data): def search(target,data): location = data.find(target) if location >= 0: - print('*** Match at bit {:d}: {}<{}>{}'.format(location, data[:location],target,data[location+len(target):])) + print('*** Match at bit {:d}: {}<{}>{}'.format(location, data[:location], target,data[location + len(target):])) else: print('Not found') diff --git a/client/pyscripts/spi_flash_decode.py b/client/pyscripts/spi_flash_decode.py index 8faa795ba..0f125844b 100644 --- a/client/pyscripts/spi_flash_decode.py +++ b/client/pyscripts/spi_flash_decode.py @@ -78,20 +78,27 @@ p = pm3.pm3() p.console("hw status") rex = re.compile("...\\s([0-9a-fA-F]{2})\\s/\\s([0-9a-fA-F]{4})") + for line in p.grabbed_output.split('\n'): # [#] JEDEC Mfr ID / Dev ID... 85 / 6015 if " JEDEC " not in line: continue + match = re.findall(rex, line) mid = int(match[0][0], 16) did = int(match[0][1], 16) did_h = did >> 8 did_l = did & 0xff t = None + if mid in spi: + mfr = spi[mid]['manufacturer'] + if did_h in spi[mid]: + if did_l in spi[mid][did_h]: + t = spi[mid][did_h][did_l] print("\n Manufacturer... " + color(f"{mfr}", fg="green") + "\n Device......... " + color(f"{t['part']}", fg="green") + diff --git a/client/pyscripts/theremin.py b/client/pyscripts/theremin.py index a286d6193..790fc6bf8 100755 --- a/client/pyscripts/theremin.py +++ b/client/pyscripts/theremin.py @@ -39,8 +39,7 @@ v = 0 out_freq = min_freq # Spawn the Proxmark3 client -pm3_proc = Popen([pm3_client, pm3_reader_dev_file, "-c", pm3_tune_cmd], - bufsize=0, env={}, stdin=DEVNULL, stdout=PIPE, stderr=DEVNULL) +pm3_proc = Popen([pm3_client, pm3_reader_dev_file, "-c", pm3_tune_cmd], bufsize=0, env={}, stdin=DEVNULL, stdout=PIPE, stderr=DEVNULL) mv_recbuf = "" # Read voltages from the Proxmark3, generate the sine wave, output to soundcard