• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Getting a mach_header from dlopen
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Getting a mach_header from dlopen


  • Subject: Getting a mach_header from dlopen
  • From: Spencer Nielsen <email@hidden>
  • Date: Mon, 2 May 2005 14:34:45 -0700

Does anybody know offhand a good way to get a code image's mach_header (for use with getsectdatafromheader) of a specific file? In 10.3 I used the structure that dlopen returned (dlstatus) and it had a pointer right in there. However, things have changed in 10.4 and dlopen now returns a different structure (dlopen_handle). The structure returned now contains the NSModule for the file among other things. I tried running through all the loaded images with _dyld_get_image_header and comparing the names (using _dyld_get_image_name) with the NSNameOfModule() called on the NSModule in the structure returned by dlopen but NSNameOfModule() always returns nil. I know that depending on what is returned by dlopen is probably not the best of strategies (perhaps that is why the man page still documents it as returning void*). All I need to be able to do it get the mach_header of code images that I am loading in with dlopen. Thanks!

Spencer Nielsen
_______________________________________________
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


  • Follow-Ups:
    • Re: Getting a mach_header from dlopen
      • From: "Peter O'Gorman" <email@hidden>
  • Prev by Date: Re: DiskArbitration API
  • Next by Date: Re: Getting a mach_header from dlopen
  • Previous by thread: Re: sysent and KEXT
  • Next by thread: Re: Getting a mach_header from dlopen
  • Index(es):
    • Date
    • Thread