Cannot mprotect() dylib code?
site_archiver@lists.apple.com Delivered-To: darwin-kernel@lists.apple.com Hi, The code is being ported from Linux platforms where this works. 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 (Darwin-kernel@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-kernel/site_archiver%40lists.a... 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. 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 :-) This email sent to site_archiver@lists.apple.com
participants (1)
-
Lassi A.Tuura