From d6b0e0d33143a4a687cf24d9eedd157d1b6948c6 Mon Sep 17 00:00:00 2001 From: "Queen Vinyl Da.i'gyu-Kazotetsu" Date: Wed, 4 Dec 2024 16:26:00 -0800 Subject: [PATCH] Allow specifying trace path as command line argument --- traceKeyExtractor.py | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/traceKeyExtractor.py b/traceKeyExtractor.py index e46b522..5e037af 100644 --- a/traceKeyExtractor.py +++ b/traceKeyExtractor.py @@ -44,17 +44,21 @@ def main(): dictionaryFilepath = os.path.abspath(dictionaryFilename) print(f"Saved dictionary to {dictionaryFilepath}") - #Instruct the user to create a trace file - print() - print("Start by creating a trace file. In the proxmark terminal, execute command `hf 14a sniff -c -r`.") - print("Then, place the Proxmark3 between the RFID reader and spool.") - print("Load in filament and wait for the process to complete, then press the button on the Proxmark3.") - print("Finally, in the proxmark terminal, execute command `trace save -f [FILEPATH]` to create the trace file.") - print("See the GitHub repository for more details.") - print() + if len(sys.argv) > 1: + # If the user included an argument, assume it's the path to the tracefile + trace = os.path.abspath(sys.argv[1]) + else: + #Instruct the user to create a trace file + print() + print("Start by creating a trace file. In the proxmark terminal, execute command `hf 14a sniff -c -r`.") + print("Then, place the Proxmark3 between the RFID reader and spool.") + print("Load in filament and wait for the process to complete, then press the button on the Proxmark3.") + print("Finally, in the proxmark terminal, execute command `trace save -f [FILEPATH]` to create the trace file.") + print("See the GitHub repository for more details.") + print() - #Get the tracename/filepath from user - trace = input("Enter trace name or full trace filepath: ") + #Get the tracename/filepath from user + trace = input("Enter trace name or full trace filepath: ") discoverKeys()