Re: Application entry point
Re: Application entry point
- Subject: Re: Application entry point
- From: Greg Parker <email@hidden>
- Date: Mon, 13 Jul 2009 12:44:31 -0700
On Jul 12, 2009, at 10:50 PM, Aron-Zvi wrote:
Thanks for the quick reply Greg.
How do I scan the load commands?
Read mach-o/loader.h. Step through the load commands, starting just
after the mach_header (or mach_header_64). Use load_command->cmd to
check for LC_UNIXTHREAD, and use load_command->cmdsize to find the
next load command.
* The load commands directly follow the mach_header. The total size
of all
* of the commands is given by the sizeofcmds field in the
mach_header. All
* load commands must have as their first two fields cmd and
cmdsize. The cmd
* field is filled in with a constant for that command type. Each
command type
* has a structure specifically for it. The cmdsize field is the
size in bytes
* of the particular load command structure plus anything that
follows it that
* is a part of the load command (i.e. section structures, strings,
etc.). To
* advance to the next load command the cmdsize can be added to the
offset or
* pointer of the current load command.
--
Greg Parker email@hidden Runtime Wrangler
_______________________________________________
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