X-Git-Url: http://cvs.zerfleddert.de/cgi-bin/gitweb.cgi/proxmark3-svn/blobdiff_plain/0a43c39617c54bec85fd9220544e7d2bdfc325d1..c068ebb78f2e4070fcf1a604df0d7088374b60c6:/client/scripts/tracetest.lua diff --git a/client/scripts/tracetest.lua b/client/scripts/tracetest.lua index f17f7567..ae4055ae 100644 --- a/client/scripts/tracetest.lua +++ b/client/scripts/tracetest.lua @@ -6,19 +6,20 @@ local dumplib = require('html_dumplib') example =[[ 1. script run tracetest - 2. script run tracetest -o - ]] author = "Iceman" -usage = "script run tracetest -o " +usage = "script run tracetest" desc =[[ This script will load several traces files in ../traces/ folder and do "data load" -"lf search" +"lf search 1 u" + +The following tracefiles will be loaded: + em*.pm3 + m*.pm3 Arguments: -h : this help - -o : logfile name ]] local TIMEOUT = 2000 -- Shouldn't take longer than 2 seconds @@ -71,31 +72,33 @@ local function main(args) local tracesEM = "find '../traces/' -iname 'em*.pm3' -type f" local tracesMOD = "find '../traces/' -iname 'm*.pm3' -type f" + local write2File = false local outputTemplate = os.date("testtest_%Y-%m-%d_%H%M%S") -- Arguments for the script - for o, arg in getopt.getopt(args, 'hk:no:') do + for o, arg in getopt.getopt(args, 'h') do if o == "h" then return help() end - if o == "o" then outputTemplate = arg end end - + core.clearCommandBuffer() local files = {} -- Find a set of traces staring with EM - local p = io.popen(tracesEM) + local p = assert( io.popen(tracesEM)) for file in p:lines() do table.insert(files, file) end + p.close(); -- Find a set of traces staring with MOD - p = io.popen(tracesMOD) + p = assert( io.popen(tracesMOD) ) for file in p:lines() do table.insert(files, file) end - - local cmdLFSEARCH = "lf search" + p.close(); + + local cmdLFSEARCH = "lf search 1 u" -- main loop io.write('Starting to test traces > ') @@ -117,13 +120,6 @@ local function main(args) end io.write('\n') - -- Write dump to files - if not DEBUG then - local bar = dumplib.SaveAsText(emldata, outputTemplate..'.txt') - print(("Wrote output to: %s"):format(bar)) - end - - -- Show info print( string.rep('--',20) ) end