mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-03-19 19:38:52 +08:00
textual
This commit is contained in:
parent
9c95a2e8aa
commit
d313804e78
2 changed files with 53 additions and 33 deletions
|
@ -4,12 +4,18 @@ getopt = require('getopt')
|
|||
bin = require('bin')
|
||||
dumplib = require('html_dumplib')
|
||||
|
||||
example = "script run htmldump -o mifarecard_foo.html"
|
||||
author = "Martin Holst Swende"
|
||||
usage = "script run htmldump [-i <file>] [-o <file>]"
|
||||
copyright = ''
|
||||
author = 'Martin Holst Swende'
|
||||
version = 'v1.0.1'
|
||||
desc =[[
|
||||
This script takes a dumpfile and produces a html based dump, which is a
|
||||
bit more easily analyzed.
|
||||
]]
|
||||
example = [[
|
||||
script run htmldump -o mifarecard_foo.html
|
||||
]]
|
||||
usage = [[
|
||||
script run htmldump [-i <file>] [-o <file>]
|
||||
|
||||
Arguments:
|
||||
-h This help
|
||||
|
@ -17,44 +23,56 @@ Arguments:
|
|||
-o <filename> Speciies the output file. If omitted, <curtime>.html is used.
|
||||
|
||||
]]
|
||||
|
||||
-------------------------------
|
||||
-- Some utilities
|
||||
-------------------------------
|
||||
|
||||
---
|
||||
-- A debug printout-function
|
||||
function dbg(args)
|
||||
if DEBUG then
|
||||
print("###", args)
|
||||
local function dbg(args)
|
||||
if not DEBUG then return end
|
||||
if type(args) == 'table' then
|
||||
local i = 1
|
||||
while args[i] do
|
||||
dbg(args[i])
|
||||
i = i+1
|
||||
end
|
||||
else
|
||||
print('###', args)
|
||||
end
|
||||
end
|
||||
---
|
||||
-- This is only meant to be used when errors occur
|
||||
function oops(err)
|
||||
print("ERROR: ",err)
|
||||
local function oops(err)
|
||||
print('ERROR:', err)
|
||||
core.clearCommandBuffer()
|
||||
return nil, err
|
||||
end
|
||||
---
|
||||
-- Usage help
|
||||
function help()
|
||||
local function help()
|
||||
print(copyright)
|
||||
print(author)
|
||||
print(version)
|
||||
print(desc)
|
||||
print("Example usage")
|
||||
print('Example usage')
|
||||
print(example)
|
||||
print(usage)
|
||||
end
|
||||
|
||||
local function main(args)
|
||||
|
||||
local input = "dumpdata.bin"
|
||||
local output = os.date("%Y-%m-%d_%H%M%S.html");
|
||||
local input = 'dumpdata.bin'
|
||||
local output = os.date('%Y-%m-%d_%H%M%S.html');
|
||||
for o, a in getopt.getopt(args, 'i:o:h') do
|
||||
if o == "h" then return help() end
|
||||
if o == "i" then input = a end
|
||||
if o == "o" then output = a end
|
||||
if o == 'h' then return help() end
|
||||
if o == 'i' then input = a end
|
||||
if o == 'o' then output = a end
|
||||
end
|
||||
local filename, err = dumplib.convert_bin_to_html(input,output,16)
|
||||
local filename, err = dumplib.convert_bin_to_html(input,output, 16)
|
||||
if err then return oops(err) end
|
||||
|
||||
print(("Wrote a HTML dump to the file %s"):format(filename))
|
||||
print(('Wrote a HTML dump to the file %s'):format(filename))
|
||||
end
|
||||
|
||||
--[[
|
||||
|
|
|
@ -5,7 +5,7 @@ local utils = require('utils')
|
|||
|
||||
copyright = 'Copyright (c) 2018 IceSQL AB. All rights reserved.'
|
||||
author = 'Christian Herrmann'
|
||||
version = 'v1.0.4'
|
||||
version = 'v1.0.5'
|
||||
desc = [[
|
||||
This script tries to set UID on a IS15693 SLIX magic card
|
||||
Remember the UID ->MUST<- start with 0xE0
|
||||
|
@ -32,20 +32,21 @@ local DEBUG = true
|
|||
-- A debug printout-function
|
||||
local function dbg(args)
|
||||
if not DEBUG then return end
|
||||
if type(args) == "table" then
|
||||
if type(args) == 'table' then
|
||||
local i = 1
|
||||
while args[i] do
|
||||
dbg(args[i])
|
||||
i = i+1
|
||||
end
|
||||
else
|
||||
print("###", args)
|
||||
print('###', args)
|
||||
end
|
||||
end
|
||||
---
|
||||
-- This is only meant to be used when errors occur
|
||||
local function oops(err)
|
||||
print("ERROR: ",err)
|
||||
print('ERROR:', err)
|
||||
core.clearCommandBuffer()
|
||||
return nil, err
|
||||
end
|
||||
---
|
||||
|
@ -57,24 +58,25 @@ local function help()
|
|||
print(desc)
|
||||
print('Example usage')
|
||||
print(example)
|
||||
print(usage)
|
||||
end
|
||||
--
|
||||
--- Set UID on magic command enabled on a ICEMAN based REPO
|
||||
local function magicUID_iceman(b0, b1)
|
||||
print('Using backdoor Magic tag function')
|
||||
core.console("hf 15 raw -2 -c 02213E00000000")
|
||||
core.console("hf 15 raw -2 -c 02213F69960000")
|
||||
core.console("hf 15 raw -2 -c 022138"..b1)
|
||||
core.console("hf 15 raw -2 -c 022139"..b0)
|
||||
core.console('hf 15 raw -2 -c 02213E00000000')
|
||||
core.console('hf 15 raw -2 -c 02213F69960000')
|
||||
core.console('hf 15 raw -2 -c 022138'..b1)
|
||||
core.console('hf 15 raw -2 -c 022139'..b0)
|
||||
end
|
||||
--
|
||||
--- Set UID on magic command enabled, OFFICAL REPO
|
||||
local function magicUID_offical(b0, b1)
|
||||
print('Using backdoor Magic tag function OFFICAL REPO')
|
||||
core.console("hf 15 cmd raw -c 02213E00000000")
|
||||
core.console("hf 15 cmd raw -c 02213F69960000")
|
||||
core.console("hf 15 cmd raw -c 022138"..b1)
|
||||
core.console("hf 15 cmd raw -c 022139"..b0)
|
||||
core.console('hf 15 cmd raw -c 02213E00000000')
|
||||
core.console('hf 15 cmd raw -c 02213F69960000')
|
||||
core.console('hf 15 cmd raw -c 022138'..b1)
|
||||
core.console('hf 15 cmd raw -c 022139'..b0)
|
||||
end
|
||||
---
|
||||
-- The main entry point
|
||||
|
@ -89,9 +91,9 @@ function main(args)
|
|||
|
||||
-- Read the parameters
|
||||
for o, a in getopt.getopt(args, 'hu:a') do
|
||||
if o == "h" then return help() end
|
||||
if o == "u" then uid = a end
|
||||
if o == "a" then use_iceman = false end
|
||||
if o == 'h' then return help() end
|
||||
if o == 'u' then uid = a end
|
||||
if o == 'a' then use_iceman = false end
|
||||
end
|
||||
|
||||
-- uid string checks
|
||||
|
|
Loading…
Add table
Reference in a new issue