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:
9462d1b
)
dump blocks in hex
author
Dobrica Pavlinusic
<dpavlin@rot13.org>
Thu, 20 Jan 2011 18:30:39 +0000
(19:30 +0100)
committer
Dobrica Pavlinusic
<dpavlin@rot13.org>
Thu, 20 Jan 2011 18:30:39 +0000
(19:30 +0100)
mifare-mad.pl
patch
|
blob
|
history
diff --git
a/mifare-mad.pl
b/mifare-mad.pl
index
c6e3bed
..
5ae4481
100755
(executable)
--- a/
mifare-mad.pl
+++ b/
mifare-mad.pl
@@
-38,4
+38,10
@@
die "expected 4096 bytes, got ",length($card), " bytes\n"
foreach my $i ( 0 .. 15 ) {
my $v = unpack('v',(substr($card, 0x10 + ( $i * 2 ), 2)));
printf "MAD sector %-2d %04x %s\n", $i, $v, $mad_id->{$v} || '?';
+
+ foreach my $j ( 0 .. 3 ) {
+ my $offset = 0x40 * $i + $j * 0x10;
+ my $block = substr($card, $offset, 0x10);
+ printf "%04x %s\n", $offset, unpack('H*',$block);
+ }
}