Re: Finding the architectures of a binary
site_archiver@lists.apple.com Delivered-To: darwin-dev@lists.apple.com Alex Am 10.11.2008 um 10:58 schrieb Brian Bergstrand: On Nov 10, 2008, at 11:30 AM, Iceberg-Dev wrote: ... What I don't know/understand: Brian Bergstrand <http://www.bergstrand.org/brian/> PGP Key ID: 0xB6C7B6A2 _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/below%40mac.com _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/site_archiver%40lists.appl... Addintonally, the source for both file (1) and lipo (1) should be open source and give you valuable hints. I'm trying to find all the architectures available in a binary using code. - 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? Open the file and parse the info yourself using mach-o/loader.h and mach-o/fat.h. PEF is very rare these days, but you can do the same thing using CarbonCore/PEFBinaryFormat.h. Of course on OS X, PEF will only contain PPC code. This email sent to below@mac.com This email sent to site_archiver@lists.apple.com
participants (1)
-
Alexander von Below