From 7203a6c5ba7475bbd5565652ab72c7bdff376462 Mon Sep 17 00:00:00 2001 From: "Queen Vinyl Da.i'gyu-Kazotetsu" Date: Wed, 4 Dec 2024 16:29:57 -0800 Subject: [PATCH] Move setup commands to its own function --- traceKeyExtractor.py | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/traceKeyExtractor.py b/traceKeyExtractor.py index c8e888c..982e566 100644 --- a/traceKeyExtractor.py +++ b/traceKeyExtractor.py @@ -18,10 +18,19 @@ pm3Location = None #Calculated. The location of Proxm pm3Command = "bin/pm3" # The command that works to start proxmark3 mfNonceBruteCommand = "share/proxmark3/tools/mf_nonce_brute" # The command to execute mfNonceBrute - -def main(): +def setup(): global pm3Location,dictionaryFilepath + pm3Location = get_proxmark3_location() + + #Create a dictionary file to store keys that we discover + print(f"Creating dictionary file '{dictionaryFilename}'") + dictionaryFile = open(dictionaryFilename, "w") + dictionaryFile.close() + dictionaryFilepath = os.path.abspath(dictionaryFilename) + print(f"Saved dictionary to {dictionaryFilepath}") + +def main(): print("--------------------------------------------------------") print("RFID Key Extractor v0.2.1 - Bambu Research Group 2024") print("--------------------------------------------------------") @@ -34,14 +43,8 @@ def main(): print("--------------------------------------------------------") print("") - pm3Location = get_proxmark3_location() - - #Create a dictionary file to store keys that we discover - print(f"Creating dictionary file '{dictionaryFilename}'") - dictionaryFile = open(dictionaryFilename, "w") - dictionaryFile.close() - dictionaryFilepath = os.path.abspath(dictionaryFilename) - print(f"Saved dictionary to {dictionaryFilepath}") + # Run setup + setup() if len(sys.argv) > 1: # If the user included an argument, assume it's the path to the tracefile