fm11rf08s script: more robust to tools path
This commit is contained in:
1 parent
3a5f3e94d1
commit
27d5f2dbf2
1 file changed
+13
-1
@@ -13,6 +13,8 @@
|
|||||||
#
|
#
|
||||||
# Doegox, 2024
|
# Doegox, 2024
|
||||||
|
|
||||||
|
import os
|
||||||
|
import sys
|
||||||
import time
|
import time
|
||||||
import subprocess
|
import subprocess
|
||||||
import argparse
|
import argparse
|
||||||
@@ -29,10 +31,20 @@ except ModuleNotFoundError:
|
|||||||
|
|
||||||
BACKDOOR_RF08S = "A396EFA4E24F"
|
BACKDOOR_RF08S = "A396EFA4E24F"
|
||||||
NUM_SECTORS = 16
|
NUM_SECTORS = 16
|
||||||
TOOLS_PATH = "tools/mfc/card_only"
|
if os.path.basename(os.path.dirname(os.path.dirname(sys.argv[0]))) == 'client':
|
||||||
|
# dev setup
|
||||||
|
TOOLS_PATH = f"{os.path.dirname(sys.argv[0])}/../../tools/mfc/card_only"
|
||||||
|
else:
|
||||||
|
# assuming installed
|
||||||
|
TOOLS_PATH = f"{os.path.dirname(sys.argv[0])}/../tools"
|
||||||
|
|
||||||
STATICNESTED_1NT = f"{TOOLS_PATH}/staticnested_1nt"
|
STATICNESTED_1NT = f"{TOOLS_PATH}/staticnested_1nt"
|
||||||
STATICNESTED_2X1NT = f"{TOOLS_PATH}/staticnested_2x1nt_rf08s"
|
STATICNESTED_2X1NT = f"{TOOLS_PATH}/staticnested_2x1nt_rf08s"
|
||||||
STATICNESTED_2X1NT1KEY = f"{TOOLS_PATH}/staticnested_2x1nt_rf08s_1key"
|
STATICNESTED_2X1NT1KEY = f"{TOOLS_PATH}/staticnested_2x1nt_rf08s_1key"
|
||||||
|
for bin in [STATICNESTED_1NT, STATICNESTED_2X1NT, STATICNESTED_2X1NT1KEY]:
|
||||||
|
if not os.path.isfile(bin):
|
||||||
|
print(f"Cannot find {bin}, abort!")
|
||||||
|
exit()
|
||||||
|
|
||||||
parser = argparse.ArgumentParser(description='A script combining staticnested* tools '
|
parser = argparse.ArgumentParser(description='A script combining staticnested* tools '
|
||||||
'to recover all keys from a FM11RF08S card.')
|
'to recover all keys from a FM11RF08S card.')
|
||||||
|
|||||||
Reference in new issue
Block a user