yu.dong | c33b307 | 2024-08-21 23:14:49 -0700 | [diff] [blame^] | 1 | #!/usr/bin/perl
|
| 2 |
|
| 3 | $lisfile = $ARGV[0];
|
| 4 | $output = $ARGV[1];
|
| 5 |
|
| 6 | open (FILE_HANDLE, "<$lisfile") or die "Cannot open $lisfile\n";
|
| 7 | $backup = $/; undef $/;
|
| 8 | $reading = <FILE_HANDLE>;
|
| 9 | $/ = $backup;
|
| 10 | close FILE_HANDLE;
|
| 11 |
|
| 12 | open (W,">$output") or die "Cannot open output file $output:$!\n";
|
| 13 |
|
| 14 | if ($reading =~ /Memory Map of the image/) {
|
| 15 | $reading = $';
|
| 16 | if ($reading =~ /==============/) {
|
| 17 | print W $`;
|
| 18 | } else {
|
| 19 | print W $reading;
|
| 20 | }
|
| 21 | }
|
| 22 | close W;
|
| 23 |
|