mirror of
https://github.com/Proxmark/proxmark3.git
synced 2025-07-15 09:43:00 -07:00
Minor changes to writeraw.lua, still not working as it should
This commit is contained in:
parent
1d59cd8d7a
commit
3e69b21148
1 changed files with 34 additions and 8 deletions
|
@ -21,18 +21,27 @@ function show(usbpacket)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Want to do both connect and send raw, so we should AND the two commands
|
-- 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
|
-- ISO14A_COMMAND.ISO14A_RAW(8) and ISO14A_CONNECT (1). However, we don't have a
|
||||||
-- bitlib yet, so we'll do it manually, 1 & 8 == 9
|
-- bitlib yet, so we'll do it manually, 1 & 8 == 9
|
||||||
-- ISO14A_NO_DISCONNECT = 2
|
-- ISO14A_NO_DISCONNECT = 2 ==> 11
|
||||||
|
|
||||||
print(string.len(rawdata))
|
print(string.len(rawdata))
|
||||||
local command = Command:new{cmd = cmds.CMD_READER_ISO_14443a,
|
local command = Command:new{cmd = cmds.CMD_READER_ISO_14443a,
|
||||||
arg1 = 9,
|
arg1 = 3, -- Connect (1) and don't disconnect (2)
|
||||||
|
arg2 = 0-- string.len(rawdata),
|
||||||
|
--data = rawdata
|
||||||
|
}
|
||||||
|
local mf_auth = Command:new{cmd = cmds.CMD_READER_ISO_14443a,
|
||||||
|
arg1 = 6, -- Send raw
|
||||||
arg2 = string.len(rawdata),
|
arg2 = string.len(rawdata),
|
||||||
data = rawdata}
|
data = rawdata}
|
||||||
|
local quit = Command:new{cmd = cmds.CMD_READER_ISO_14443a,
|
||||||
|
arg1 = 0, -- Nothing
|
||||||
|
}
|
||||||
|
|
||||||
core.clearCommandBuffer()
|
core.clearCommandBuffer()
|
||||||
print("Sending")
|
--print("Sending")
|
||||||
print(command)
|
--print(command)
|
||||||
local err = core.SendCommand(command:getBytes())
|
local err = core.SendCommand(command:getBytes())
|
||||||
if err then
|
if err then
|
||||||
print(err)
|
print(err)
|
||||||
|
@ -41,6 +50,23 @@ end
|
||||||
local cardselect = core.WaitForResponseTimeout(cmds.CMD_ACK,TIMEOUT)
|
local cardselect = core.WaitForResponseTimeout(cmds.CMD_ACK,TIMEOUT)
|
||||||
print("Card select:")
|
print("Card select:")
|
||||||
show(cardselect)
|
show(cardselect)
|
||||||
local response = core.WaitForResponseTimeout(cmds.CMD_ACK,TIMEOUT)
|
--local response = core.WaitForResponseTimeout(cmds.CMD_ACK,TIMEOUT)
|
||||||
print("Raw response:")
|
--print("Raw response:")
|
||||||
show(response)
|
--show(response)
|
||||||
|
|
||||||
|
local answer = ""
|
||||||
|
while answer ~='q' do
|
||||||
|
|
||||||
|
local err = core.SendCommand(mf_auth:getBytes())
|
||||||
|
if err then
|
||||||
|
print(err)
|
||||||
|
return nil, err
|
||||||
|
end
|
||||||
|
local nonce = core.WaitForResponseTimeout(cmds.CMD_ACK,TIMEOUT)
|
||||||
|
print("Nonce:")
|
||||||
|
show(nonce)
|
||||||
|
io.write("Write q to quit, hit any char to get a nonce ")
|
||||||
|
io.flush()
|
||||||
|
answer=io.read(1)
|
||||||
|
|
||||||
|
end--]]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue