1 -- this script writes bytes 8 to 256 on the Legic MIM256
2 example = "Script writes to Legic Prime Tag from position 0x07 until 0xFF with the value 0x01"
6 This is a script which writes value 0x01 to bytes from position 0x07 until 0xFF on a Legic Prime Tag (MIM256 or MIM1024)
7 (created with 'hf legic save my_dump.hex')
13 script run legic_buffer2card
16 local utils = require('utils')
17 local getopt = require('getopt')
19 -- This is only meant to be used when errors occur
28 print("Example usage")
32 -- simple loop-write from 0x07 to 0xff
35 -- parse arguments for the script
36 for o, a in getopt.getopt(args, 'h') do
37 if o == "h" then return help() end
43 cmd = ('hf legic write 0x%02x 0x01'):format(i)
45 core.clearCommandBuffer()
48 -- got a 'cmd-buffer overflow' on my mac - so just wait a little
49 -- works without that pause on my linux-box