rendered paste body#!/usr/bin/perl## Copyright 2009 by Joerg Mayer <jmayer@loplof.de>## This script is licensed under GLPv2 or later (at user's# choice).#use warnings;use strict;my $inside;my $filecount = 1;my $debug = 0;sub beginfile { $debug && print "Start #$filecount:\n"; my $outfile = sprintf("datablock-%03d.bin", $filecount); open (OUTFILE, ">$outfile") or die "Opening $outfile failed ($!)\n";}sub endfile { close OUTFILE; $debug && print "End #$filecount:\n";}sub addtofile { my ($line) = @_; my $result; my $byte; $line =~ s/ [0-9A-Fa-f]{8}://; while ($line !~ /^\s*$/) { $line =~ /^ ([0-9A-Fa-f][0-9A-Fa-f])(.*)/; $byte = $1; $line = $2; $result .= $byte; } $result = pack("H*", $result); $debug && print "$result"; print OUTFILE "$result";}while (<>) { chomp; chomp; if (/ TransferBufferMDL = /) { $inside = 1; beginfile(); } elsif (/ UrbLink = /) { $inside = 0; endfile(); $filecount++; } elsif ($inside == 1) { addtofile($_); }}exit 0;__END__usage: extract.pl <file(s)>Find all blocks of the following form: TransferBufferMDL = 00000000 00000000: 55 53 42 43 08 90 ec 85 00 10 00 00 80 00 0a 28 00000010: 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 UrbLink = 00000000and extract the data part into files named datablock-XYZ