将二进制转化为ascii文本

清华大佬耗费三个月吐血整理的几百G的资源,免费分享!....>>>

my $src = 'D:\\boot.bin';
if (!-e $src) {
    die "ERROR: File \"$src\" doesn't exist!";
}
open my $boot, "<$src";
open my $dest, ">bin.txt";
binmode($boot);
my $buffer = '';
my $len = 65536;

read($boot, $buffer, $len, 0);
foreach (split(//, $buffer)) {
	#print $dest ord($_);
    printf $dest ("%02x", ord($_));
	#printf $dest ("%02x", ord($_));

}