mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-01-11 10:38:39 +08:00
Merge pull request #1925 from augustozanellato/gen4_lua_mfc_signature
Add mfc signature support to gen4 lua script
This commit is contained in:
commit
558129c3fd
2 changed files with 25 additions and 12 deletions
|
@ -22,6 +22,7 @@ This project uses the changelog in accordance with [keepchangelog](http://keepac
|
|||
- Changed `hf iclass decrypt` - mark credentials as decrypted in the dump (@natesales)
|
||||
- Changed `hf iclass view` - show credentials on a decrypted dump (@natesales)
|
||||
- Show NTAG213TT tamper info in `hf mfu info` and add commands for configuring it's tamper feature (@mjaksn)
|
||||
- Add Mifare Classic EV1 signature write support to gen4 magic tag lua script (@augustozanellato)
|
||||
|
||||
## [Nitride.4.16191][2023-01-29]
|
||||
- Changed `build_all_firmwares.sh` to fit GENERIC 256kb firmware images (@doegox)
|
||||
|
|
|
@ -13,7 +13,7 @@ local err_lock = 'use -k or change cfg0 block'
|
|||
local _print = 0
|
||||
copyright = ''
|
||||
author = 'Nathan Glaser'
|
||||
version = 'v1.0.4'
|
||||
version = 'v1.0.5'
|
||||
date = 'Created - Jan 2022'
|
||||
desc = 'This script enables easy programming of an Ultimate Mifare Magic card'
|
||||
example = [[
|
||||
|
@ -483,17 +483,29 @@ local function write_signature(data)
|
|||
end
|
||||
local info = connect()
|
||||
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
|
||||
print('Writing new signature',data)
|
||||
local b,c
|
||||
local cmd = 'A2F%d%s'
|
||||
local j = 2
|
||||
for i = 1, #data, 8 do
|
||||
b = data:sub(i,i+7)
|
||||
c = cmd:format(j,b)
|
||||
local resp = send(c)
|
||||
if resp ~= '0A' then lib14a.disconnect(); return nil, oops('Failed to write signature') end
|
||||
j = j + 1
|
||||
if ulprotocol == '00' then
|
||||
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 cmd = 'A2F%d%s'
|
||||
local j = 2
|
||||
for i = 1, #data, 8 do
|
||||
b = data:sub(i,i+7)
|
||||
c = cmd:format(j,b)
|
||||
local resp = send(c)
|
||||
if resp ~= '0A' then lib14a.disconnect(); return nil, oops('Failed to write signature') end
|
||||
j = j + 1
|
||||
end
|
||||
end
|
||||
lib14a.disconnect()
|
||||
return true, 'Ok'
|
||||
|
|
Loading…
Reference in a new issue