projects
/
perl-Mifare-MAD.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f37be3d
)
correctly handle 1k mifare dumps
author
Dobrica Pavlinusic
<dpavlin@rot13.org>
Mon, 31 Jan 2011 21:43:48 +0000
(22:43 +0100)
committer
Dobrica Pavlinusic
<dpavlin@rot13.org>
Mon, 31 Jan 2011 21:43:48 +0000
(22:43 +0100)
mifare-mad.pl
patch
|
blob
|
history
diff --git
a/mifare-mad.pl
b/mifare-mad.pl
index
7201bec
..
ce41e82
100755
(executable)
--- a/
mifare-mad.pl
+++ b/
mifare-mad.pl
@@
-69,8
+69,8
@@
if ( $debug ) {
local $/ = undef;
my $card = <>;
-die "expected 4096 bytes, got ",length($card), " bytes\n"
- unless length $card == 4096;
+die "expected 4096
or 1024
bytes, got ",length($card), " bytes\n"
+ unless length $card == 4096
|| length $card == 1024
;
my ( $ADV, $MA, $DA );
@@
-80,6
+80,7
@@
foreach my $sector ( 0 .. 39 ) {
my $blocks = $sector < 32 ? 4 : 16;
+ last if $pos >= length($card);
next if substr($card,$pos,$blocks * 0x10) eq "\x00" x ($blocks * 0x10);
# General purpose byte (GPB)