#!/usr/bin/perl
#
# Author: PinkFreud / Mirkwood Networks
# License: GPL

while (<>) {
  if (/^Contents/) {
    # Set flag to indicate we should start parsing the hex dump
    $data = 1;
    next;
  }

  if ($data == 1) {
    # Get the first four fields
    @d[0..4] = split ,, 4;
    # Remove the first field - it's a memory address we don't need
    shift @d;
    # Turn the rest of the hex dump into the binary data it represents
    for $a (@d) {
      ($a) =~ s/(..)/chr(hex($1))/eg;
      print "$a";
    }
  }
}
