use strict; use MIME::Base64; my $file = '/Applications/Microsoft Office 2008/Office/OfficePID.plist'; open (FILE,'<',$file); my $flag = 0; my $section = 0; my $string; foreach() { $flag = 1 if (m/2000<\/key>/); $section++ if ($section == 1); $section = 1 if (m// && $flag==1); if (m/<\/data>/) { $flag = 0; $section = 0; } if ($section == 2) { $string .= $_; } } close(FILE); $string =~ s/\s//g; my $hex = uc(unpack("H*", decode_base64(shift))); $hex =~ s/(..)/$1,/g; chop($hex); decodekey($hex);