]> git.zerfleddert.de Git - proxmark3-svn/blame - client/gen_pm3mfsim_script.sh
hack to add missing directory structure for loclass binaries
[proxmark3-svn] / client / gen_pm3mfsim_script.sh
CommitLineData
1f947c4b 1#!/bin/bash
2
3# Andrei Costin <zveriu@gmail.com>, 2011
4# gen_pm3mfsim_script.sh
5# Generates Mifare Classic emulation script file that will load a given EML dump into PM3 and start emulation automagically
6
7# http://www.linuxquestions.org/questions/programming-9/bash-script-parsing-optional-parameters-621728/
8
9# show program usage
10show_usage()
11{
12 echo
13 echo "Usage:"
14 echo "${0##/} input_eml_without_extension output.pm3scr"
15 exit
16}
17
18# Minimum number of arguments needed by this program
19MINARGS=2
20
21# get the number of command-line arguments given
22ARGC=$#
23
24# check to make sure enough arguments were given or exit
25if [[ $ARGC -lt $MINARGS ]] ; then
26 echo "Too few arguments given (Minimum:$MINARGS)"
27 echo
28 show_usage
29fi
30
31rm $2
32echo "hf mf eclr" >> $2
33echo "hf mf eload" $1 >> $2
34echo "hf mf ekeyprn" >> $2
35echo "hf mf sim" `cat $1.eml | (read -n 8 uid; echo $uid)` >> $2
Impressum, Datenschutz