从 ELFkickers 为 Ubuntu10.04 编译 sstrip:asm/elf.h 问题

发布于 2024-11-06 11:31:07 字数 1169 浏览 0 评论 0原文

我正在尝试在 Linux 下创建小型可执行文件。我的注意力集中在 ELFkickers 集合中以前使用过的 Muppetlabs.com 工具 sstrip ( http://www.muppetlabs.com/~breadbox/software/elfkickers.html) 它从 ELF 可执行文件中剥离的字节数比单独剥离的字节数还要多。 似乎在 HardyHeron 之前它一直存在于 Ubuntu 源中,但现在它消失得无影无踪。 所以我尝试自己编译,但 asm/elf.h 标头似乎处于新位置,并且 gcc 抛出:

gcc -ggdb -Wall -W -o sstrip sstrip.c
sstrip.c:12:21: error: asm/elf.h: No such file or directory
sstrip.c: In function 'readelfheader':
sstrip.c:70: error: 'ELF_DATA' undeclared (first use in this function)
sstrip.c:70: error: (Each undeclared identifier is reported only once
sstrip.c:70: error: for each function it appears in.)
sstrip.c:72: error: 'ELF_CLASS' undeclared (first use in this function)
sstrip.c:77: error: 'ELF_ARCH' undeclared (first use in this function)
sstrip.c: In function 'getmemorysize':
sstrip.c:138: warning: assignment from incompatible pointer type
sstrip.c: In function 'modifyheaders':
sstrip.c:205: warning: assignment from incompatible pointer type
make: *** [sstrip] Error 1

有关如何解决此问题的任何建议?

或者有人知道在 PPA 中哪里可以找到 sstrip 吗? 也许有替代方案?

I'm playing around with creating tiny executables under linux. My attention has come to a formerly used tool from Muppetlabs.com named sstrip from the ELFkickers collection (http://www.muppetlabs.com/~breadbox/software/elfkickers.html)
It strips even more bytes from an ELF executable than strip alone.
And it seems that it was in the Ubuntu feeds until HardyHeron but now its gone without a trace.
So I tried compiling myself, but the asm/elf.h header seems to be on a new position and gcc bails out with:

gcc -ggdb -Wall -W -o sstrip sstrip.c
sstrip.c:12:21: error: asm/elf.h: No such file or directory
sstrip.c: In function 'readelfheader':
sstrip.c:70: error: 'ELF_DATA' undeclared (first use in this function)
sstrip.c:70: error: (Each undeclared identifier is reported only once
sstrip.c:70: error: for each function it appears in.)
sstrip.c:72: error: 'ELF_CLASS' undeclared (first use in this function)
sstrip.c:77: error: 'ELF_ARCH' undeclared (first use in this function)
sstrip.c: In function 'getmemorysize':
sstrip.c:138: warning: assignment from incompatible pointer type
sstrip.c: In function 'modifyheaders':
sstrip.c:205: warning: assignment from incompatible pointer type
make: *** [sstrip] Error 1

Any suggestions on how to fix this?

Or does anyone know where to find sstrip in a PPA?
Maybe an alternative?

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

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

发布评论

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

评论(1

我乃一代侩神 2024-11-13 11:31:07

试试这个:

$ wget http://www.muppetlabs.com/~breadbox/pub/software/ELFkickers-3.0.tar.gz
$ tar xf ELFkickers-3.0.tar.gz
$ cd ELFkickers-3.0/
$ make

然后你就可以在sstrip/目录中找到sstrip二进制文件。如果您遇到错误,请发布 make 命令的输出,以便我们为您提供帮助。

Try this:

$ wget http://www.muppetlabs.com/~breadbox/pub/software/ELFkickers-3.0.tar.gz
$ tar xf ELFkickers-3.0.tar.gz
$ cd ELFkickers-3.0/
$ make

Then you can find the sstrip binary in the sstrip/ directory. If you get errors, please post the output of the make command so we can help you.

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