开发者

Python - Get build-id from an ELF file

开发者 https://www.devze.com 2023-04-12 09:10 出处:网络
I\'m trying to extract the build-id from and ELF file (Linux kernel module). Right now it\'s开发者_开发知识库 using:

I'm trying to extract the build-id from and ELF file (Linux kernel module). Right now it's开发者_开发知识库 using:

subprocess.check_output(['eu-readelf', '-n', filename]).split()[-1]

I was wondering is there's a more pythony way to achieve the same result?

Thanks, Alex.


Calling the eu-readelf command from python, as you have done, is the most elegant and readable approach. Since python stresses readability, I'd say this is the most Pythonic approach.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号