python script: add --fast

This commit is contained in:
Philippe Teuwen 2024-11-07 21:42:04 +01:00
commit 7be2a671c8

View file

@ -158,7 +158,7 @@ globals:
# FIXME: nr of blocks depend on the tag. RF32 is 256, RF08 is 64, RF08S is 64+8
# Currently readBlocks is hardcoded for RF08S
data, blkn = readBlocks(bdkey)
data, blkn = readBlocks(bdkey, args.fast)
data = patchKeys(data, key)
dump18 = diskDump(data, uid, dpath) # save it before you do anything else
@ -211,6 +211,7 @@ def parseCli():
parser.add_argument('-f', '--force', action='store_true', help='force recovery of keys')
parser.add_argument('-b', '--bambu', action='store_true', help='force Bambu tag decode')
parser.add_argument('-v', '--validate', action='store_true', help='check Fudan signature (requires internet)')
parser.add_argument('--fast', action='store_true', help='use ecfill for faster card transactions')
args = parser.parse_args()
@ -481,7 +482,7 @@ globals:
return rv
def readBlocks(bdkey):
def readBlocks(bdkey, fast=False):
"""
Read all block data - INCLUDING advanced verification blocks
@ -497,8 +498,9 @@ globals:
lprint("\n Load blocks {0..63, 128..135}[64+8=72] from the card")
# Try fast dump first
blkn_todo = blkn
if fast:
# Try fast dump first
# The user uses keyhole #0 (-a)
# The vendor uses keyhole #1 (-b)
# The thief uses keyhole #4 (backdoor)