#!/usr/bin/perl -w

use strict;

my $BLOCK_SIZE=10240;

my $fname = $ARGV[0];
open(F,"<$fname") or die("Unable to open file $fname, $!");
binmode(F);
my $buf;
my $ct=0;
my $alt3 =  '';
my $alt2 =  '';
my $alt1 =  '';
my $alt0 =  '';
my $alt01 =  '';


while(read(F,$buf,$BLOCK_SIZE,$ct*$BLOCK_SIZE)){
	foreach(split(//, $buf)){
		printf("%02x ",ord($_));
$alt3 =  $alt2;
$alt2 =  $alt1;
$alt1 =  $alt0;
$alt0 =  $alt01;
$alt01 =  $_;

		if ($alt3. $alt2 . $alt1  eq '#HR'){
			print "\n";
		} 
}
#print "\n$ct\n";
	$ct++;
}
close(F);
