+function nested(key,sak)
+ local typ = 1
+ if 0x18 == sak then --NXP MIFARE Classic 4k | Plus 4k
+ typ = 4
+ elseif 0x08 == sak then -- NXP MIFARE CLASSIC 1k | Plus 2k
+ typ= 1
+ elseif 0x09 == sak then -- NXP MIFARE Mini 0.3k
+ typ = 0
+ elseif 0x10 == sak then-- "NXP MIFARE Plus 2k"
+ typ = 2
+ elseif 0x01 == sak then-- "NXP MIFARE TNP3xxx 1K"
+ typ = 1
+ else
+ print("I don't know how many sectors there are on this type of card, defaulting to 16")
+ end
+ local cmd = string.format("hf mf nested %d 0 A %s d",typ,key)