Re: Changing Mach-O app load behavior
Re: Changing Mach-O app load behavior
- Subject: Re: Changing Mach-O app load behavior
- From: Rainer Brockerhoff <email@hidden>
- Date: Tue, 9 Aug 2005 20:28:38 -0300
At 12:06 -0700 8/9/05, email@hidden wrote:
>From: Eric Shepherd <email@hidden>
>Date: Tue, 9 Aug 2005 11:41:40 -0400
>Message-ID: <email@hidden>
>
>I'm in the odd position of needing to intervene in the process of loading a Mach-O application's binary. I need to be able to load it into memory, do some preprocessing on it, then link and run it. I need to be able to do this without requiring any changes to an existing application; the goal is to be able to wrap an existing program to control its use during a demo period.
>
>I've looked at things like NSCreateObjectFileImageFromMemory, which sounds perfect, except it only works on bundles, which apparently doesn't include standard applications. Rebuilding an app with the -bundle flag to the linker makes it "almost" work, in that the app launches but the menu bar never appears, and keystrokes don't go to its windows.
Eric, you could have a small loader program run which then would load the rest of your binary as a dylib, using NSCreateObjectFileImageFromMemory.
I could go into details in private, if you need further hints.
--
Rainer Brockerhoff <email@hidden>
Belo Horizonte, Brazil
"The three chief virtues of a programmer are: Laziness, Impatience and Hubris" - Larry Wall
Weblog: http://www.brockerhoff.net/bb/viewtopic.php
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden