reformat hex dump in 4-bytes separated by space
authorDobrica Pavlinusic <dpavlin@rot13.org>
Sat, 22 Jan 2011 23:14:16 +0000 (00:14 +0100)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Sat, 22 Jan 2011 23:14:16 +0000 (00:14 +0100)
mifare-mad.pl

index bf9994a..2472cfc 100755 (executable)
@@ -133,7 +133,10 @@ foreach my $i ( 0 .. 15 ) {
                        ;
                $cond >>= $j;
 
-               printf "%04x %s %03b %s\n", $offset, unpack('H*',$block)
+               my $hex = unpack('H*',$block);
+               $hex =~ s/(....)/$1 /g;
+
+               printf "%04x  %s %03b %s\n", $offset, $hex
                        , $cond
                        , $j < 3 ? $access_condition_data->{$cond} : $access_condition_trailer->{$cond}
                        ;