sidsatx102 / cardpeek

Automatically exported from code.google.com/p/cardpeek
Other
0 stars 0 forks source link

Allow running scripts from command-line #46

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
We use cardpeek to batch dump a bunch of cards for offline viewing.

For this it would be very nice to be able to run a script (emv.lua) and then 
save the resulting output in a file directly from the command line.

If this is possible with the 'exec' options, please let me know - otherwise 
this is a feature request.

Original issue reported on code.google.com by nuutti.k...@gmail.com on 9 Jun 2014 at 10:39

GoogleCodeExporter commented 9 years ago
With a bit of magic I was able to come up with a line:

cardpeek -r 'pcsc://Alcor Micro AU9540 00 00' -e 'dofile("poplaemv.lua"); 
ui.save_view("/home/naked/test-card.xml"); ui.exit()'

Original comment by nuutti.k...@gmail.com on 9 Jun 2014 at 10:47

GoogleCodeExporter commented 9 years ago
Well you have answered the question yourself! 

Perhaps I should add more documentation or examples of this features somewhere. 

One drawback of this approach is that you still need to answer the questions in 
the script (if any). For example, in the EMV script you will be asked whether 
you want to do a GPO. I have a few ideas to get around this in future versions 
of cardpeek, but I'm not going to have that in the next release yet.

Original comment by L...@gmx.com on 9 Jun 2014 at 1:09

GoogleCodeExporter commented 9 years ago
You are right about the questions.

However, for such a custom job, we need to anyway modify the scripts, so it is 
easy to remove the ui questions at the same time. For example, we wish to log 
GPO errors in the XML output, instead of just showing an error status to the 
user.

There was absolute zero documentation about any of this and it was not simple 
to find out what is possible within the lua environment. Finding these things 
out from the source code did not take too long, though.

Original comment by nuutti.k...@gmail.com on 9 Jun 2014 at 7:33