mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-03-20 12:07:05 +08:00
Start fixing legic.lua ! Now loads dumps fine
This commit is contained in:
parent
7b8cbd38a8
commit
bf413f1b87
1 changed files with 308 additions and 308 deletions
|
@ -296,6 +296,7 @@ function file_check(file_name)
|
|||
if file_found==nil then
|
||||
return false
|
||||
else
|
||||
file_found:close()
|
||||
return true
|
||||
end
|
||||
end
|
||||
|
@ -339,14 +340,13 @@ end
|
|||
function getInputBytes(infile)
|
||||
local line
|
||||
local bytes = {}
|
||||
local fhi,err = io.open(infile)
|
||||
local fhi,err = io.open(infile,"rb")
|
||||
if err then oops("faild to read from file ".. infile); return false; end
|
||||
while true do
|
||||
line = fhi:read()
|
||||
if line == nil then break end
|
||||
for byte in line:gmatch("%w+") do
|
||||
table.insert(bytes, byte)
|
||||
end
|
||||
|
||||
file_data = fhi:read("*a");
|
||||
for i = 1, #file_data
|
||||
do
|
||||
bytes[i] = string.format("%x",file_data:byte(i))
|
||||
end
|
||||
fhi:close()
|
||||
if (bytes[7]=='00') then return false end
|
||||
|
@ -507,8 +507,8 @@ function readFromPM3()
|
|||
local tag, bytes, infile
|
||||
infile="legic.temp"
|
||||
core.console("hf legic reader")
|
||||
core.console("hf legic save "..infile)
|
||||
tag=readFile(infile)
|
||||
core.console("hf legic esave "..infile)
|
||||
tag=readFile(infile..".bin")
|
||||
return tag
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue