mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-21 05:43:48 -07:00
textual
This commit is contained in:
parent
89e25a4d1d
commit
9c95a2e8aa
1 changed files with 34 additions and 21 deletions
|
@ -1,39 +1,52 @@
|
||||||
local getopt = require('getopt')
|
local getopt = require('getopt')
|
||||||
local utils = require('utils')
|
local utils = require('utils')
|
||||||
|
|
||||||
example = "script calculates many different checksums (CRC) over the provided hex input"
|
copyright = ''
|
||||||
author = "Iceman"
|
author = 'Iceman'
|
||||||
desc =
|
version = 'v1.0.1'
|
||||||
[[
|
desc = [[
|
||||||
This script calculates many checksums (CRC) over the provided hex input.
|
This script calculates many checksums (CRC) over the provided hex input.
|
||||||
|
]]
|
||||||
Arguments:
|
example = [[
|
||||||
-b data in hex
|
|
||||||
-w bitwidth of the CRC family of algorithm. <optional> defaults to all known CRC presets.
|
|
||||||
Examples :
|
|
||||||
script run e -b 010203040506070809
|
script run e -b 010203040506070809
|
||||||
script run e -b 010203040506070809 -w 16
|
script run e -b 010203040506070809 -w 16
|
||||||
]]
|
]]
|
||||||
|
usage = [[
|
||||||
|
Arguments:
|
||||||
|
-b data in hex
|
||||||
|
-w bitwidth of the CRC family of algorithm. <optional> defaults to all known CRC presets.
|
||||||
|
]]
|
||||||
---
|
---
|
||||||
-- A debug printout-function
|
-- A debug printout-function
|
||||||
function dbg(args)
|
local function dbg(args)
|
||||||
if DEBUG then
|
if not DEBUG then return end
|
||||||
print("###", args)
|
if type(args) == 'table' then
|
||||||
|
local i = 1
|
||||||
|
while args[i] do
|
||||||
|
dbg(args[i])
|
||||||
|
i = i+1
|
||||||
|
end
|
||||||
|
else
|
||||||
|
print('###', args)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
---
|
---
|
||||||
-- This is only meant to be used when errors occur
|
-- This is only meant to be used when errors occur
|
||||||
function oops(err)
|
local function oops(err)
|
||||||
print("[!] ERROR: ",err)
|
print('ERROR:', err)
|
||||||
return nil,err
|
core.clearCommandBuffer()
|
||||||
|
return nil, err
|
||||||
end
|
end
|
||||||
---
|
---
|
||||||
-- Usage help
|
-- Usage help
|
||||||
function help()
|
local function help()
|
||||||
|
print(copyright)
|
||||||
|
print(author)
|
||||||
|
print(version)
|
||||||
print(desc)
|
print(desc)
|
||||||
print("Example usage")
|
print('Example usage')
|
||||||
print(example)
|
print(example)
|
||||||
|
print(usage)
|
||||||
end
|
end
|
||||||
---
|
---
|
||||||
-- The main entry point
|
-- The main entry point
|
||||||
|
@ -44,9 +57,9 @@ function main(args)
|
||||||
|
|
||||||
-- Read the parameters
|
-- Read the parameters
|
||||||
for o, a in getopt.getopt(args, 'hb:w:') do
|
for o, a in getopt.getopt(args, 'hb:w:') do
|
||||||
if o == "h" then return help() end
|
if o == 'h' then return help() end
|
||||||
if o == "b" then data = a end
|
if o == 'b' then data = a end
|
||||||
if o == "w" then width = a end
|
if o == 'w' then width = a end
|
||||||
end
|
end
|
||||||
|
|
||||||
data = data or '01020304'
|
data = data or '01020304'
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue