#!/usr/local/bin/perl while (<>) { s/^\s+//; chomp; split; if ($_[0] =~ /^[0-9a-f]+:$/i) { $i=1; while ($_[$i] =~ /^[0-9a-f]{2}$/) { $byte[$b++]="0x$_[$i]"; $i++; } } } printf("unsigned char str[] = {\n"); for ($i=0;$i<=$#byte;$i++) { print $byte[$i]; if ($i!=$#byte) { print ", "; } if ($i%8==7) { print "\n"; } } print " };\n";