Improve output checks in mf_backdoor_dump.py

Signed-off-by: Robert Wittek <18316389+robo-w@users.noreply.github.com>
This commit is contained in:
Robert Wittek authored and GitHub committed 2025-09-01 16:35:31 +02:00
1 parent 66dd75e1f1
commit 2bf7abbdfc
1 file changed
+6 -6
+6 -6
View File
@@ -22,18 +22,18 @@ for bk, sz in BACKDOOR_KEYS:
p.console(f"hf mf ecfill --{sz} -c 4 -k {bk}") p.console(f"hf mf ecfill --{sz} -c 4 -k {bk}")
output = p.grabbed_output.split('\n') output = p.grabbed_output.split('\n')
if "[#] Card not found" in output: if any("Card not found" in output_line for output_line in output):
print("Error reading the tag:") print("Error reading the tag:")
print("\n".join(output)) print("\n".join(output))
break break
elif "[-] Fill ( fail )" in output: elif any("Fill ( fail )" in output_line for output_line in output):
continue continue
elif "[+] Fill ( ok )" not in output: elif any("Fill ( ok )" in output_line for output_line in output):
print("Unexpected output, exiting:") WORKING_KEY = bk
print("\n".join(output))
break break
else: else:
WORKING_KEY = bk print("Unexpected output, exiting:")
print("\n".join(output))
break break
if WORKING_KEY is None: if WORKING_KEY is None: