]> cvs.zerfleddert.de Git - proxmark3-svn/blame - client/scripts/writeraw.lua
Attempt to use raw writing capabilities via scripting engine. Not functional yet
[proxmark3-svn] / client / scripts / writeraw.lua
CommitLineData
4df3eb3f 1local cmds = require('commands')
2local desc =
3[[
4
5This script is a work in progress, not yet functional. It is an attempt to use the raw-writing
6capabilities already present within the devices
7
8]]
9
10print(desc)
11
12-- Some raw data
13local rawdata = "6000F57b" --mf_auth
14local TIMEOUT = 2000 -- Shouldn't take longer than 2 seconds
15
16function show(usbpacket)
17 if usbpacket then
18 local response = Command.parse(usbpacket)
19 print(response)
20 end
21end
22
23-- Want to do both connect and send raw, so we should AND the two commands
24-- ISO14A_COMMAND.ISO14A_RAW and ISO14A_CONNECT. However, we don't have a
25-- bitlib yet, so we'll do it manually, 1 & 8 == 9
26-- ISO14A_NO_DISCONNECT = 2
27
28print(string.len(rawdata))
29local command = Command:new{cmd = cmds.CMD_READER_ISO_14443a,
30 arg1 = 9,
31 arg2 = string.len(rawdata),
32 data = rawdata}
33core.clearCommandBuffer()
34print("Sending")
35print(command)
36local err = core.SendCommand(command:getBytes())
37if err then
38 print(err)
39 return nil, err
40end
41local cardselect = core.WaitForResponseTimeout(cmds.CMD_ACK,TIMEOUT)
42print("Card select:")
43show(cardselect)
44local response = core.WaitForResponseTimeout(cmds.CMD_ACK,TIMEOUT)
45print("Raw response:")
46show(response)
Impressum, Datenschutz