mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-19 21:03:48 -07:00
Add mfc signature support to gen4 lua script
This commit is contained in:
parent
93d7d46776
commit
b05a2d4525
1 changed files with 23 additions and 11 deletions
|
@ -483,8 +483,19 @@ local function write_signature(data)
|
||||||
end
|
end
|
||||||
local info = connect()
|
local info = connect()
|
||||||
if not info then return false, "Can't select card" end
|
if not info then return false, "Can't select card" end
|
||||||
if ulprotocol == '00' then return nil, 'Magic Card is not using the Ultralight Protocol' end
|
if ulprotocol == '00' then
|
||||||
print('Writing new signature',data)
|
print('Writing new MFC signature',data)
|
||||||
|
send('CF'.._key..'6B48')
|
||||||
|
lib14a.disconnect()
|
||||||
|
connect() -- not 100% sure why it's needed, but without this blocks aren't actually written
|
||||||
|
local sig1 = data:sub(1, 32)
|
||||||
|
local sig2 = data:sub(33, 64)
|
||||||
|
|
||||||
|
send('CF'.._key..'CD45'..sig1)
|
||||||
|
send('CF'.._key..'CD46'..sig2)
|
||||||
|
send('CF'.._key..'CD475C8FF9990DA270F0F8694B791BEA7BCC')
|
||||||
|
else
|
||||||
|
print('Writing new MFUL signature',data)
|
||||||
local b,c
|
local b,c
|
||||||
local cmd = 'A2F%d%s'
|
local cmd = 'A2F%d%s'
|
||||||
local j = 2
|
local j = 2
|
||||||
|
@ -495,6 +506,7 @@ local function write_signature(data)
|
||||||
if resp ~= '0A' then lib14a.disconnect(); return nil, oops('Failed to write signature') end
|
if resp ~= '0A' then lib14a.disconnect(); return nil, oops('Failed to write signature') end
|
||||||
j = j + 1
|
j = j + 1
|
||||||
end
|
end
|
||||||
|
end
|
||||||
lib14a.disconnect()
|
lib14a.disconnect()
|
||||||
return true, 'Ok'
|
return true, 'Ok'
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue