利用:
readelf -d **.so | grep NEEDED | awk '{print $5}' | sort | xargs | md5sum | cut -f1 | awk '{print $1}'
c++代码中使用popen函数来拿到值。
————————————————
版权声明:本文为CSDN博主「快乐的霖霖」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/chdhust/article/details/51173426
文件夹的md5:
dir_name=r"E:\0318\\"
g = os.walk(dir_name)
img_paths = ['%s/%s' % (i[0], j) for i in g for j in i[-1] if
j.endswith('mnn')or j.endswith('so')]
for file_name in img_paths:
with open(file_name, 'rb') as fp:
data = fp.read()
file_md5= hashlib.md5(data).hexdigest()
print(file_md5,file_name.replace(dir_name,""))
python:
#!/usr/bin/env python
# -