mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-21 13:53:55 -07:00
fix: script run legic_buffer2card - correct params for write command
This commit is contained in:
parent
a5f19cde79
commit
5b087a053c
1 changed files with 31 additions and 22 deletions
|
@ -1,32 +1,41 @@
|
||||||
-- this script writes bytes 8 to 256 on the Legic MIM256
|
|
||||||
example = "Script writes to Legic Prime Tag from position 0x07 until 0xFF with the value 0x01"
|
|
||||||
author = "Mosci"
|
|
||||||
desc =
|
|
||||||
[[
|
|
||||||
This is a script which writes value 0x01 to bytes from position 0x07 until 0xFF on a Legic Prime Tag (MIM256 or MIM1024)
|
|
||||||
(created with 'hf legic save my_dump.hex')
|
|
||||||
|
|
||||||
optional arguments :
|
|
||||||
-h - Help text
|
|
||||||
|
|
||||||
Examples :
|
|
||||||
script run legic_buffer2card
|
|
||||||
]]
|
|
||||||
|
|
||||||
local utils = require('utils')
|
local utils = require('utils')
|
||||||
local getopt = require('getopt')
|
local getopt = require('getopt')
|
||||||
|
-- this script writes bytes 8 to 256 on the Legic MIM256
|
||||||
|
|
||||||
|
copyright = ''
|
||||||
|
author = 'Mosci'
|
||||||
|
version = 'v1.0.1'
|
||||||
|
desc =
|
||||||
|
[[
|
||||||
|
This is a script which writes value 0x01 to bytes from position 0x07 until 0xFF on a Legic Prime Tag (MIM256 or MIM1024) -- (created with 'hf legic save my_dump.hex') --
|
||||||
|
]]
|
||||||
|
example = [[
|
||||||
|
script run legic_buffer2card
|
||||||
|
]]
|
||||||
|
usage = [[
|
||||||
|
script run legic_buffer2card -h
|
||||||
|
|
||||||
|
Arguments
|
||||||
|
-h - Help text
|
||||||
|
]]
|
||||||
|
|
||||||
---
|
---
|
||||||
-- This is only meant to be used when errors occur
|
-- This is only meant to be used when errors occur
|
||||||
function oops(err)
|
local function oops(err)
|
||||||
print("ERROR: ",err)
|
print('ERROR:', err)
|
||||||
|
core.clearCommandBuffer()
|
||||||
return nil, err
|
return nil, err
|
||||||
end
|
end
|
||||||
---
|
---
|
||||||
-- Usage help
|
-- Usage help
|
||||||
function help()
|
local function help()
|
||||||
|
print(copyright)
|
||||||
|
print(author)
|
||||||
|
print(version)
|
||||||
print(desc)
|
print(desc)
|
||||||
print("Example usage")
|
print('Example usage')
|
||||||
print(example)
|
print(example)
|
||||||
|
print(usage)
|
||||||
end
|
end
|
||||||
--
|
--
|
||||||
-- simple loop-write from 0x07 to 0xff
|
-- simple loop-write from 0x07 to 0xff
|
||||||
|
@ -34,13 +43,13 @@ function main()
|
||||||
|
|
||||||
-- parse arguments for the script
|
-- parse arguments for the script
|
||||||
for o, a in getopt.getopt(args, 'h') do
|
for o, a in getopt.getopt(args, 'h') do
|
||||||
if o == "h" then return help() end
|
if o == 'h' then return help() end
|
||||||
end
|
end
|
||||||
|
|
||||||
local cmd = ''
|
local cmd = ''
|
||||||
local i
|
local i
|
||||||
for i = 7, 255 do
|
for i = 7, 255 do
|
||||||
cmd = ('hf legic write 0x%02x 0x01'):format(i)
|
cmd = ('hf legic write o %02x d 01'):format(i)
|
||||||
print(cmd)
|
print(cmd)
|
||||||
core.clearCommandBuffer()
|
core.clearCommandBuffer()
|
||||||
core.console(cmd)
|
core.console(cmd)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue