mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-21 05:43:48 -07:00
fix: 'script run legic' - bytes was in string format,
This commit is contained in:
parent
48c71aeef6
commit
d792f015a2
1 changed files with 8 additions and 5 deletions
|
@ -653,14 +653,17 @@ local function save_BIN(data, filename)
|
||||||
|
|
||||||
outfile = io.open(fn, 'wb')
|
outfile = io.open(fn, 'wb')
|
||||||
|
|
||||||
|
local bytes = utils.ConvertHexToBytes(data)
|
||||||
|
|
||||||
local i = 1
|
local i = 1
|
||||||
while data[i] do
|
while bytes[i] do
|
||||||
outfile:write(data[i])
|
|
||||||
|
outfile:write(bytes[i])
|
||||||
i = i + 1
|
i = i + 1
|
||||||
end
|
end
|
||||||
|
|
||||||
outfile:close()
|
outfile:close()
|
||||||
return fn
|
return fn, #bytes
|
||||||
end
|
end
|
||||||
---
|
---
|
||||||
-- write bytes to file
|
-- write bytes to file
|
||||||
|
@ -698,10 +701,10 @@ function writeFile(bytes, filename)
|
||||||
fho:close()
|
fho:close()
|
||||||
|
|
||||||
-- save binary
|
-- save binary
|
||||||
local fn_bin = save_BIN(bytes, filename)
|
local fn_bin, num_of_bytes = save_BIN(bytes, filename)
|
||||||
|
|
||||||
print("\nwrote ".. #bytes * 3 .." bytes to " .. filename)
|
print("\nwrote ".. #bytes * 3 .." bytes to " .. filename)
|
||||||
print("\nwrote ".. #bytes .." bytes to " .. fn_bin)
|
print("\nwrote ".. num_of_bytes .." bytes to " .. fn_bin)
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue