Finding the architectures of a binary
site_archiver@lists.apple.com Delivered-To: darwin-dev@lists.apple.com Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:mime-version :content-transfer-encoding:message-id:content-type:to:from:subject :date:x-mailer; bh=eI/nHdJ9nj20/JlANz7fGZLBsc/URLW91s8EVeCFYMM=; b=DUSEnTBftT8WyUqrbg1txZmbSkhjTioAcG/SuoIMZ4keCn2+Vq5EwbBzcKfbZbrSwh 6/DugffL6NTw0573uHVv0kstFSUonwVK8zJpd7F7jQn7W8cpfzLs1EJ5A8nh8yI35Ehj mUHsrAqV/qdxzRnyVnTGEmOMdAjsdc6OcEIhs= Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:content-transfer-encoding:message-id:content-type:to :from:subject:date:x-mailer; b=KhfO/Y5Y8Kc0h72QWLnluP1ByHTZM+q0wU48SPWisE0SadLcxV79aNtPVkod1Anf9f rBIH2GACdZSvr7gGHDOXdYCSMkTC7E1t9kOzj0gapcJ/4lxQ2QehJUTg/czy7PI7OUKY ot3Kve7dA6OWCHehYDIo4QD/gw7CWoNdG+3yU= What I've found so far: What I don't know/understand: _______________________________________________ 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... I'm trying to find all the architectures available in a binary using code. - 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. - 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? This email sent to site_archiver@lists.apple.com
participants (1)
-
Iceberg-Dev