You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

23 lines
352 B

#!/usr/bin/perl -w
open FS,"<$ARGV[0]";
open FD,">$ARGV[1]";
print FD "static char $ARGV[2]\[]={\n";
my ($x,$i,$d);
$i=0;
while(!eof(FS))
{
printf FD ("/*%08x:*/",$i) if($i%16==0);
read FS,$d,1;
$x=unpack "C",$d;
printf FD ("0x%02x",$x);
$i++;
if(!eof(FS))
{
printf FD (",");
printf FD ("\n") if($i%16==0);
}
}
print FD "};\n";
close(FS);
close(FD);