Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Finding the architectures of a binary



I'm trying to find all the architectures available in a binary using code.

What I've found so far:

- lipo tool can be used to do this but, apparently, its source code is not available in Darwin.

- There is a new method in NSBundle in Mac OS X 10.5 and later to find the architectures of a bundle. This won't work with tools.

- There can be at least 2 valid binary "formats": peff and mach-o (32- bit 64-bit).

- It is apparently possible to get information about a mach-o binary using the dyld APIs and checking the mach_header (32 and 64) of the different images.

What I don't know/understand:

- I'm not sure to understand how you can inspect a binary without loading it in memory. It looks as if the dyld API work only with the running binary (no parameter for instance to enumerate the number of images with _dyld_image_count();).

- There doesn't seem to be an API for peff binaries. Is it safe to assume that the magic cookie is always at the beginning of the file?


_______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/email@hidden

This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.