Cannot mprotect() dylib code?
Cannot mprotect() dylib code?
- Subject: Cannot mprotect() dylib code?
- From: "Lassi A.Tuura" <email@hidden>
- Date: Fri, 11 Feb 2005 23:32:19 +0100
Hi,
We have a debugging type library that parses and modifies the machine
code on the fly for certain functions, mainly to insert a jump to
"capture" functions which do some special stuff then invoke the
original code. The run-time patching appears to work on functions from
the main executable, but not on functions from dylibs -- mprotect() on
a page of code from the latter always fails, errno is set to 13
(EACCESS, Permission denied). I also tried
vm_protect(mach_task_self(), ...), it also fails.
The code is being ported from Linux platforms where this works.
How do I modify code from dylibs on OS X at run-time? Presumably
there's a way to do this since fix and continue has been implemented
:-)
Lassi
--
Children begin by loving their parents. After a time they judge
them. Rarely, if ever, do they forgive them. --Oscar Wilde
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-kernel mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden