是否有一种方法可以在不使用 readelf 实用程序的情况下确定 ELF 文件的 .dynamic 部分中的条目数?我尝试使用 gelf_getdyn() 函数从 .dynamic 部分输出数据,但无法找出以编程方式查找此部分中条目数的方法。任何可以提供帮助的帮助或网页(无法找到 readelf 的源代码)将非常感激。
最佳答案
cannot figure out a way of programmatically finding the number of entries in this section
您只需迭代所有条目,直到遇到带有 d_tag == DT_NULL
的条目。该条目终止数组。 Reference .
关于c - 如何查找 ELF 文件的 .dynamic 部分中的条目数?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48214977/