mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-02-13 10:43:01 +08:00
refactor NG
This commit is contained in:
parent
e1bb05b35e
commit
a59f2a1b60
1 changed files with 13 additions and 4 deletions
|
@ -15,9 +15,13 @@ local luamiibo = luamiibo_open()
|
|||
|
||||
local function nfc_read_amiibo ()
|
||||
|
||||
local command = Command:new{cmd = cmds.CMD_MIFAREU_READCARD, arg1 = 0, arg2 = 135}
|
||||
local command = Command:newMIX{
|
||||
cmd = cmds.CMD_MIFAREU_READCARD,
|
||||
arg1 = 0,
|
||||
arg2 = 135
|
||||
}
|
||||
|
||||
local result, err = reader.sendToDevice(command)
|
||||
local result, err = command.sendMIX()
|
||||
if result then
|
||||
-- Do Mifare Ultralight read
|
||||
local count, cmd, arg0, data_len, offset = bin.unpack('LLLL', result)
|
||||
|
@ -85,8 +89,13 @@ local function emulate_amiibo (amiibo_data)
|
|||
print(string.format('Simulating with UID: 0x%04x 0x%04x', uid_first, uid_second))
|
||||
|
||||
-- Begin simulating NTAG215
|
||||
local simCmd = Command:new{cmd = cmds.CMD_SIMULATE_TAG_ISO_14443a, arg1 = 7, arg2 = uid_first, arg3 = uid_second}
|
||||
local _, err = reader.sendToDevice(simCmd)
|
||||
local simCmd = Command:newMIX{
|
||||
cmd = cmds.CMD_SIMULATE_TAG_ISO_14443a,
|
||||
arg1 = 7,
|
||||
arg2 = uid_first,
|
||||
arg3 = uid_second
|
||||
}
|
||||
local _, err = simCmd.sendMIX()
|
||||
if err then
|
||||
print('Failed to start simulator', err)
|
||||
return
|
||||
|
|
Loading…
Reference in a new issue