Answering your own question to make life easier for people looking for a solution. There is no single way requiring iteration on loadable modules to search for the following commands / data types (experts invite comments on this):
Windows:
MODULEENTRY32, CreateToolhelp32Snapshot, Module32First, Module32Next
Linux:
as described in nm, answer, return a nonzero value from the callback when you find the corresponding module (terminates the loop).
AIX:
loadquery (L_GETINFO, buffer, size), struct ld_info.
HP-UX:
dlget, dlgetname (if you need a path to the module).
Solaris:
ldinfo, Link_map.
In addition, I would recommend decrypting the modules and getting the character from the new descriptor to increase the library reference count, which prevents it from unloading. At least on AIX, it may have the side effect of a library loaded and initialized again, but in most cases is better than trying to call a function from an unloaded library.
source share