helptext colors

This commit is contained in:
iceman1001 2020-04-05 10:05:14 +02:00
commit 3464dc2ebe
12 changed files with 110 additions and 59 deletions

View file

@ -1,10 +1,11 @@
local cmds = require('commands') local cmds = require('commands')
local getopt = require('getopt') local getopt = require('getopt')
local lib14a = require('read14a') local lib14a = require('read14a')
local ansicolors = require('ansicolors')
copyright = '' copyright = ''
author = "Martin Holst Swende" author = "Martin Holst Swende"
version = 'v1.0.1' version = 'v1.0.2'
desc = [[ desc = [[
This is a script to allow raw 1444a commands to be sent and received. This is a script to allow raw 1444a commands to be sent and received.
]] ]]
@ -23,8 +24,8 @@ example = [[
]] ]]
usage = [[ usage = [[
script run 14araw -x 6000F57b script run 14araw -x 6000F57b
]]
Arguments: arguments = [[
-o do not connect - use this only if you previously used -p to stay connected -o do not connect - use this only if you previously used -p to stay connected
-r do not read response -r do not read response
-c calculate and append CRC -c calculate and append CRC
@ -79,9 +80,12 @@ local function help()
print(author) print(author)
print(version) print(version)
print(desc) print(desc)
print('Example usage') print(ansicolors.cyan..'Usage'..ansicolors.reset)
print(example)
print(usage) print(usage)
print(ansicolors.cyan..'Arguments'..ansicolors.reset)
print(arguments)
print(ansicolors.cyan..'Example usage'..ansicolors.reset)
print(example)
end end
--- ---
-- The main entry point -- The main entry point

View file

@ -1,8 +1,9 @@
local getopt = require('getopt') local getopt = require('getopt')
local ansicolors = require('ansicolors')
copyright = '' copyright = ''
author = 'Kenzy Carey' author = 'Kenzy Carey'
version = 'v1.0.1' version = 'v1.0.2'
desc = [[ desc = [[
.-----------------------------------------------------------------. .-----------------------------------------------------------------.
@ -34,10 +35,9 @@ example = [[
script run brutesim -r pyramid -f 10 -b 1000 -c 10 -t 1 -d down script run brutesim -r pyramid -f 10 -b 1000 -c 10 -t 1 -d down
]] ]]
usage = [[ usage = [[
script run brutesim -r rfid_tag -f facility_code -b base_card_number -c count -t timeout -d direction script run brutesim -r rfid_tag -f facility_code -b base_card_number -c count -t timeout -d direction
]]
Arguments: arguments = [[
-h this help -h this help
-r *see below RFID Tag: the RFID tag to emulate -r *see below RFID Tag: the RFID tag to emulate
pyramid pyramid
@ -89,9 +89,12 @@ local function help()
print(author) print(author)
print(version) print(version)
print(desc) print(desc)
print('Example usage') print(ansicolors.cyan..'Usage'..ansicolors.reset)
print(example)
print(usage) print(usage)
print(ansicolors.cyan..'Arguments'..ansicolors.reset)
print(arguments)
print(ansicolors.cyan..'Example usage'..ansicolors.reset)
print(example)
end end
-- --
-- Exit message -- Exit message

View file

@ -2,10 +2,11 @@ local bin = require('bin')
local getopt = require('getopt') local getopt = require('getopt')
local lib14a = require('read14a') local lib14a = require('read14a')
local utils = require('utils') local utils = require('utils')
local ansicolors = require('ansicolors')
copyright = '' copyright = ''
author = "Iceman" author = "Iceman"
version = 'v1.0.0' version = 'v1.0.1'
desc = [[ desc = [[
This script calculates mifare keys based on uid diversification for DI. This script calculates mifare keys based on uid diversification for DI.
Algo not found by me. Algo not found by me.
@ -19,8 +20,8 @@ example = [[
]] ]]
usage = [[ usage = [[
script run calc_di -h -u <uid> script run calc_di -h -u <uid>
]]
Arguments: arguments = [[
-h : this help -h : this help
-u <UID> : UID -u <UID> : UID
]] ]]
@ -57,9 +58,12 @@ local function help()
print(author) print(author)
print(version) print(version)
print(desc) print(desc)
print('Example usage') print(ansicolors.cyan..'Usage'..ansicolors.reset)
print(example)
print(usage) print(usage)
print(ansicolors.cyan..'Arguments'..ansicolors.reset)
print(arguments)
print(ansicolors.cyan..'Example usage'..ansicolors.reset)
print(example)
end end
--- ---
-- Exit message -- Exit message

View file

@ -2,10 +2,11 @@ local bin = require('bin')
local getopt = require('getopt') local getopt = require('getopt')
local lib14a = require('read14a') local lib14a = require('read14a')
local utils = require('utils') local utils = require('utils')
local ansicolors = require('ansicolors')
copyright = '' copyright = ''
author = "Iceman" author = "Iceman"
version = 'v1.0.0' version = 'v1.0.1'
desc = [[ desc = [[
This script calculates mifare Ultralight-EV1 pwd based on uid diversification for an Italian ticketsystem This script calculates mifare Ultralight-EV1 pwd based on uid diversification for an Italian ticketsystem
Algo not found by me. Algo not found by me.
@ -19,8 +20,8 @@ example =[[
]] ]]
usage = [[ usage = [[
script run calc_ev1_it -h -u <uid> " script run calc_ev1_it -h -u <uid> "
]]
Arguments: arguments = [[
-h : this help -h : this help
-u <UID> : UID -u <UID> : UID
]] ]]
@ -55,9 +56,12 @@ local function help()
print(author) print(author)
print(version) print(version)
print(desc) print(desc)
print("Example usage") print(ansicolors.cyan..'Usage'..ansicolors.reset)
print(example)
print(usage) print(usage)
print(ansicolors.cyan..'Arguments'..ansicolors.reset)
print(arguments)
print(ansicolors.cyan..'Example usage'..ansicolors.reset)
print(example)
end end
-- --
-- Exit message -- Exit message

View file

@ -2,10 +2,11 @@ local bin = require('bin')
local getopt = require('getopt') local getopt = require('getopt')
local lib14a = require('read14a') local lib14a = require('read14a')
local utils = require('utils') local utils = require('utils')
local ansicolors = require('ansicolors')
copyright = '' copyright = ''
author = 'Iceman' author = 'Iceman'
version = 'v1.0.1' version = 'v1.0.2'
desc = [[ desc = [[
This script calculates mifare keys based on uid diversification for mizip. This script calculates mifare keys based on uid diversification for mizip.
Algo not found by me. Algo not found by me.
@ -19,8 +20,8 @@ example = [[
]] ]]
usage = [[ usage = [[
script run calc_mizip -h -u <uid> script run calc_mizip -h -u <uid>
]]
Arguments: arguments = [[
-h : this help -h : this help
-u <UID> : UID -u <UID> : UID
]] ]]
@ -62,9 +63,12 @@ local function help()
print(author) print(author)
print(version) print(version)
print(desc) print(desc)
print("Example usage") print(ansicolors.cyan..'Usage'..ansicolors.reset)
print(example)
print(usage) print(usage)
print(ansicolors.cyan..'Arguments'..ansicolors.reset)
print(arguments)
print(ansicolors.cyan..'Example usage'..ansicolors.reset)
print(example)
end end
-- --
-- Exit message -- Exit message

View file

@ -3,10 +3,11 @@ local getopt = require('getopt')
local lib14b = require('read14b') local lib14b = require('read14b')
local utils = require('utils') local utils = require('utils')
local iso7816 = require('7816_error') local iso7816 = require('7816_error')
local ansicolors = require('ansicolors')
copyright = '' copyright = ''
author = 'Iceman' author = 'Iceman'
version = 'v1.0.1' version = 'v1.0.2'
desc = [[ desc = [[
This is a script to communicate with a CALYSPO / 14443b tag using the '14b raw' commands This is a script to communicate with a CALYSPO / 14443b tag using the '14b raw' commands
]] ]]
@ -16,8 +17,8 @@ example = [[
]] ]]
usage = [[ usage = [[
script run calypso -h -b script run calypso -h -b
]]
Arguments: arguments = [[
h this helptext h this helptext
b raw bytes to send b raw bytes to send
]] ]]
@ -66,9 +67,12 @@ local function help()
print(author) print(author)
print(version) print(version)
print(desc) print(desc)
print('Example usage') print(ansicolors.cyan..'Usage'..ansicolors.reset)
print(example)
print(usage) print(usage)
print(ansicolors.cyan..'Arguments'..ansicolors.reset)
print(arguments)
print(ansicolors.cyan..'Example usage'..ansicolors.reset)
print(example)
end end
-- --
-- helper function, give current count of items in lua-table. -- helper function, give current count of items in lua-table.

View file

@ -6,10 +6,11 @@ local utils = require('utils')
local lib14a = require('read14a') local lib14a = require('read14a')
local json = require('dkjson') local json = require('dkjson')
local toys = require('default_toys_di') local toys = require('default_toys_di')
local ansicolors = require('ansicolors')
copyright = '' copyright = ''
author = 'Iceman' author = 'Iceman'
version = 'v1.0.1' version = 'v1.0.2'
desc = [[ desc = [[
This is a script to dump and decrypt the data of a specific type of Mifare Mini token. This is a script to dump and decrypt the data of a specific type of Mifare Mini token.
The dump is decrypted. If a raw dump is wanted, use the -r parameter The dump is decrypted. If a raw dump is wanted, use the -r parameter
@ -28,8 +29,8 @@ example = [[
]] ]]
usage = [[ usage = [[
script run didump -h -t -r -d -e -v -i dumpdata.json script run didump -h -t -r -d -e -v -i dumpdata.json
]]
Arguments: arguments = [[
h this helptext h this helptext
r raw r raw
t selftest t selftest
@ -88,9 +89,12 @@ local function help()
print(author) print(author)
print(version) print(version)
print(desc) print(desc)
print('Example usage') print(ansicolors.cyan..'Usage'..ansicolors.reset)
print(example)
print(usage) print(usage)
print(ansicolors.cyan..'Arguments'..ansicolors.reset)
print(arguments)
print(ansicolors.cyan..'Example usage'..ansicolors.reset)
print(example)
end end
--- ---
-- --

View file

@ -2,10 +2,11 @@
-- Have a look there for further details -- Have a look there for further details
getopt = require('getopt') getopt = require('getopt')
bin = require('bin') bin = require('bin')
local ansicolors = require('ansicolors')
copyright = '' copyright = ''
author = "Martin Holst Swende \n @Marshmellow \n @iceman" author = "Martin Holst Swende \n @Marshmellow \n @iceman"
version = 'v1.0.1' version = 'v1.0.2'
desc =[[ desc =[[
This script takes a dumpfile from 'hf mfu dump' and converts it to a format that can be used This script takes a dumpfile from 'hf mfu dump' and converts it to a format that can be used
by the emulator by the emulator
@ -15,8 +16,8 @@ example = [[
]] ]]
usage = [[ usage = [[
script run dumptoemul-mfu [-i <file>] [-o <file>] script run dumptoemul-mfu [-i <file>] [-o <file>]
]]
Arguments: arguments = [[
-h This help -h This help
-i <file> Specifies the dump-file (input). If omitted, 'dumpdata.bin' is used -i <file> Specifies the dump-file (input). If omitted, 'dumpdata.bin' is used
-o <filename> Specifies the output file. If omitted, <uid>.eml is used. -o <filename> Specifies the output file. If omitted, <uid>.eml is used.
@ -53,9 +54,12 @@ local function help()
print(author) print(author)
print(version) print(version)
print(desc) print(desc)
print('Example usage') print(ansicolors.cyan..'Usage'..ansicolors.reset)
print(example)
print(usage) print(usage)
print(ansicolors.cyan..'Arguments'..ansicolors.reset)
print(arguments)
print(ansicolors.cyan..'Example usage'..ansicolors.reset)
print(example)
end end
local function convert_to_ascii(hexdata) local function convert_to_ascii(hexdata)

View file

@ -2,10 +2,11 @@
-- Have a look there for further details -- Have a look there for further details
getopt = require('getopt') getopt = require('getopt')
bin = require('bin') bin = require('bin')
local ansicolors = require('ansicolors')
copyright = '' copyright = ''
author = 'Martin Holst Swende' author = 'Martin Holst Swende'
version = 'v1.0.1' version = 'v1.0.2'
desc = [[ desc = [[
This script takes a dumpfile from 'hf mf dump' and converts it to a format that can be used This script takes a dumpfile from 'hf mf dump' and converts it to a format that can be used
by the emulator by the emulator
@ -14,9 +15,9 @@ example = [[
script run dumptoemul -i dumpdata-foobar.bin script run dumptoemul -i dumpdata-foobar.bin
]] ]]
usage = [[ usage = [[
_script run dumptoemul [-i <file>] [-o <file>] script run dumptoemul [-i <file>] [-o <file>]
]]
Arguments: arguments = [[
-h This help -h This help
-i <file> Specifies the dump-file (input). If omitted, 'dumpdata.bin' is used -i <file> Specifies the dump-file (input). If omitted, 'dumpdata.bin' is used
-o <filename> Specifies the output file. If omitted, <uid>.eml is used. -o <filename> Specifies the output file. If omitted, <uid>.eml is used.
@ -56,9 +57,12 @@ function help()
print(author) print(author)
print(version) print(version)
print(desc) print(desc)
print('Example usage') print(ansicolors.cyan..'Usage'..ansicolors.reset)
print(example)
print(usage) print(usage)
print(ansicolors.cyan..'Arguments'..ansicolors.reset)
print(arguments)
print(ansicolors.cyan..'Example usage'..ansicolors.reset)
print(example)
end end
local function convert_to_ascii(hexdata) local function convert_to_ascii(hexdata)

View file

@ -1,9 +1,10 @@
local getopt = require('getopt') local getopt = require('getopt')
local utils = require('utils') local utils = require('utils')
local ansicolors = require('ansicolors')
copyright = '' copyright = ''
author = 'Iceman' author = 'Iceman'
version = 'v1.0.1' version = 'v1.0.2'
desc = [[ desc = [[
This script calculates many checksums (CRC) over the provided hex input. This script calculates many checksums (CRC) over the provided hex input.
]] ]]
@ -12,7 +13,9 @@ example = [[
script run e -b 010203040506070809 -w 16 script run e -b 010203040506070809 -w 16
]] ]]
usage = [[ usage = [[
Arguments: script run e [-b <hex bytes] [-w <width>]
]]
arguments = [[
-b data in hex -b data in hex
-w bitwidth of the CRC family of algorithm. <optional> defaults to all known CRC presets. -w bitwidth of the CRC family of algorithm. <optional> defaults to all known CRC presets.
]] ]]
@ -44,9 +47,12 @@ local function help()
print(author) print(author)
print(version) print(version)
print(desc) print(desc)
print('Example usage') print(ansicolors.cyan..'Usage'..ansicolors.reset)
print(example)
print(usage) print(usage)
print(ansicolors.cyan..'Arguments'..ansicolors.reset)
print(arguments)
print(ansicolors.cyan..'Example usage'..ansicolors.reset)
print(example)
end end
--- ---
-- The main entry point -- The main entry point

View file

@ -5,7 +5,7 @@ local ansicolors = require('ansicolors')
copyright = '' copyright = ''
author = 'Iceman' author = 'Iceman'
version = 'v1.0.1' version = 'v1.0.2'
desc =[[ desc =[[
This script takes an dumpfile on EML (ASCII) format and converts it to the PM3 dumpbin file to be used with `hf mf restore` This script takes an dumpfile on EML (ASCII) format and converts it to the PM3 dumpbin file to be used with `hf mf restore`
]] ]]
@ -17,7 +17,6 @@ example =[[
usage = [[ usage = [[
script run emul2dump [-i <file>] [-o <file>] script run emul2dump [-i <file>] [-o <file>]
]] ]]
arguments = [[ arguments = [[
-h This help -h This help
-i <filename> Specifies the dump-file (input). If omitted, 'dumpdata.eml' is used -i <filename> Specifies the dump-file (input). If omitted, 'dumpdata.eml' is used
@ -26,7 +25,7 @@ arguments = [[
]] ]]
--- ---
-- This is only meant to be used when errors occur -- This is only meant to be used when errors occur
local function oops(err) local function dbg(err)
if not DEBUG then return end if not DEBUG then return end
if type(args) == 'table' then if type(args) == 'table' then
local i = 1 local i = 1
@ -39,6 +38,13 @@ local function oops(err)
end end
end end
--- ---
-- This is only meant to be used when errors occur
local function oops(err)
print('ERROR:', err)
core.clearCommandBuffer()
return nil, err
end
---
-- Usage help -- Usage help
local function help() local function help()
print(copyright) print(copyright)

View file

@ -3,10 +3,11 @@
getopt = require('getopt') getopt = require('getopt')
bin = require('bin') bin = require('bin')
dumplib = require('html_dumplib') dumplib = require('html_dumplib')
local ansicolors = require('ansicolors')
copyright = '' copyright = ''
author = 'Martin Holst Swende' author = 'Martin Holst Swende'
version = 'v1.0.1' version = 'v1.0.2'
desc = [[ desc = [[
This script takes a dumpfile on EML (ASCII) format and produces a html based dump, which is a This script takes a dumpfile on EML (ASCII) format and produces a html based dump, which is a
bit more easily analyzed. bit more easily analyzed.
@ -16,8 +17,8 @@ example = [[
]] ]]
usage = [[ usage = [[
script run htmldump [-i <file>] [-o <file>] script run htmldump [-i <file>] [-o <file>]
]]
Arguments: arguments = [[
-h This help -h This help
-i <file> Specifies the dump-file (input). If omitted, 'dumpdata.eml' is used -i <file> Specifies the dump-file (input). If omitted, 'dumpdata.eml' is used
-o <filename> Speciies the output file. If omitted, <curdate>.html is used. -o <filename> Speciies the output file. If omitted, <curdate>.html is used.
@ -54,9 +55,12 @@ local function help()
print(author) print(author)
print(version) print(version)
print(desc) print(desc)
print('Example usage') print(ansicolors.cyan..'Usage'..ansicolors.reset)
print(example)
print(usage) print(usage)
print(ansicolors.cyan..'Arguments'..ansicolors.reset)
print(arguments)
print(ansicolors.cyan..'Example usage'..ansicolors.reset)
print(example)
end end
local function main(args) local function main(args)