]> git.saurik.com Git - apple/dyld.git/blob - bin/set-alt-dyld
dyld-851.27.tar.gz
[apple/dyld.git] / bin / set-alt-dyld
1 #!/usr/bin/perl -w
2
3 use strict;
4 undef $/;
5
6 if(@ARGV == 0)
7 {
8 print "Usage: $0 <macho-executable> [<macho-executable> ...]\n";
9 exit 1;
10 }
11
12 my $arg;
13 foreach $arg (@ARGV)
14 {
15 open IN, "<$arg" or die $!;
16 my $in = <IN>;
17 close IN or die $!;
18
19 if($in =~ s{/usr/lib/dyld}{/usr/local/dy})
20 {
21 open OUT, ">$arg" or die $!;
22 print OUT $in;
23 close OUT or die $!;
24 }
25 else
26 {
27 print STDERR "ERROR: $arg\n";
28 exit 1;
29 }
30 }