3 |
# amv.pl |
# amv.pl |
4 |
# |
# |
5 |
# 07/19/07 19:21:39 CEST Dobrica Pavlinusic <dpavlin@rot13.org> |
# 07/19/07 19:21:39 CEST Dobrica Pavlinusic <dpavlin@rot13.org> |
6 |
|
# |
7 |
|
# Various useful links used to produce this: |
8 |
|
# http://www.moviecodec.com/topics/15431p1.html |
9 |
|
# http://en.wikipedia.org/wiki/RIFF_(File_format) |
10 |
|
|
11 |
use strict; |
use strict; |
12 |
|
|
33 |
# calculate number of characters for offset |
# calculate number of characters for offset |
34 |
#my $d = length( sprintf("%x",length($bytes)) ); |
#my $d = length( sprintf("%x",length($bytes)) ); |
35 |
my $d = 4; |
my $d = 4; |
36 |
|
my $prefix = '#.'; |
37 |
while ( $hex =~ s/^((?:\w\w\s){1,16})// ) { |
while ( $hex =~ s/^((?:\w\w\s){1,16})// ) { |
38 |
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 ); |
39 |
|
$prefix = '##'; |
40 |
if ( length($ascii) >= 16 ) { |
if ( length($ascii) >= 16 ) { |
41 |
$ascii = substr( $ascii, 16 ); |
$ascii = substr( $ascii, 16 ); |
42 |
$o += 16; |
$o += 16; |