mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-19 21:03:48 -07:00
more fixes for hf_legic. missing zero padding, removed tab, more colors
This commit is contained in:
parent
d08c6f404b
commit
0d682da676
1 changed files with 75 additions and 56 deletions
|
@ -122,6 +122,7 @@ local acblue = ""
|
||||||
local acmagenta = ""
|
local acmagenta = ""
|
||||||
|
|
||||||
local acy = ansicolors.yellow
|
local acy = ansicolors.yellow
|
||||||
|
local acc = ansicolors.cyan
|
||||||
local acr = ansicolors.reset
|
local acr = ansicolors.reset
|
||||||
|
|
||||||
--- Helper ---
|
--- Helper ---
|
||||||
|
@ -137,6 +138,10 @@ function load_colors(onoff)
|
||||||
acblue = ansicolors.blue
|
acblue = ansicolors.blue
|
||||||
acmagenta= ansicolors.magenta
|
acmagenta= ansicolors.magenta
|
||||||
acoff = ansicolors.reset
|
acoff = ansicolors.reset
|
||||||
|
|
||||||
|
acy = ansicolors.yellow
|
||||||
|
acc = ansicolors.cyan
|
||||||
|
acr = ansicolors.reset
|
||||||
else
|
else
|
||||||
-- 'no color'
|
-- 'no color'
|
||||||
acgreen = ""
|
acgreen = ""
|
||||||
|
@ -146,6 +151,10 @@ function load_colors(onoff)
|
||||||
acblue = ""
|
acblue = ""
|
||||||
acmagenta= ""
|
acmagenta= ""
|
||||||
acoff = ""
|
acoff = ""
|
||||||
|
|
||||||
|
acy = ""
|
||||||
|
acc = ""
|
||||||
|
acr = ""
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -162,26 +171,24 @@ it's kinda interactive with following commands in three categories:
|
||||||
|
|
||||||
Data I/O Segment Manipulation Token-Data
|
Data I/O Segment Manipulation Token-Data
|
||||||
----------------- -------------------- -----------------
|
----------------- -------------------- -----------------
|
||||||
]]..acy..[[rt]]..acr..[[ => read Tag ]]..acy..[[as]]..acr..[[ => add Segment ]]..acy..[[mt]]..acr..[[ => make Token
|
]]..acy..[[rt]]..acr..[[ -> read Tag ]]..acy..[[as]]..acr..[[ -> add Segment ]]..acy..[[mt]]..acr..[[ -> make Token
|
||||||
]]..acy..[[wt]]..acr..[[ => write Tag ]]..acy..[[es]]..acr..[[ => edit Segment Header ]]..acy..[[et]]..acr..[[ => edit Token data
|
]]..acy..[[wt]]..acr..[[ -> write Tag ]]..acy..[[es]]..acr..[[ -> edit Segment Header ]]..acy..[[et]]..acr..[[ -> edit Token data
|
||||||
]]..acy..[[ed]]..acr..[[ => edit Segment Data ]]..acy..[[tk]]..acr..[[ => toggle KGH-Flag
|
]]..acy..[[ed]]..acr..[[ => edit Segment Data ]]..acy..[[tk]]..acr..[[ => toggle KGH-Flag
|
||||||
File I/O ]]..acy..[[rs]]..acr..[[ => remove Segment
|
File I/O ]]..acy..[[rs]]..acr..[[ => remove Segment
|
||||||
----------------- ]]..acy..[[cc]]..acr..[[ => check Segment-CRC
|
----------------- ]]..acy..[[cc]]..acr..[[ -> check Segment-CRC
|
||||||
]]..acy..[[lf]]..acr..[[ => load bin File ]]..acy..[[ck]]..acr..[[ => check KGH
|
]]..acy..[[lf]]..acr..[[ -> load bin File ]]..acy..[[ck]]..acr..[[ -> check KGH
|
||||||
]]..acy..[[sf]]..acr..[[ => save eml/bin File ]]..acy..[[ds]]..acr..[[ => dump Segments
|
]]..acy..[[sf]]..acr..[[ -> save eml/bin File ]]..acy..[[ds]]..acr..[[ -> dump Segments
|
||||||
]]..acy..[[xf]]..acr..[[ => xor to File
|
]]..acy..[[xf]]..acr..[[ -> xor to File
|
||||||
|
|
||||||
|
|
||||||
(partially) known Segments Virtual Tags Script Output
|
(partially) known Segments Virtual Tags Script Output
|
||||||
--------------------------- ------------------------------- ------------------------
|
--------------------------- ------------------------------- ------------------------
|
||||||
]]..acy..[[dlc]]..acr..[[ => dump Legic-Cash ]]..acy..[[ct]]..acr..[[ => copy mainTag to backupTag ]]..acy..[[tac]]..acr..[[ => toggle ansicolors
|
]]..acy..[[dlc]]..acr..[[ -> dump Legic-Cash ]]..acy..[[ct]]..acr..[[ -> copy mainTag to backupTag ]]..acy..[[tac]]..acr..[[ -> toggle ansicolors
|
||||||
]]..acy..[[elc]]..acr..[[ => edit Legic-Cash ]]..acy..[[tc]]..acr..[[ => copy backupTag to mainTag
|
]]..acy..[[elc]]..acr..[[ -> edit Legic-Cash ]]..acy..[[tc]]..acr..[[ -> copy backupTag to mainTag
|
||||||
]]..acy..[[d3p]]..acr..[[ => dump 3rd-Party-Cash ]]..acy..[[tt]]..acr..[[ => switch mainTag & backupTag
|
]]..acy..[[d3p]]..acr..[[ -> dump 3rd-Party-Cash ]]..acy..[[tt]]..acr..[[ -> switch mainTag & backupTag
|
||||||
]]..acy..[[e3p]]..acr..[[ => edit 3rd-Party-Cash ]]..acy..[[di]]..acr..[[ => dump mainTag
|
]]..acy..[[e3p]]..acr..[[ -> edit 3rd-Party-Cash ]]..acy..[[di]]..acr..[[ -> dump mainTag
|
||||||
]]..acy..[[do]]..acr..[[ => dump backupTag
|
]]..acy..[[do]]..acr..[[ => dump backupTag
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
rt: 'read tag' - reads a tag placed near to the PM3
|
rt: 'read tag' - reads a tag placed near to the PM3
|
||||||
wt: 'write tag' - writes the content of the 'virtual inTag' to a tag placed near to th PM3
|
wt: 'write tag' - writes the content of the 'virtual inTag' to a tag placed near to th PM3
|
||||||
without the need of changing anything - MCD,MSN,MCC will be read from the tag
|
without the need of changing anything - MCD,MSN,MCC will be read from the tag
|
||||||
|
@ -361,7 +368,7 @@ end
|
||||||
function bytesToTable(bytes, bstart, bend)
|
function bytesToTable(bytes, bstart, bend)
|
||||||
local t={}
|
local t={}
|
||||||
for i=0, (bend-bstart) do
|
for i=0, (bend-bstart) do
|
||||||
t[i]=bytes[bstart+i]
|
t[i]=padString(bytes[bstart+i])
|
||||||
end
|
end
|
||||||
return t
|
return t
|
||||||
end
|
end
|
||||||
|
@ -942,20 +949,21 @@ function dumpTagMap(tag, tagMap)
|
||||||
end
|
end
|
||||||
if (isPosCrc8(tagMap, v['start'])>0) then
|
if (isPosCrc8(tagMap, v['start'])>0) then
|
||||||
if ( checkMapCrc8(tagMap, bytes, isPosCrc8(tagMap, v['start']) ) ) then
|
if ( checkMapCrc8(tagMap, bytes, isPosCrc8(tagMap, v['start']) ) ) then
|
||||||
io.write("("..("%04d"):format(v['start']).."-"..("%04d"):format(v['end'])..") "..acgreen..v['name']..acoff..":")
|
io.write("("..("%04d"):format(v['start']).."-"..("%04d"):format(v['end'])..") "..acgreen..v['name']..acoff)
|
||||||
else
|
else
|
||||||
io.write("("..("%04d"):format(v['start']).."-"..("%04d"):format(v['end'])..") "..acred..v['name']..acoff..":")
|
io.write("("..("%04d"):format(v['start']).."-"..("%04d"):format(v['end'])..") "..acred..v['name']..acoff)
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
io.write("("..("%04d"):format(v['start']).."-"..("%04d"):format(v['end'])..") "..((v['highlight']) and acmagenta or acyellow)..v['name']..acoff..":")
|
io.write("("..("%04d"):format(v['start']).."-"..("%04d"):format(v['end'])..") "..((v['highlight']) and acmagenta or acyellow)..v['name']..acoff)
|
||||||
end
|
end
|
||||||
|
|
||||||
temp = ""
|
temp = ""
|
||||||
for i=((string.len(v['name']))/10), 2 do
|
while (#v['name'] + temp:len()) < 20 do temp = temp.." " end
|
||||||
temp=temp.."\t"
|
|
||||||
end
|
|
||||||
for i=v['start'], v['end'] do
|
for i=v['start'], v['end'] do
|
||||||
temp=temp..bytes[i].." "
|
temp=temp..bytes[i].." "
|
||||||
end
|
end
|
||||||
|
|
||||||
print(temp)
|
print(temp)
|
||||||
lastend=v['end']
|
lastend=v['end']
|
||||||
end
|
end
|
||||||
|
@ -1001,10 +1009,21 @@ end
|
||||||
-- edit existing Map
|
-- edit existing Map
|
||||||
function editTagMap(tag, tagMap)
|
function editTagMap(tag, tagMap)
|
||||||
local t = [[
|
local t = [[
|
||||||
Data: dm = show dr = dump raw
|
]]..acc..[[Data]]..acr..[[
|
||||||
Mappings: im = insert am = add rm = remove
|
|
||||||
CRC8: ac8 = add sc8 = show rc8 = remove
|
]]..acy..[[dm]]..acr..[[ - show ]]..acy..[[dr]]..acr..[[ - dump raw
|
||||||
: q = exit h = Help
|
|
||||||
|
]]..acc..[[Mappings]]..acr..[[
|
||||||
|
|
||||||
|
]]..acy..[[im]]..acr..[[ - insert ]]..acy..[[am]]..acr..[[ - add
|
||||||
|
]]..acy..[[rm]]..acr..[[ - remove ]]..acy..[[mas]]..acr..[[ - map all segments
|
||||||
|
|
||||||
|
]]..acc..[[CRC8]]..acr..[[
|
||||||
|
|
||||||
|
]]..acy..[[ac8]]..acr..[[ - add ]]..acy..[[sc8]]..acr..[[ - show
|
||||||
|
]]..acy..[[rc8]]..acr..[[ - remove
|
||||||
|
|
||||||
|
]]..acy..[[q]]..acr..[[ - exit ]]..acy..[[h]]..acr..[[ - Help
|
||||||
]]
|
]]
|
||||||
|
|
||||||
--if(#tagMap.mappings==0) then oops("no mappings in tagMap"); return tagMap end
|
--if(#tagMap.mappings==0) then oops("no mappings in tagMap"); return tagMap end
|
||||||
|
@ -2341,11 +2360,11 @@ function modifyHelp()
|
||||||
|
|
||||||
Virtual Tags tagMap (partial) known Segments
|
Virtual Tags tagMap (partial) known Segments
|
||||||
-------------------------------- --------------------- ---------------------------
|
-------------------------------- --------------------- ---------------------------
|
||||||
]]..acy..[[xf]]..acr..[[ => copy mainTag to backupTag ]]..acy..[[mm]]..acr..[[ => make (new) Map ]]..acy..[[dlc]]..acr..[[ => dump Legic-Cash
|
]]..acy..[[ct]]..acr..[[ => copy mainTag to backupTag ]]..acy..[[mm]]..acr..[[ => make (new) Map ]]..acy..[[dlc]]..acr..[[ => dump Legic-Cash
|
||||||
]]..acy..[[xf]]..acr..[[ => copy backupTag to mainTag ]]..acy..[[em]]..acr..[[ => edit Map submenu ]]..acy..[[elc]]..acr..[[ => edit Legic-Cash
|
]]..acy..[[tc]]..acr..[[ => copy backupTag to mainTag ]]..acy..[[em]]..acr..[[ => edit Map submenu ]]..acy..[[elc]]..acr..[[ => edit Legic-Cash
|
||||||
]]..acy..[[xf]]..acr..[[ => switch mainTag & backupTag ]]..acy..[[lm]]..acr..[[ => load map from file ]]..acy..[[d3p]]..acr..[[ => dump 3rd-Party-Cash
|
]]..acy..[[tt]]..acr..[[ => switch mainTag & backupTag ]]..acy..[[lm]]..acr..[[ => load map from file ]]..acy..[[d3p]]..acr..[[ => dump 3rd-Party-Cash
|
||||||
]]..acy..[[xf]]..acr..[[ => dump mainTag ]]..acy..[[sm]]..acr..[[ => save map to file ]]..acy..[[e3p]]..acr..[[ => edit 3rd-Party-Cash
|
]]..acy..[[di]]..acr..[[ => dump mainTag ]]..acy..[[sm]]..acr..[[ => save map to file ]]..acy..[[e3p]]..acr..[[ => edit 3rd-Party-Cash
|
||||||
]]..acy..[[xf]]..acr..[[ => dump backupTag
|
]]..acy..[[do]]..acr..[[ => dump backupTag
|
||||||
|
|
||||||
]]..acy..[[h]]..acr..[[ => this help ]]..acy..[[q]]..acr..[[ => quit
|
]]..acy..[[h]]..acr..[[ => this help ]]..acy..[[q]]..acr..[[ => quit
|
||||||
]]
|
]]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue