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; |
55 |
hex_dump( $bytes ); |
hex_dump( $bytes ); |
56 |
|
|
57 |
if ( $bytes eq 'AMV_END_' ) { |
if ( $bytes eq 'AMV_END_' ) { |
58 |
warn "## end of file marker AMV_END_\n"; |
warn "> end of file marker AMV_END_\n"; |
59 |
$d->{eof}++; |
$d->{eof}++; |
60 |
return; |
return; |
61 |
} |
} |
77 |
if ( $expected_len ) { |
if ( $expected_len ) { |
78 |
confess "expected $expected_len bytes for $part got $len" if $len != $expected_len; |
confess "expected $expected_len bytes for $part got $len" if $len != $expected_len; |
79 |
} |
} |
80 |
printf ">>> %s | %d 0x%x bytes\n", $part, $len, $len; |
printf ">> %s - %d 0x%x bytes\n", $part, $len, $len; |
81 |
x($len) if $skip; |
x($len) if $skip; |
82 |
return $len; |
return $len; |
83 |
} |
} |