mirror of
https://github.com/Proxmark/proxmark3.git
synced 2025-07-15 09:43:00 -07:00
Merge pull request #317 from Proxmark/iceman1001-patch-1
bug; Check keys params
This commit is contained in:
commit
0efcb69128
1 changed files with 3 additions and 2 deletions
|
@ -86,6 +86,7 @@ function checkBlock(blockNo, keys, keyType)
|
||||||
-- The command data is only 512 bytes, each key is 6 bytes, meaning that we can send max 85 keys in one go.
|
-- The command data is only 512 bytes, each key is 6 bytes, meaning that we can send max 85 keys in one go.
|
||||||
-- If there's more, we need to split it up
|
-- If there's more, we need to split it up
|
||||||
local start, remaining= 1, #keys
|
local start, remaining= 1, #keys
|
||||||
|
local arg1 = bit32.bor(bit32.lshift(keyType, 8), blockNo)
|
||||||
local packets = {}
|
local packets = {}
|
||||||
while remaining > 0 do
|
while remaining > 0 do
|
||||||
local n,data = remaining, nil
|
local n,data = remaining, nil
|
||||||
|
@ -95,8 +96,8 @@ function checkBlock(blockNo, keys, keyType)
|
||||||
--print("data len", #data)
|
--print("data len", #data)
|
||||||
print(("Testing block %d, keytype %d, with %d keys"):format(blockNo, keyType, n))
|
print(("Testing block %d, keytype %d, with %d keys"):format(blockNo, keyType, n))
|
||||||
local command = Command:new{cmd = cmds.CMD_MIFARE_CHKKEYS,
|
local command = Command:new{cmd = cmds.CMD_MIFARE_CHKKEYS,
|
||||||
arg1 = blockNo,
|
arg1 = arg1,
|
||||||
arg2 = keyType,
|
arg2 = 1,
|
||||||
arg3 = n,
|
arg3 = n,
|
||||||
data = data}
|
data = data}
|
||||||
local status = checkCommand(command)
|
local status = checkCommand(command)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue