سؤال

Is there any way to get the address of the function which is defined in static library (.lib) which is been linked to some application .

Thanks

هل كانت مفيدة؟

المحلول

A static library is nothing but an archive (like a .ZIP file) of object files.

When you link against a static library the linker will check which of these object files are needed and link them to the executable. The result is exactly the same as if you directly compiled the source code of the library in your project.

So the actual question is: Is it possible to find out the address of a non-static function in an executable file?

Some linkers (like GNU) generate a symbol table by default even in a project without debugging information. You could parse the symbol table in this case. However many linkers do not create this symbol table. In this case the information of all function names is lost so you do not have any chance to get information about the address without debugging information.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top