aboutsummaryrefslogtreecommitdiff
path: root/dumpbytes.pl
blob: baa3d20030cc6ca344509f8a860fdf096c0a8e7d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/usr/bin/perl -w

$count = 0;
while(<>) {
	$_ = substr($_, 0, 79);
	s/.*; \w\w\w\w // or next;
	my @bytes = split " ";
	push @got, eval "0x$_" for @bytes;
}

for(@got) {
	my $b = sprintf("%08b", $_);
	$b =~ s/0/_/g;
	$b =~ s/1/X/g;
	printf "%02x   ", $_;
	print $b . "\n";
	$count++;
	if($count == 10) {
		print "\n";
		$count = 0;
	}
}