从 ELFkickers 为 Ubuntu10.04 编译 sstrip:asm/elf.h 问题
我正在尝试在 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
试试这个:
然后你就可以在sstrip/目录中找到sstrip二进制文件。如果您遇到错误,请发布
make
命令的输出,以便我们为您提供帮助。Try this:
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.