Chinaunix首页 | 论坛 | 博客
  • 博客访问: 51244
  • 博文数量: 22
  • 博客积分: 941
  • 博客等级: 准尉
  • 技术积分: 242
  • 用 户 组: 普通用户
  • 注册时间: 2010-05-27 13:20
文章分类
文章存档

2012年(3)

2011年(7)

2010年(12)

我的朋友

分类: Python/Ruby

2010-11-01 11:20:06

用shc是很早以前的事了,今天看到群里在讨论,回顾一下:
shc的下载地址

最常用的把shell文件编译成二进制.x文件的方法:
[root@test tmp]# shc -v -r -f check_vipckcode.sh
[root@test tmp]# file check_vipckcode.sh.x
check_vipckcode.sh.x: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for GNU/Linux 2.2.5, dynamically linked (uses shared libs), stripped
这与以C源码编译出来的可执行文件没什么区别,因此,你很难判定它源代码是C还是Shell写出来的,除非用特定的工具:
[root@test tmp]# file check_http
check_http: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for GNU/Linux 2.2.5, dynamically linked (uses shared libs), not stripped

另外一种方式是采用静态编译:
CFLAGS=-static shc -r -f check_vipckcode.sh
[root@test tmp]# file check_vipckcode.sh.x
check_vipckcode.sh.x: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for GNU/Linux 2.2.5, statically linked, stripped
file命令的显示结果明显不一样了。

阅读(644) | 评论(1) | 转发(0) |
给主人留下些什么吧!~~

chinaunix网友2010-11-01 17:45:19

很好的, 收藏了 推荐一个博客,提供很多免费软件编程电子书下载: http://free-ebooks.appspot.com