repo.or.cz
/
darwin-xtools.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Merge pull request #8 from biergaizi/upstream
[darwin-xtools.git]
/
dyld
/
bin
/
set-alt-dyld
blob
032bcf962b0a23895ab91b2861c690b3b76a56ec
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/lib/dyle}
)
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
}