rename few CMD_* to get some less diversity
This commit is contained in:
@@ -166,7 +166,7 @@ function sendRaw(rawdata, options)
|
||||
flags = flags + lib14a.ISO14A_COMMAND.ISO14A_APPEND_CRC
|
||||
end
|
||||
|
||||
local command = Command:newMIX{cmd = cmds.CMD_READER_ISO_14443a,
|
||||
local command = Command:newMIX{cmd = cmds.CMD_HF_ISO14443A_READER,
|
||||
arg1 = flags, -- Send raw
|
||||
-- arg2 contains the length, which is half the length
|
||||
-- of the ASCII-string rawdata
|
||||
|
||||
@@ -16,7 +16,7 @@ local luamiibo = luamiibo_open()
|
||||
local function nfc_read_amiibo ()
|
||||
|
||||
local command = Command:newMIX{
|
||||
cmd = cmds.CMD_MIFAREU_READCARD,
|
||||
cmd = cmds.CMD_HF_MIFAREU_READCARD,
|
||||
arg1 = 0,
|
||||
arg2 = 135
|
||||
}
|
||||
@@ -90,7 +90,7 @@ local function emulate_amiibo (amiibo_data)
|
||||
|
||||
-- Begin simulating NTAG215
|
||||
local simCmd = Command:newMIX{
|
||||
cmd = cmds.CMD_SIMULATE_TAG_ISO_14443a,
|
||||
cmd = cmds.CMD_HF_ISO14443A_SIMULATE,
|
||||
arg1 = 7,
|
||||
arg2 = uid_first,
|
||||
arg3 = uid_second
|
||||
|
||||
@@ -114,7 +114,7 @@ local function calypso_send_cmd_raw(data, ignoreresponse )
|
||||
data = data or "00"
|
||||
|
||||
command = Command:newMIX{
|
||||
cmd = cmds.CMD_ISO_14443B_COMMAND,
|
||||
cmd = cmds.CMD_HF_ISO14443B_COMMAND,
|
||||
arg1 = flags,
|
||||
arg2 = #data/2, -- LEN of data, half the length of the ASCII-string hex string
|
||||
data = data} -- data bytes (commands etc)
|
||||
|
||||
@@ -475,7 +475,7 @@ local function readblock( blockno, key )
|
||||
-- Read block N
|
||||
local keytype = '00'
|
||||
local data = ('%02x%s%s'):format(blockno, keytype, key)
|
||||
local c = Command:newNG{cmd = cmds.CMD_MIFARE_READBL, data = data}
|
||||
local c = Command:newNG{cmd = cmds.CMD_HF_MIFARE_READBL, data = data}
|
||||
local b, err = getblockdata(c:sendNG(false))
|
||||
if not b then return oops(err) end
|
||||
return b
|
||||
|
||||
@@ -90,7 +90,7 @@ local function checkBlock(blockno, testkeys, keytype)
|
||||
|
||||
print(("Testing block %d, keytype %d, with %d keys"):format(blockno, keytype, chunksize))
|
||||
|
||||
local c = Command:newNG{cmd = cmds.CMD_MIFARE_CHKKEYS, data = d0..d1}
|
||||
local c = Command:newNG{cmd = cmds.CMD_HF_MIFARE_CHKKEYS, data = d0..d1}
|
||||
key, err = checkCommand(c:sendNG(false))
|
||||
|
||||
if key then return key, blockno end
|
||||
|
||||
@@ -74,7 +74,7 @@ local function sendRaw(rawdata, crc, power)
|
||||
flags = flags + lib14a.ISO14A_COMMAND.ISO14A_NO_DISCONNECT
|
||||
end
|
||||
|
||||
local command = Command:newMIX{cmd = cmds.CMD_READER_ISO_14443a,
|
||||
local command = Command:newMIX{cmd = cmds.CMD_HF_ISO14443A_READER,
|
||||
arg1 = flags, -- Send raw
|
||||
arg2 = string.len(rawdata) / 2, -- arg2 contains the length, which is half the length of the ASCII-string rawdata
|
||||
data = rawdata
|
||||
|
||||
@@ -69,7 +69,7 @@ end
|
||||
--
|
||||
-- Sends an instruction to do nothing, only disconnect
|
||||
function disconnect()
|
||||
local command = Command:newMIX{cmd = cmds.CMD_READER_ISO_14443a, arg1 = 0,}
|
||||
local command = Command:newMIX{cmd = cmds.CMD_HF_ISO14443A_READER, arg1 = 0,}
|
||||
-- We can ignore the response here, no ACK is returned for this command
|
||||
-- Check /armsrc/iso14443a.c, ReaderIso14443a() for details
|
||||
return command:sendMIX(true)
|
||||
@@ -93,7 +93,7 @@ end
|
||||
-- @return nil, errormessage if unsuccessfull
|
||||
local function getBlock(blockno)
|
||||
local block, err
|
||||
local c = Command:newMIX{cmd = cmds.CMD_MIFAREU_READBL, arg1 = blockno, data = 0}
|
||||
local c = Command:newMIX{cmd = cmds.CMD_HF_MIFAREU_READBL, arg1 = blockno, data = 0}
|
||||
block, err = getblockdata(c:sendMIX(false))
|
||||
if not block then return oops(err) end
|
||||
|
||||
|
||||
@@ -260,7 +260,7 @@ local function test(modulation)
|
||||
|
||||
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 wc = Command:newNG{cmd = cmds.CMD_LF_T55XX_WRITEBL, data = data}
|
||||
local response, err = wc:sendNG(false, TIMEOUT)
|
||||
if not response then return oops(err) end
|
||||
|
||||
|
||||
@@ -117,7 +117,7 @@ local function test()
|
||||
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 wc = Command:newNG{cmd = cmds.CMD_LF_T55XX_WRITEBL, data = data}
|
||||
local response, err = wc:sendNG(false, TIMEOUT)
|
||||
if not response then return oops(err) end
|
||||
|
||||
|
||||
@@ -112,7 +112,7 @@ local function test()
|
||||
|
||||
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 wc = Command:newNG{cmd = cmds.CMD_LF_T55XX_WRITEBL, data = data}
|
||||
local response, err = wc:sendNG(false, TIMEOUT)
|
||||
|
||||
if not response then return oops(err) end
|
||||
|
||||
@@ -113,7 +113,7 @@ local function test(modulation)
|
||||
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 wc = Command:newNG{cmd = cmds.CMD_LF_T55XX_WRITEBL, data = data}
|
||||
local response, err = wc:sendNG(false, TIMEOUT)
|
||||
if not response then return oops(err) end
|
||||
else
|
||||
|
||||
@@ -119,7 +119,7 @@ local function test(modulation)
|
||||
|
||||
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 wc = Command:newNG{cmd = cmds.CMD_LF_T55XX_WRITEBL, data = data}
|
||||
local response, err = wc:sendNG(false, TIMEOUT)
|
||||
if not response then return oops(err) end
|
||||
else
|
||||
|
||||
@@ -77,7 +77,7 @@ local function readblock( blocknum, keyA )
|
||||
-- Read block N
|
||||
local keytype = '00'
|
||||
local data = ('%02x%s%s'):format(blocknum, keytype, keyA)
|
||||
local c = Command:newNG{cmd = cmds.CMD_MIFARE_READBL, data = data}
|
||||
local c = Command:newNG{cmd = cmds.CMD_HF_MIFARE_READBL, data = data}
|
||||
local b, err = getblockdata(c:sendNG(false))
|
||||
if not b then return oops(err) end
|
||||
return b
|
||||
@@ -88,7 +88,7 @@ local function readmagicblock( blocknum )
|
||||
-- Read block N
|
||||
local CSETBLOCK_SINGLE_OPERATION = 0x1F
|
||||
local c = Command:newMIX{
|
||||
cmd = cmds.CMD_MIFARE_CGETBLOCK
|
||||
cmd = cmds.CMD_HF_MIFARE_CGETBL
|
||||
, arg1 = CSETBLOCK_SINGLE_OPERATION
|
||||
, arg3 = blocknum
|
||||
}
|
||||
|
||||
@@ -169,7 +169,7 @@ local function main(args)
|
||||
local blockno = '00'
|
||||
local keytype = '00'
|
||||
local data = ('%s%s%s'):format(blockno, keytype, keyA)
|
||||
cmd = Command:newNG{cmd = cmds.CMD_MIFARE_READBL, data = data}
|
||||
cmd = Command:newNG{cmd = cmds.CMD_HF_MIFARE_READBL, data = data}
|
||||
block0, err = getblockdata(cmd:sendNG(false))
|
||||
if not block0 then return oops(err) end
|
||||
|
||||
@@ -179,7 +179,7 @@ local function main(args)
|
||||
dbg('Reading block 1')
|
||||
local blockno = '01'
|
||||
data = ('%s%s%s'):format(blockno, keytype, keyA)
|
||||
cmd = Command:newNG{cmd = cmds.CMD_MIFARE_READBL, data = data}
|
||||
cmd = Command:newNG{cmd = cmds.CMD_HF_MIFARE_READBL, data = data}
|
||||
block1, err = getblockdata(cmd:sendNG(false))
|
||||
if not block1 then return oops(err) end
|
||||
|
||||
@@ -208,7 +208,7 @@ local function main(args)
|
||||
pos = (math.floor( blockNo / 4 ) * 12)+1
|
||||
key = akeys:sub(pos, pos + 11 )
|
||||
data = ('%02x%s%s'):format(blockNo, keytype, key)
|
||||
cmd = Command:newNG{cmd = cmds.CMD_MIFARE_READBL, data = data}
|
||||
cmd = Command:newNG{cmd = cmds.CMD_HF_MIFARE_READBL, data = data}
|
||||
local blockdata, err = getblockdata(cmd:sendNG(false))
|
||||
if not blockdata then return oops(err) end
|
||||
|
||||
|
||||
@@ -246,7 +246,7 @@ local function LoadEmulator(uid, blocks)
|
||||
io.write( _..',')
|
||||
io.flush()
|
||||
core.clearCommandBuffer()
|
||||
cmd = Command:newMIX{cmd = cmds.CMD_MIFARE_EML_MEMSET, arg1 = _ ,arg2 = 1,arg3 = 16, data = blockdata}
|
||||
cmd = Command:newMIX{cmd = cmds.CMD_HF_MIFARE_EML_MEMSET, arg1 = _ ,arg2 = 1,arg3 = 16, data = blockdata}
|
||||
local err, msg = cmd:sendMIX(true)
|
||||
if err == nil then return err, msg end
|
||||
end
|
||||
|
||||
@@ -96,7 +96,7 @@ function sendRaw(rawdata, options)
|
||||
+ lib14a.ISO14A_COMMAND.ISO14A_APPEND_CRC
|
||||
+ lib14a.ISO14A_COMMAND.ISO14A_NO_RATS
|
||||
|
||||
local command = Command:newMIX{cmd = cmds.CMD_READER_ISO_14443a,
|
||||
local command = Command:newMIX{cmd = cmds.CMD_HF_ISO14443A_READER,
|
||||
arg1 = flags, -- Send raw
|
||||
-- arg2 contains the length, which is half the length
|
||||
-- of the ASCII-string rawdata
|
||||
|
||||
Reference in New Issue
Block a user