mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-20 21:33:47 -07:00
textual
This commit is contained in:
parent
36ecc4be97
commit
586e2ebabd
1 changed files with 36 additions and 36 deletions
|
@ -580,7 +580,7 @@ function writeToTag(tag)
|
||||||
|
|
||||||
-- write data to file
|
-- write data to file
|
||||||
if (taglen > 0) then
|
if (taglen > 0) then
|
||||||
WriteBytes = utils.input(acyellow.."enter number of bytes to write?"..acoff, taglen)
|
WriteBytes = input(acyellow.."enter number of bytes to write?"..acoff, taglen)
|
||||||
-- load file into pm3-buffer
|
-- load file into pm3-buffer
|
||||||
if (type(filename) ~= "string") then
|
if (type(filename) ~= "string") then
|
||||||
filename = input(acyellow.."filename to load to pm3-buffer?"..acoff, "legic.temp")
|
filename = input(acyellow.."filename to load to pm3-buffer?"..acoff, "legic.temp")
|
||||||
|
@ -619,7 +619,7 @@ local function readFile(filename)
|
||||||
local bytes = {}
|
local bytes = {}
|
||||||
local tag = {}
|
local tag = {}
|
||||||
if file_check(filename) == false then
|
if file_check(filename) == false then
|
||||||
return oops("input file: "..filename.." not found")
|
return oops("input file: "..acyellow..filename..acoff.." not found")
|
||||||
end
|
end
|
||||||
|
|
||||||
bytes = getInputBytes(filename)
|
bytes = getInputBytes(filename)
|
||||||
|
@ -728,16 +728,16 @@ end
|
||||||
---
|
---
|
||||||
-- save mapping to file
|
-- save mapping to file
|
||||||
local function saveTagMap(map, filename)
|
local function saveTagMap(map, filename)
|
||||||
if (string.len(filename)>0) then
|
if #filename > 0 then
|
||||||
if (file_check(filename)) then
|
if file_check(filename) then
|
||||||
local answer = confirm("\nthe output-file "..filename.." alredy exists!\nthis will delete the previous content!\ncontinue?")
|
local answer = confirm("\nthe output-file "..acyellow..filename..acoff.." alredy exists!\nthis will delete the previous content!\ncontinue?")
|
||||||
if not answer then return print("user abort") end
|
if not answer then return print("user abort") end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local line
|
local line
|
||||||
local fho,err = io.open(filename, "w")
|
local fho,err = io.open(filename, "w")
|
||||||
if err then oops("OOps ... faild to open output-file ".. filename) end
|
if err then oops("OOps ... faild to open output-file "..acyellow..filename..acoff) end
|
||||||
|
|
||||||
-- write line to new file
|
-- write line to new file
|
||||||
for k, v in pairs(map) do
|
for k, v in pairs(map) do
|
||||||
|
@ -812,8 +812,8 @@ function loadTagMap(filename)
|
||||||
local line, fields
|
local line, fields
|
||||||
local temp={}
|
local temp={}
|
||||||
local offset=0
|
local offset=0
|
||||||
if (file_check(filename)==false) then
|
if not file_check(filename) then
|
||||||
return oops("input file: "..filename.." not found")
|
return oops("input file: "..acyellow..filename..acoff.." not found")
|
||||||
else
|
else
|
||||||
local fhi,err = io.open(filename)
|
local fhi,err = io.open(filename)
|
||||||
while true do
|
while true do
|
||||||
|
@ -1290,7 +1290,7 @@ function dumpCDF(tag)
|
||||||
end
|
end
|
||||||
|
|
||||||
return res
|
return res
|
||||||
else print("no valid Tag in dumpCDF") end
|
else print(acred.."no valid Tag in dumpCDF"..acoff) end
|
||||||
end
|
end
|
||||||
|
|
||||||
---
|
---
|
||||||
|
@ -1350,7 +1350,7 @@ function dumpSegment(tag, index)
|
||||||
dp=0
|
dp=0
|
||||||
return res
|
return res
|
||||||
else
|
else
|
||||||
return print("Segment not found")
|
return print(acred.."Segment not found"..acoff)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -2351,11 +2351,11 @@ function modifyMode()
|
||||||
---
|
---
|
||||||
-- save values of mainTAG to a file (xored with MCC of mainTAG)
|
-- save values of mainTAG to a file (xored with MCC of mainTAG)
|
||||||
["sf"] = function(x)
|
["sf"] = function(x)
|
||||||
if(istable(inTAG)) then
|
if istable(inTAG) then
|
||||||
outfile = input("enter filename:", "legic.temp")
|
outfile = input("enter filename:", "legic.temp")
|
||||||
bytes = tagToBytes(inTAG)
|
bytes = tagToBytes(inTAG)
|
||||||
--bytes=xorBytes(bytes, inTAG.MCC)
|
--bytes=xorBytes(bytes, inTAG.MCC)
|
||||||
if (bytes) then
|
if bytes then
|
||||||
writeFile(bytes, outfile)
|
writeFile(bytes, outfile)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -2363,10 +2363,10 @@ function modifyMode()
|
||||||
---
|
---
|
||||||
-- save values of mainTAG to a file (xored with 'specific' MCC)
|
-- save values of mainTAG to a file (xored with 'specific' MCC)
|
||||||
["xf"] = function(x)
|
["xf"] = function(x)
|
||||||
if(istable(inTAG)) then
|
if istable(inTAG) then
|
||||||
outfile = input("enter filename:", "legic.temp")
|
outfile = input("enter filename:", "legic.temp")
|
||||||
crc = input("enter new crc: ('00' for a plain dump)", inTAG.MCC)
|
crc = input("enter new crc: ('00' for a plain dump)", inTAG.MCC)
|
||||||
print("obfuscate witth: "..crc)
|
print("obfuscate with: "..crc)
|
||||||
bytes=tagToBytes(inTAG)
|
bytes=tagToBytes(inTAG)
|
||||||
bytes[5]=crc
|
bytes[5]=crc
|
||||||
if (bytes) then
|
if (bytes) then
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue