gpt4 book ai didi

c - 是否可以检测程序是否已通过/proc/self/mem 动态链接?

转载 作者:太空宇宙 更新时间:2023-11-04 11:55:17 24 4
gpt4 key购买 nike

通过我的 previous question ,我想通过检查/proc/self/exe 来检查二进制文件是否动态链接。现在我想知道是否有可能检测它是否通过/proc/self/mem 或/proc/self 中的任何其他工具动态链接,考虑到如果/exe 不存在,程序将变得无用。

最佳答案

Im trying to determine if a file has shares libraries, i know its possible to physically see if a file has shared libraries in /proc/PID/maps, but how would i see if it has any shared libraries in c?

真的是一个XY problem那么。

您可以简单地使用 dl_iterate_phdr 确定当前进程中是否有共享库.

The dl_iterate_phdr() function walks through the list of an
application's shared objects and calls the function callback once for
each object, until either all shared objects have been processed or
callback returns a nonzero value.

关于c - 是否可以检测程序是否已通过/proc/self/mem 动态链接?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54584515/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com