mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-21 05:43:48 -07:00
hf_mf_ultimatecard: '-w 0' now formats whole Mifare classic 4k
This commit is contained in:
parent
9a0427d4d2
commit
c54db094cd
1 changed files with 86 additions and 72 deletions
|
@ -228,7 +228,6 @@ local function read_config()
|
|||
if ulmode == '03' then versionstr = 'Ultralight'
|
||||
elseif ulmode == '02' then versionstr = 'Ultralight-C'
|
||||
elseif cversion == '0004030101000B03' then versionstr = 'UL EV1 48b'
|
||||
elseif cversion == '0004030101000B03' then versionstr = 'UL EV1 48b'
|
||||
elseif cversion == '0004030101000E03' then versionstr = 'UL EV1 128b'
|
||||
elseif cversion == '0004040101000B03' then versionstr = 'NTAG 210'
|
||||
elseif cversion == '0004040101000E03' then versionstr = 'NTAG 212'
|
||||
|
@ -845,6 +844,21 @@ local function set_type(tagtype)
|
|||
end
|
||||
end
|
||||
---
|
||||
-- returns true if b is the index of a sector trailer
|
||||
local function mfIsSectorTrailer(b)
|
||||
n=b+1
|
||||
if (n < 32*4 ) then
|
||||
if (n % 4 == 0) then return true
|
||||
else return false
|
||||
end
|
||||
end
|
||||
|
||||
if (n % 16 == 0) then return true
|
||||
end
|
||||
|
||||
return false
|
||||
end
|
||||
---
|
||||
-- wipe tag
|
||||
local function wipe(wtype)
|
||||
local info = connect()
|
||||
|
@ -855,10 +869,10 @@ local function wipe(wtype)
|
|||
send("CF".._key.."CD000102030404080400000000000000BEAF")
|
||||
local err, msg, resp
|
||||
local cmd_empty = 'CF'.._key..'CD%02X00000000000000000000000000000000'
|
||||
local cmd_cfg1 = 'CF'.._key..'CD%02XFFFFFFFFFFFFFF078069FFFFFFFFFFFF'
|
||||
for b = 1, 0xFB do
|
||||
if b == 0x03 or b == 0x07 or b == 0x0B or b == 0x0F or b == 0x13 or b == 0x17 or b == 0x1B or b == 0x1F or b == 0x23 or b == 0x27 or b == 0x2B or b == 0x2F or b == 0x33 or b == 0x37 or b == 0x3B or b == 0x3F then
|
||||
local cmd = (cmd_cfg1):format(b)
|
||||
local cmd_trail = 'CF'.._key..'CD%02XFFFFFFFFFFFFFF078069FFFFFFFFFFFF'
|
||||
for b = 1, 0xFF do
|
||||
if mfIsSectorTrailer(b) then
|
||||
local cmd = (cmd_trail):format(b)
|
||||
resp = send(cmd)
|
||||
else
|
||||
local cmd = (cmd_empty):format(b)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue