mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-04-24 03:29:57 -07:00
Upd MFC keys: added 41 from RRG pm3
This commit is contained in:
@@ -2,8 +2,8 @@ import pathlib
|
||||
import string
|
||||
|
||||
file = (
|
||||
pathlib.Path(__file__)
|
||||
/ "../../applications/main/nfc/resources/nfc/assets/mf_classic_dict.nfc"
|
||||
pathlib.Path(__file__).parent
|
||||
/ "../applications/main/nfc/resources/nfc/assets/mf_classic_dict.nfc"
|
||||
)
|
||||
try:
|
||||
lines = file.read_text(encoding="ascii").splitlines()
|
||||
@@ -14,13 +14,16 @@ except UnicodeDecodeError:
|
||||
exit()
|
||||
|
||||
for i, line in enumerate(lines):
|
||||
lines[i] = line = line.strip()
|
||||
if line.startswith("#"):
|
||||
continue
|
||||
lines[i] = line = line.upper()
|
||||
if not line:
|
||||
continue
|
||||
if len(line) != 12 or any(char not in string.hexdigits for char in line):
|
||||
print(f"line {i} is not correct: {line}")
|
||||
print(f"line {i + 1} is not correct: {line}")
|
||||
for j in reversed(range(i + 1, len(lines))):
|
||||
if lines[j].upper() == line:
|
||||
if lines[j].upper().strip() == line:
|
||||
del lines[j]
|
||||
|
||||
file.write_text("\n".join(lines))
|
||||
file.write_text("\n".join(line for line in lines if line.removeprefix("#")))
|
||||
|
||||
Reference in New Issue
Block a user