Finding the architectures of a binary
Finding the architectures of a binary
- Subject: Finding the architectures of a binary
- From: Iceberg-Dev <email@hidden>
- Date: Mon, 10 Nov 2008 10:30:44 +0100
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:
This email sent to email@hidden