extract_code.pl:
#!/usr/bin/perl
use strict;
use warnings;
sub ParseFile
{
open (SRCFILE, $_[0]) or die "Can't open source file";
open (DESTFILE, ">$_[1]") or die "Can't create destination file";
while()
{
chomp;
if(/(\.[A-F0-9]{8}: )([A-F0-9]+)(.*)/)
{
my $bin = pack('H*', $2);
syswrite DESTFILE, $bin;
}
}
close(DESTFILE);
close(SRCFILE);
}
ParseFile($ARGV[0],$ARGV[1]);
extract_code.pl usage:
extract_code.pl
Комментариев нет:
Отправить комментарий