chg: 'hf mf chkkeys' - now uses NG

This commit is contained in:
iceman1001
2019-04-29 02:07:40 +02:00
parent 7cc6975e52
commit 7454a4dcf2
5 changed files with 16 additions and 8 deletions

View File

@@ -13,7 +13,10 @@
-- Loads the commands-library
local taglib = require('taglib')
local cmds = require('commands')
local TIMEOUT = 2000 -- Shouldn't take longer than 2 seconds
-- Shouldn't take longer than 2 seconds
local TIMEOUT = 2000
local ISO14A_COMMAND = {
ISO14A_CONNECT = 1,
ISO14A_NO_DISCONNECT = 2,
@@ -99,7 +102,7 @@ local function read14443a(dont_disconnect, no_rats)
if arg0 == 0 then
return nil, 'iso14443a card select failed'
end
data = string.sub(result,count)
data = string.sub(result, count)
info, err = parse14443a(data)
else
err = 'No response from card'

View File

@@ -84,11 +84,11 @@ local function checkBlock(blockno, testkeys, keytype)
core.clearCommandBuffer()
print(("Testing block %d, keytype %d, with %d keys"):format(blockno, keytype, chunksize))
local c = Command:newMIX{cmd = cmds.CMD_MIFARE_CHKKEYS,
local c = Command:newNG{cmd = cmds.CMD_MIFARE_CHKKEYS,
arg1 = arg1,
arg3 = chunksize,
data = d1}
status, err = checkCommand(c:sendMIX(false, TIMEOUT))
status, err = checkCommand(c:sendNG(false, TIMEOUT))
if status then return status, blockno end
start = start + chunksize