This commit is contained in:
iceman1001 2021-04-15 22:58:16 +02:00
commit 34544e238e
4 changed files with 15 additions and 13 deletions

View file

@ -5,10 +5,12 @@ local ansicolors = require('ansicolors')
copyright = ''
author = 'Mosci'
version = 'v1.0.2'
version = 'v1.0.3'
desc =
[[
This is a script which writes value 0x01 to bytes from position 0x07 until 0xFF on a Legic Prime Tag (MIM256 or MIM1024) -- (created with 'hf legic save my_dump.hex') --
This is a script which writes value 0x01 to bytes from
position 0x07 until 0xFF on a Legic Prime Tag (MIM256 or MIM1024)
-- (created with 'hf legic dump -f my_dump.hex') --
]]
example = [[
script run hf_legic_buffer2card
@ -53,7 +55,7 @@ function main()
local cmd = ''
local i
for i = 7, 255 do
cmd = ('hf legic write o %02x d 01'):format(i)
cmd = ('hf legic wrbl -o %02x -d 01'):format(i)
print(cmd)
core.clearCommandBuffer()
core.console(cmd)

View file

@ -3,7 +3,7 @@ local ansicolors = require('ansicolors')
copyright = ''
author = 'Iceman'
version = 'v1.0.2'
version = 'v1.0.3'
desc = [[
This is a script that tries to bring back a chinese magic card (1k generation1)
from the dead when it's block 0 has been written with bad values.
@ -84,7 +84,7 @@ local function cmdRestoreST()
local arr = {}
for i = 0, 15 do
local blk = 3 + (4*i)
arr[i] = 'hf mf csetbl '..blk..' FFFFFFFFFFFFFF078000FFFFFFFFFFFF'
arr[i] = 'hf mf csetbl --blk '..blk..' -d FFFFFFFFFFFFFF078000FFFFFFFFFFFF'
end
return arr
end

View file

@ -13,7 +13,7 @@ local band = bit32.band
copyright = ''
author = "Iceman"
version = 'v1.0.2'
version = 'v1.0.3'
desc = [[
This script will try to make a barebones clone of a tnp3 tag on to a magic generation1 card.
]]
@ -160,7 +160,7 @@ local function main(args)
core.clearCommandBuffer()
-- wipe card.
local cmd = (csetuid..'%s %s %s w'):format(card.uid, atqa, sak)
local cmd = (csetuid..' -u %s -a %s -s %s -w'):format(card.uid, atqa, sak)
core.console(cmd)
core.clearCommandBuffer()
@ -169,7 +169,7 @@ local function main(args)
local calc = utils.Crc16(b0..b1)
local calcEndian = bor(rsh(calc,8), lsh(band(calc, 0xff), 8))
local cmd = (cset..'1 %s%04x'):format( b1, calcEndian)
local cmd = (cset..'--blk 1 -d %s%04x'):format( b1, calcEndian)
core.console(cmd)
core.clearCommandBuffer()
@ -178,14 +178,14 @@ local function main(args)
pos = (math.floor( blockNo / 4 ) * 12)+1
key = akeys:sub(pos, pos + 11 )
if blockNo%4 == 3 then
cmd = ('%s %d %s%s'):format(cset,blockNo,key,AccAndKeyB)
cmd = ('%s --blk %d -d %s%s'):format(cset,blockNo,key,AccAndKeyB)
core.console(cmd)
end
end
core.clearCommandBuffer()
-- Set sector trailer S0, since it has different access rights
cmd = ('%s 3 %s0f0f0f69000000000000'):format(cset, keyA)
cmd = ('%s --blk 3 -d %s0f0f0f69000000000000'):format(cset, keyA)
core.console(cmd)
core.clearCommandBuffer()
end

View file

@ -5,7 +5,7 @@ local ansicolors = require('ansicolors')
copyright = 'Copyright 2020 A. Ozkal, released under GPLv2+.'
author = 'Ave'
version = 'v0.1.1'
version = 'v0.1.2'
desc = [[
This script writes a bunch of random blocks to a Mifare Classic card
]]
@ -70,8 +70,8 @@ function main(args)
do
if ((a + 1) % 4 ~= 0) and a ~= 0 then -- :)
data = randhex(32)
-- core.console('hf mf rdbl '..a..' A FFFFFFFFFFFF')
core.console('hf mf wrbl '..a..' A '..key..' '..data)
-- core.console('hf mf rdbl --blk '..a..' -k FFFFFFFFFFFF')
core.console('hf mf wrbl --blk '..a..' -k '..key..' -d '..data)
end
end
end