This commit is contained in:
iceman1001 2020-04-05 12:49:25 +02:00
commit 2474385ab0
5 changed files with 66 additions and 45 deletions

View file

@ -1,19 +1,31 @@
-- The getopt-functionality is loaded from pm3/getopt.lua
-- Have a look there for further details
getopt = require('getopt')
local getopt = require('getopt')
local ansicolors = require('ansicolors')
copyright = ''
usage = 'script run parameters.lua -a 1 -blala -c -de'
author = 'Martin Holst Swende'
version = 'v1.0.1'
version = 'v1.0.2'
desc = [[
This is an example script to demonstrate handle parameters in scripts.
For more info, check the comments in the code
]]
example = [[
1. script run parameters -a mytestparam_input -c
]]
usage = [[
script run parameters [-h] [-a <txt>] [-b <txt>] [-c] [-d] [-e]
]]
arguments = [[
-h This help
-a <txt> text
-b <txt> text
-c test param w/o input
-d test param w/o input
-e test param w/o input
]]
---
-- Usage help
local function help()
@ -21,9 +33,12 @@ local function help()
print(author)
print(version)
print(desc)
print('Example usage')
print(example)
print(ansicolors.cyan..'Usage'..ansicolors.reset)
print(usage)
print(ansicolors.cyan..'Arguments'..ansicolors.reset)
print(arguments)
print(ansicolors.cyan..'Example usage'..ansicolors.reset)
print(example)
end
local function main(args)

View file

@ -1,11 +1,11 @@
local getopt = require('getopt')
local bin = require('bin')
local ansicolors = require('ansicolors')
copyright = 'Copyright (c) 2018 Bogito. All rights reserved.'
author = 'Bogito'
version = 'v1.0.3'
desc =
[[
version = 'v1.0.4'
desc = [[
This script will read the flash memory of RDV4 and print the stored passwords/keys.
It was meant to be used as a help tool after using the BogRun standalone mode before SPIFFS.
@ -13,8 +13,7 @@ You should now use read_pwd_mem_spiffs instead after the updated BogRun standalo
(Iceman) script adapted to read and print keys in the default dictionary flashmemory sections.
]]
example =
[[
example = [[
-- This will scan the first 256 bytes of flash memory for stored passwords
script run read_pwd_mem
@ -33,12 +32,10 @@ example =
-- This will print the stored iClass dictionary keys
script run read_pwd_mem -i
]]
usage =
[[
Usage:
script run read_pwd_mem -h -o <offset> -l <length> -k <keylength>
Arguments:
usage = [[
script run read_pwd_mem [-h] [-o <offset>] [-l <length>] [-k <keylength>] [-m] [-t] [-i]
]]
arguments = [[
-h : this help
-o <offset> : memory offset, default is 0
-l <length> : length in bytes, default is 256
@ -61,9 +58,12 @@ local function help()
print(author)
print(version)
print(desc)
print('Example usage')
print(example)
print(ansicolors.cyan..'Usage'..ansicolors.reset)
print(usage)
print(ansicolors.cyan..'Arguments'..ansicolors.reset)
print(arguments)
print(ansicolors.cyan..'Example usage'..ansicolors.reset)
print(example)
end
---
-- The main entry point

View file

@ -1,16 +1,15 @@
local getopt = require('getopt')
local bin = require('bin')
local ansicolors = require('ansicolors')
copyright = 'Copyright (c) 2019 Bogito. All rights reserved.'
author = 'Bogito'
version = 'v1.1.1'
desc =
[[
version = 'v1.1.2'
desc = [[
This script will read the flash memory of RDV4 using SPIFFS and print the stored passwords.
It was meant to be used as a help tool after using the BogRun standalone mode.
]]
example =
[[
example = [[
-- This will read the hf_bog.log file in SPIFFS and print the stored passwords
script run read_pwd_mem_spiffs
@ -20,12 +19,10 @@ example =
-- This will delete the hf_bog.log file from SPIFFS
script run read_pwd_mem_spiffs -r
]]
usage =
[[
Usage:
script run read_pwd_mem_spiffs -h -f <filename> -r
Arguments:
usage = [[
script run read_pwd_mem_spiffs [-h] [-f <filename>] [-r]
]]
arguments = [[
-h : this help
-f <filename> : filename in SPIFFS
-r : delete filename from SPIFFS
@ -44,9 +41,12 @@ local function help()
print(author)
print(version)
print(desc)
print('Example usage')
print(example)
print(ansicolors.cyan..'Usage'..ansicolors.reset)
print(usage)
print(ansicolors.cyan..'Arguments'..ansicolors.reset)
print(arguments)
print(ansicolors.cyan..'Example usage'..ansicolors.reset)
print(example)
end
---
-- The main entry point

View file

@ -1,10 +1,10 @@
local getopt = require('getopt')
local ansicolors = require('ansicolors')
copyright = ''
author = 'Iceman'
version = 'v1.0.1'
desc =
[[
version = 'v1.0.2'
desc = [[
This is a script that tries to bring back a chinese magic card (1k generation1)
from the dead when it's block 0 has been written with bad values.
or mifare Ultralight magic card which answers to chinese backdoor commands
@ -15,9 +15,9 @@ example = [[
]]
usage = [[
script run remagic
Arguments:
script run remagic [-h] [-u]
]]
arguments = [[
-h this help
-u remagic a Ultralight tag w 7 bytes UID.
]]
@ -49,9 +49,12 @@ local function help()
print(author)
print(version)
print(desc)
print('Example usage')
print(example)
print(ansicolors.cyan..'Usage'..ansicolors.reset)
print(usage)
print(ansicolors.cyan..'Arguments'..ansicolors.reset)
print(arguments)
print(ansicolors.cyan..'Example usage'..ansicolors.reset)
print(example)
end
local function cmdUltralight()

View file

@ -2,13 +2,14 @@ local cmds = require('commands')
local getopt = require('getopt')
local bin = require('bin')
local utils = require('utils')
local ansicolors = require('ansicolors')
local format = string.format
local floor = math.floor
copyright = ''
author = "Iceman"
version = 'v1.0.1'
version = 'v1.0.2'
desc =[[
This script will program a T55x7 TAG with a configuration and four blocks of data.
It will then try to detect and read back those block data and compare if read data matches the expected data.
@ -32,10 +33,9 @@ example = [[
1. script run test_t55x7
]]
usage = [[
script run test_t55x7
Arguments:
script run test_t55x7 [-h]
]]
arguments = [[
-h this help
]]
@ -79,9 +79,12 @@ local function help()
print(author)
print(version)
print(desc)
print("Example usage")
print(example)
print(ansicolors.cyan..'Usage'..ansicolors.reset)
print(usage)
print(ansicolors.cyan..'Arguments'..ansicolors.reset)
print(arguments)
print(ansicolors.cyan..'Example usage'..ansicolors.reset)
print(example)
end
---
-- Exit message