mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-19 21:03:48 -07:00
chg: luascripts now uses t55xx write NG frame format
This commit is contained in:
parent
26f2fbfdbd
commit
6a6902e57d
5 changed files with 41 additions and 40 deletions
|
@ -39,7 +39,8 @@ Arguments:
|
|||
-h this help
|
||||
]]
|
||||
|
||||
local DEBUG = false -- the debug flag
|
||||
local DEBUG = true -- the debug flag
|
||||
local TIMEOUT = 1500
|
||||
local total_tests = 0
|
||||
local total_pass = 0
|
||||
|
||||
|
@ -237,7 +238,9 @@ local function test(modulation)
|
|||
|
||||
local process_block0_cmds = {}
|
||||
local y
|
||||
local block = '00'
|
||||
local password = '00000000'
|
||||
local block = '00' -- configuration block 0
|
||||
local flags = '00' -- page 0, no pwd, no testmode
|
||||
|
||||
local s = ('Start test of %s'):format(modulation)
|
||||
print(s)
|
||||
|
@ -251,16 +254,14 @@ local function test(modulation)
|
|||
local p_config_cmd = process_block0_cmds[_]
|
||||
local errors = 0
|
||||
core.clearCommandBuffer()
|
||||
|
||||
|
||||
-- Write Config block
|
||||
dbg(('lf t55xx write b 0 d %s'):format(p_config_cmd))
|
||||
local config = tonumber(p_config_cmd, 16)
|
||||
local wc = Command:newMIX{
|
||||
cmd = cmds.CMD_T55XX_WRITE_BLOCK
|
||||
, arg1 = config
|
||||
, arg2 = block
|
||||
}
|
||||
local response, err = wc:sendMIX(false)
|
||||
|
||||
local data = ('%s%s%s%s'):format(utils.SwapEndiannessStr(p_config_cmd, 32), password, block, flags)
|
||||
|
||||
local wc = Command:newNG{cmd = cmds.CMD_T55XX_WRITE_BLOCK, data = data}
|
||||
local response, err = wc:sendNG(false, TIMEOUT)
|
||||
if not response then return oops(err) end
|
||||
|
||||
-- Detect
|
||||
|
@ -309,7 +310,7 @@ local function main(args)
|
|||
|
||||
-- Adjust this table to set which configurations should be tested
|
||||
-- local test_modes = { 'PSK1', 'PSK2', 'PSK3', 'FSK1', 'FSK2', 'FSK1A', 'FSK2A', 'ASK', 'BI' }
|
||||
local test_modes = { 'ASK', 'PSK1' }
|
||||
local test_modes = { 'ASK' }
|
||||
|
||||
for _ = 1, #test_modes do
|
||||
res = WipeCard()
|
||||
|
|
|
@ -48,6 +48,7 @@ Arguments:
|
|||
]]
|
||||
|
||||
local DEBUG = true -- the debug flag
|
||||
local TIMEOUT = 1500
|
||||
|
||||
--BLOCK 0 = 00008040 ASK / MAN
|
||||
local config1 = '00'
|
||||
|
@ -101,7 +102,9 @@ end
|
|||
|
||||
local function test()
|
||||
local y
|
||||
local password = '00000000'
|
||||
local block = '00'
|
||||
local flags = '00'
|
||||
for y = 0x0, 0x1d, 0x4 do
|
||||
for _ = 1, #procedurecmds do
|
||||
local pcmd = procedurecmds[_]
|
||||
|
@ -111,14 +114,11 @@ local function test()
|
|||
elseif _ == 1 then
|
||||
|
||||
local config = pcmd:format(config1, y, config2)
|
||||
dbg(('lf t55xx write b 0 d %s'):format(config))
|
||||
config = tonumber(config, 16)
|
||||
local wc = Command:newMIX{
|
||||
cmd = cmds.CMD_T55XX_WRITE_BLOCK
|
||||
, arg1 = config
|
||||
, arg2 = block
|
||||
}
|
||||
local response, err = wc:sendMIX(false)
|
||||
dbg(('lf t55xx write b 0 d %s'):format(config))
|
||||
local data = ('%s%s%s%s'):format(utils.SwapEndiannessStr(config, 32), password, block, flags)
|
||||
|
||||
local wc = Command:newNG{cmd = cmds.CMD_T55XX_WRITE_BLOCK, data = data}
|
||||
local response, err = wc:sendNG(false, TIMEOUT)
|
||||
if not response then return oops(err) end
|
||||
|
||||
else
|
||||
|
|
|
@ -42,6 +42,7 @@ Arguments:
|
|||
]]
|
||||
|
||||
local DEBUG = true -- the debug flag
|
||||
local TIMEOUT = 1500
|
||||
|
||||
--BLOCK 0 = 00010040 BIPHASE
|
||||
local config1 = '00'
|
||||
|
@ -95,7 +96,9 @@ end
|
|||
|
||||
local function test()
|
||||
local y
|
||||
local password = '00000000'
|
||||
local block = '00'
|
||||
local flags = '00'
|
||||
for y = 1, 0x1D, 4 do
|
||||
for _ = 1, #procedurecmds do
|
||||
local pcmd = procedurecmds[_]
|
||||
|
@ -107,13 +110,11 @@ local function test()
|
|||
local config = pcmd:format(config1, y, config2)
|
||||
dbg(('lf t55xx write b 0 d %s'):format(config))
|
||||
|
||||
config = tonumber(config, 16)
|
||||
local wc = Command:newMIX{
|
||||
cmd = cmds.CMD_T55XX_WRITE_BLOCK
|
||||
, arg1 = config
|
||||
, arg2 = block
|
||||
}
|
||||
local response, err = wc:sendMIX(false)
|
||||
local data = ('%s%s%s%s'):format(utils.SwapEndiannessStr(config, 32), password, block, flags)
|
||||
|
||||
local wc = Command:newNG{cmd = cmds.CMD_T55XX_WRITE_BLOCK, data = data}
|
||||
local response, err = wc:sendNG(false, TIMEOUT)
|
||||
|
||||
if not response then return oops(err) end
|
||||
else
|
||||
dbg(pcmd)
|
||||
|
|
|
@ -44,6 +44,7 @@ Arguments:
|
|||
]]
|
||||
|
||||
local DEBUG = true -- the debug flag
|
||||
local TIMEOUT = 1500
|
||||
|
||||
--BLOCK 0 = 00008040 FSK
|
||||
local config1 = '00'
|
||||
|
@ -97,7 +98,9 @@ end
|
|||
|
||||
local function test(modulation)
|
||||
local y
|
||||
local password = '00000000'
|
||||
local block = '00'
|
||||
local flags = '00'
|
||||
for y = 0x0, 0x1d, 0x4 do
|
||||
for _ = 1, #procedurecmds do
|
||||
local pcmd = procedurecmds[_]
|
||||
|
@ -108,14 +111,10 @@ local function test(modulation)
|
|||
|
||||
local config = pcmd:format(config1, y, modulation, config2)
|
||||
dbg(('lf t55xx write b 0 d %s'):format(config))
|
||||
local data = ('%s%s%s%s'):format(utils.SwapEndiannessStr(config, 32), password, block, flags)
|
||||
|
||||
config = tonumber(config,16)
|
||||
local wc = Command:newMIX{
|
||||
cmd = cmds.CMD_T55XX_WRITE_BLOCK
|
||||
, arg1 = config
|
||||
, arg2 = block
|
||||
}
|
||||
local response, err = wc:sendMIX(false)
|
||||
local wc = Command:newNG{cmd = cmds.CMD_T55XX_WRITE_BLOCK, data = data}
|
||||
local response, err = wc:sendNG(false, TIMEOUT)
|
||||
if not response then return oops(err) end
|
||||
else
|
||||
dbg(pcmd)
|
||||
|
|
|
@ -40,6 +40,7 @@ Arguments:
|
|||
]]
|
||||
|
||||
local DEBUG = true -- the debug flag
|
||||
local TIMEOUT = 1500
|
||||
|
||||
-- --BLOCK 0 = 00 08 80 40 PSK
|
||||
-- -----------
|
||||
|
@ -97,7 +98,9 @@ end
|
|||
local function test(modulation)
|
||||
local bitrate
|
||||
local clockrate
|
||||
local password = '00000000'
|
||||
local block = '00'
|
||||
local flags = '00'
|
||||
for bitrate = 0x0, 0x1d, 0x4 do
|
||||
|
||||
for clockrate = 0,8,4 do
|
||||
|
@ -114,13 +117,10 @@ local function test(modulation)
|
|||
local config = cmd:format(bitrate, modulation, clockrate)
|
||||
dbg(('lf t55xx write b 0 d %s'):format(config))
|
||||
|
||||
config = tonumber(config, 16)
|
||||
local wc = Command:newMIX{
|
||||
cmd = cmds.CMD_T55XX_WRITE_BLOCK
|
||||
, arg1 = config
|
||||
, arg2 = block
|
||||
}
|
||||
local response, err = wc:sendMIX(false)
|
||||
local data = ('%s%s%s%s'):format(utils.SwapEndiannessStr(config, 32), password, block, flags)
|
||||
|
||||
local wc = Command:newNG{cmd = cmds.CMD_T55XX_WRITE_BLOCK, data = data}
|
||||
local response, err = wc:sendNG(false, TIMEOUT)
|
||||
if not response then return oops(err) end
|
||||
else
|
||||
dbg(cmd)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue