I don't think Mac OS X stores a global database of all package identifiers everywhere.
As already noted, you can find the application quite simply with NSWorkspace.
In addition, since you used kext for your example, Leopard (10.5) has a tool called "kextfind" that you can run to search for kexts in the "Extensions" folder (kexts will not be found in other places, except you specify the tool in these other places). Kextfind has many options - see the man page for details - but to find kext by package id, you can do this:
kextfind -bundle-id com.apple.iokit.IOStorageFamily
We currently do not have a C-level API to search for kexts by package identifier.
As for hacking the path from the last component of the bundle identifier: don't do this. There doesnโt require anything for the wrapper name to match the last component of the package identifier, and I saw kexts (not to mention other packages) where the two do not match.
Nik gervae
source share