Release v4.18994 - Backdoor
[RRG-proxmark3.git] / client / default_keys_dic2lua.awk
blob47a4d543931ddb711ebebe0cd9c2aa9cf0cb3bad
1 BEGIN {
2 print "--[["
3 print "These are default_keys dictionary"
4 print "This file is automatically generated from default_keys.h - DON'T EDIT MANUALLY."
5 print "--]]"
6 print "local _keys = {"
9 $1 ~ /^[A-Fa-f0-9]+/ { sub(/\r/, ""); print " '"substr($1,1,12)"'," }
11 END {
12 print "}"
13 print "---"
14 print "-- The keys above have just been pasted in, for completeness sake. They contain duplicates. "
15 print "-- We need to weed the duplicates out before we expose the list to someone who actually wants to use them"
16 print "-- @param list a list to do 'uniq' on"
17 print ""
18 print "local function uniq(list)"
19 print ""
20 print " local foobar = {}"
21 print " for _, value in pairs(list) do"
22 print " value = value:lower()"
23 print " if not foobar[value] then"
24 print " foobar[value] = true"
25 print " table.insert(foobar, value);"
26 print " end"
27 print " end"
28 print " return foobar"
29 print "end"
30 print "return uniq(_keys)"