recover_pk selftests: show curve & hash
[RRG-proxmark3.git] / client / luascripts / lf_t55xx_reset.lua
blobe63b07b66ae7a493385f2b1a9b094f303df67813
1 local getopt = require('getopt')
2 local ansicolors = require('ansicolors')
3 local utils = require('utils')
5 copyright = ''
6 author = 'whiteneon'
7 version = 'v1.0.0'
8 desc = [[
9 This script attempts to reset the password
10 - on a T55xx LF chip.
12 example = [[
13 script run lf_t55xx_reset
15 usage = [[
16 script run lf_t55xx_reset -h
18 arguments = [[
19 -h : this help
22 local DEBUG = true
23 ---
24 -- A debug printout-function
25 local function dbg(args)
26 if not DEBUG then return end
27 if type(args) == 'table' then
28 local i = 1
29 while args[i] do
30 dbg(args[i])
31 i = i+1
32 end
33 else
34 print('###', args)
35 end
36 end
37 ---
38 -- This is only meant to be used when errors occur
39 local function oops(err)
40 print('ERROR:', err)
41 core.clearCommandBuffer()
42 return nil, err
43 end
44 ---
45 -- Usage help
46 local function help()
47 print(copyright)
48 print(author)
49 print(version)
50 print(desc)
51 print(ansicolors.cyan..'Usage'..ansicolors.reset)
52 print(usage)
53 print(ansicolors.cyan..'Arguments'..ansicolors.reset)
54 print(arguments)
55 print(ansicolors.cyan..'Example usage'..ansicolors.reset)
56 print(example)
57 end
58 ---
59 -- The main entry point
60 function main(args)
61 local dash = string.rep('--', 20)
63 print( dash )
64 print( dash )
65 print()
67 -- Read the parameters
68 for o, a in getopt.getopt(args, 'h') do
69 if o == 'h' then return help() end
70 end
72 print('Attempting T55xx chip reset')
73 print(dash)
74 -- core.console('lf t55 write -b 0 -d 000880E0 --r0 -t')
75 -- core.console('lf t55 write -b 0 -d 000880E0 --r1 -t')
76 -- core.console('lf t55 write -b 0 -d 000880E0 --r2 -t')
77 -- core.console('lf t55 write -b 0 -d 000880E0 --r3 -t')
78 core.console('lf t55 write -b 0 -d 000880E0 --r0')
79 core.console('lf t55 write -b 0 -d 000880E0 --r1')
80 core.console('lf t55 write -b 0 -d 000880E0 --r2')
81 core.console('lf t55 write -b 0 -d 000880E0 --r3')
82 core.console('lf t55 wipe')
83 core.console('lf t55 detect')
84 print(dash)
85 print('all done!')
87 end
89 main(args)