mirror of
https://github.com/Proxmark/proxmark3.git
synced 2025-07-16 02:03:00 -07:00
Attempt to use raw writing capabilities via scripting engine. Not functional yet
This commit is contained in:
parent
c6e2bfcda1
commit
4df3eb3f73
2 changed files with 50 additions and 2 deletions
46
client/scripts/writeraw.lua
Normal file
46
client/scripts/writeraw.lua
Normal file
|
@ -0,0 +1,46 @@
|
|||
local cmds = require('commands')
|
||||
local desc =
|
||||
[[
|
||||
|
||||
This script is a work in progress, not yet functional. It is an attempt to use the raw-writing
|
||||
capabilities already present within the devices
|
||||
|
||||
]]
|
||||
|
||||
print(desc)
|
||||
|
||||
-- Some raw data
|
||||
local rawdata = "6000F57b" --mf_auth
|
||||
local TIMEOUT = 2000 -- Shouldn't take longer than 2 seconds
|
||||
|
||||
function show(usbpacket)
|
||||
if usbpacket then
|
||||
local response = Command.parse(usbpacket)
|
||||
print(response)
|
||||
end
|
||||
end
|
||||
|
||||
-- Want to do both connect and send raw, so we should AND the two commands
|
||||
-- ISO14A_COMMAND.ISO14A_RAW and ISO14A_CONNECT. However, we don't have a
|
||||
-- bitlib yet, so we'll do it manually, 1 & 8 == 9
|
||||
-- ISO14A_NO_DISCONNECT = 2
|
||||
|
||||
print(string.len(rawdata))
|
||||
local command = Command:new{cmd = cmds.CMD_READER_ISO_14443a,
|
||||
arg1 = 9,
|
||||
arg2 = string.len(rawdata),
|
||||
data = rawdata}
|
||||
core.clearCommandBuffer()
|
||||
print("Sending")
|
||||
print(command)
|
||||
local err = core.SendCommand(command:getBytes())
|
||||
if err then
|
||||
print(err)
|
||||
return nil, err
|
||||
end
|
||||
local cardselect = core.WaitForResponseTimeout(cmds.CMD_ACK,TIMEOUT)
|
||||
print("Card select:")
|
||||
show(cardselect)
|
||||
local response = core.WaitForResponseTimeout(cmds.CMD_ACK,TIMEOUT)
|
||||
print("Raw response:")
|
||||
show(response)
|
Loading…
Add table
Add a link
Reference in a new issue