mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-20 13:23:51 -07:00
lto_dump fixes - wrong if-statement, wrong argument for 7bit
This commit is contained in:
parent
0cb57915a1
commit
39b7658528
1 changed files with 11 additions and 12 deletions
|
@ -5,7 +5,7 @@ local utils = require('utils')
|
||||||
|
|
||||||
copyright = ''
|
copyright = ''
|
||||||
author = 'Kevin'
|
author = 'Kevin'
|
||||||
version = 'v1.0'
|
version = 'v1.0.1'
|
||||||
desc = [[
|
desc = [[
|
||||||
This is a script that reads LTO-CM ISO14443a tags.
|
This is a script that reads LTO-CM ISO14443a tags.
|
||||||
It starts from block 0 and ends at default block 20.
|
It starts from block 0 and ends at default block 20.
|
||||||
|
@ -29,7 +29,7 @@ Arguments:
|
||||||
-- Some globals
|
-- Some globals
|
||||||
local DEBUG = false -- the debug flag
|
local DEBUG = false -- the debug flag
|
||||||
local lshift = bit32.lshift
|
local lshift = bit32.lshift
|
||||||
|
local band = bit32.band
|
||||||
---
|
---
|
||||||
-- A debug printout-function
|
-- A debug printout-function
|
||||||
local function dbg(args)
|
local function dbg(args)
|
||||||
|
@ -63,24 +63,24 @@ local function help()
|
||||||
print(usage)
|
print(usage)
|
||||||
end
|
end
|
||||||
|
|
||||||
function sendRaw(rawdata, options)
|
local function sendRaw(rawdata, options)
|
||||||
local flags = lib14a.ISO14A_COMMAND.ISO14A_NO_DISCONNECT + lib14a.ISO14A_COMMAND.ISO14A_RAW
|
local flags = lib14a.ISO14A_COMMAND.ISO14A_NO_DISCONNECT + lib14a.ISO14A_COMMAND.ISO14A_RAW
|
||||||
|
|
||||||
if options.append_crc then
|
if options.append_crc then
|
||||||
flags = flags + lib14a.ISO14A_COMMAND.ISO14A_APPEND_CRC
|
flags = flags + lib14a.ISO14A_COMMAND.ISO14A_APPEND_CRC
|
||||||
end
|
end
|
||||||
|
|
||||||
print ('flags:', string:format("%08x",flags))
|
local arg2 = #rawdata / 2
|
||||||
if options.bits7 then
|
if options.bits7 then
|
||||||
flags = lshift(7, 16) + flags
|
arg2 = arg2 + tonumber(lshift(7, 16))
|
||||||
print ('bit 7:', string:format("%08x",flags))
|
-- print('bit 7:', ("%08x"):format(arg2))
|
||||||
end
|
end
|
||||||
|
|
||||||
local command = Command:newMIX{cmd = cmds.CMD_HF_ISO14443A_READER,
|
local command = Command:newMIX{cmd = cmds.CMD_HF_ISO14443A_READER,
|
||||||
arg1 = flags, -- Send raw
|
arg1 = flags, -- Send raw
|
||||||
-- arg2 contains the length, which is half the length
|
-- arg2 contains the length, which is half the length
|
||||||
-- of the ASCII-string rawdata
|
-- of the ASCII-string rawdata
|
||||||
arg2 = string.len(rawdata)/2,
|
arg2 = arg2,
|
||||||
data = rawdata}
|
data = rawdata}
|
||||||
return command:sendMIX(options.ignore_response)
|
return command:sendMIX(options.ignore_response)
|
||||||
end
|
end
|
||||||
|
@ -102,7 +102,7 @@ local function send(payload, options)
|
||||||
return oops(err)
|
return oops(err)
|
||||||
end
|
end
|
||||||
core.clearCommandBuffer()
|
core.clearCommandBuffer()
|
||||||
if (options.ignore_response)
|
if options.ignore_response then
|
||||||
return "ok", nil
|
return "ok", nil
|
||||||
else
|
else
|
||||||
return res, err
|
return res, err
|
||||||
|
@ -115,7 +115,6 @@ function main(args)
|
||||||
|
|
||||||
local startblock = 0
|
local startblock = 0
|
||||||
local endblock = 254
|
local endblock = 254
|
||||||
|
|
||||||
-- Read the parameters
|
-- Read the parameters
|
||||||
for o, a in getopt.getopt(args, 'hs:e:') do
|
for o, a in getopt.getopt(args, 'hs:e:') do
|
||||||
if o == 'h' then return help() end
|
if o == 'h' then return help() end
|
||||||
|
@ -163,7 +162,7 @@ function main(args)
|
||||||
if err then return end
|
if err then return end
|
||||||
|
|
||||||
payload = "80"
|
payload = "80"
|
||||||
res, err = send(cmd , {ignore_response = true, append_crc = false})
|
res, err = send(payload, {ignore_response = true, append_crc = false})
|
||||||
if err then return end
|
if err then return end
|
||||||
|
|
||||||
local data = getdata(res)
|
local data = getdata(res)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue