projects
/
perl-Mifare-MAD.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
show dumps only if not using --write
[perl-Mifare-MAD.git]
/
nfc-card-dumper.pl
diff --git
a/nfc-card-dumper.pl
b/nfc-card-dumper.pl
index
b1e780a
..
5397f06
100755
(executable)
--- a/
nfc-card-dumper.pl
+++ b/
nfc-card-dumper.pl
@@
-96,7
+96,7
@@
if ($r->init()) {
}
my $md5 = md5_hex($card);
}
my $md5 = md5_hex($card);
- my $out_file = "cards/$uid.$md5";
+ my $out_file = "cards/$uid.$md5
.mfd
";
if ( -e $out_file ) {
warn "$out_file allready exists, not overwriting\n";
} else {
if ( -e $out_file ) {
warn "$out_file allready exists, not overwriting\n";
} else {
@@
-118,10
+118,12
@@
if ($r->init()) {
print STDERR "$block ";
}
print STDERR "done\n";
print STDERR "$block ";
}
print STDERR "done\n";
+ } else {
+ # view dump
+ my $txt_file = $out_file;
+ $txt_file =~ s/\.mfd/.txt/ || die "can't change extension to txt";
+ system "./mifare-mad.pl $out_file > $txt_file";
+ $ENV{MAD} && system "vi $txt_file";
}
}
-
- # view dump
- system "./mifare-mad.pl $out_file > $out_file.txt";
- $ENV{MAD} && system "vi $out_file.txt";
}
}