]> cvs.zerfleddert.de Git - proxmark3-svn/blame - client/scripts/remagic.lua
Merge pull request #235 from marshmellow42/lfdemod_refactors
[proxmark3-svn] / client / scripts / remagic.lua
CommitLineData
81740aa5 1local getopt = require('getopt')
2
3example = "script run remagic"
4author = "Iceman"
5
6desc =
7[[
8This is a script that tries to bring back a chinese magic card (1k generation1)
9from the dead when it's block 0 has been written with bad values.
10
11Arguments:
12 -h this help
13]]
14---
15-- A debug printout-function
16function dbg(args)
17 if DEBUG then
18 print("###", args)
19 end
20end
21---
22-- This is only meant to be used when errors occur
23function oops(err)
24 print("ERROR: ",err)
25end
26
27---
28-- Usage help
29function help()
30 print(desc)
31 print("Example usage")
32 print(example)
33end
34
35---
36-- The main entry point
37function main(args)
38
39
40 -- Read the parameters
41 for o, a in getopt.getopt(args, 'h') do
42 if o == "h" then help() return end
43 end
44
45 local _cmds = {
46 --[[
47 --]]
48 [0] = "hf 14a raw -p -a -b 7 40",
49 [1] = "hf 14a raw -p -a 43",
50 [2] = "hf 14a raw -c -p -a A000",
51 [3] = "hf 14a raw -c -p -a 01 02 03 04 04 98 02 00 00 00 00 00 00 00 10 01",
52 }
53 core.clearCommandBuffer()
54
55 local i
56 --for _,c in pairs(_cmds) do
57 for i = 0, 3 do
58 print ( _cmds[i] )
59 core.console( _cmds[i] )
60 end
61end
62
63main(args)
Impressum, Datenschutz