File: parlsig.pl

package info (click to toggle)
libpar-perl 0.952-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 1,068 kB
  • ctags: 512
  • sloc: perl: 14,520; ansic: 870; makefile: 57
file content (20 lines) | stat: -rw-r--r-- 493 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
use strict;

my ($parl_exe, $par_exe, $dynperl, $chunk_size) = @ARGV;
exit unless $dynperl;

local $/;
open _FH, $par_exe or die $!;
binmode _FH;
my $input_exe = <_FH>;
close _FH;
open _FH, $parl_exe or die $!;
binmode _FH;
my $output_exe = <_FH>;
close _FH;
my $offset = rindex($output_exe, substr($input_exe, 0, $chunk_size));
die "Impossible: Can't find $par_exe inside $parl_exe" if $offset == -1;
open _FH, '>>', $parl_exe or die $!;
binmode _FH;
print _FH pack('N', $offset);
close _FH;