29 |
# calculate number of characters for offset |
# calculate number of characters for offset |
30 |
#my $d = length( sprintf("%x",length($bytes)) ); |
#my $d = length( sprintf("%x",length($bytes)) ); |
31 |
my $d = 4; |
my $d = 4; |
32 |
|
my $prefix = '#.'; |
33 |
while ( $hex =~ s/^((?:\w\w\s){1,16})// ) { |
while ( $hex =~ s/^((?:\w\w\s){1,16})// ) { |
34 |
printf "## %0${d}x | %-48s| %s\n", $o, $1, substr( $ascii, 0, 16 ); |
printf "$prefix %0${d}x | %-48s| %s\n", $o, $1, substr( $ascii, 0, 16 ); |
35 |
|
$prefix = '##'; |
36 |
if ( length($ascii) >= 16 ) { |
if ( length($ascii) >= 16 ) { |
37 |
$ascii = substr( $ascii, 16 ); |
$ascii = substr( $ascii, 16 ); |
38 |
$o += 16; |
$o += 16; |