如何取消删除目标文件?

发布于 2024-09-12 18:56:09 字数 598 浏览 0 评论 0原文

如何取消剥离已剥离的目标文件?

eu-unstrip from elfutils 可以为我做这个吗?

我需要它来将 zImage 内核转换为 vmlinux,而无需重新编译。

这是我的脚本的一部分:

magic="1f 8b 08 00"
full_line=$(od -A d -t x1 zImage | grep "$magic" )
offset_full_line=$( echo $full_line | cut -f1 -d" ")
data_full_line=$( echo $full_line | cut -f1 -d" " --complement )
index=$[ $( awk -v a="$data_full_line" -v b="$magic" 'BEGIN{print index(a,b)}' ) / 3 ]
offset=$[ 10#$offset_full_line + $index ]

dd if=zImage bs=1 skip=$offset 2>/dev/null | zcat > vmlinux

但是我的结果 vmlinux 的格式未知,因为它不包含 ELF 标头,那么我如何恢复这些标头?

How do i unstrip a stripped object file ?

Does eu-unstrip from elfutils can make this for me ?

I need this to convert a zImage kernel to vmlinux without recompiling.

This is apart of my script:

magic="1f 8b 08 00"
full_line=$(od -A d -t x1 zImage | grep "$magic" )
offset_full_line=$( echo $full_line | cut -f1 -d" ")
data_full_line=$( echo $full_line | cut -f1 -d" " --complement )
index=$[ $( awk -v a="$data_full_line" -v b="$magic" 'BEGIN{print index(a,b)}' ) / 3 ]
offset=$[ 10#$offset_full_line + $index ]

dd if=zImage bs=1 skip=$offset 2>/dev/null | zcat > vmlinux

But my result vmlinux has an unknown format because it doesn't contain ELF headers, so how can i recover those headers ?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

纵情客 2024-09-19 18:56:09

你的问题没有意义。如果目标文件已被删除,那么显然该信息不再存在。您无处可提取剥离的数据。

Your question makes no sense. If the object file has been stripped, then obviously the information is no longer there. You've got nowhere to extract the stripped data from.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文