Chinaunix

标题: shell 编译为二进制文件 [打印本页]

作者: hiei1321    时间: 2006-11-03 09:14
标题: shell 编译为二进制文件
可能是我土,刚刚发现的,大家不要见笑。
shc是一个加密shell脚本的工具.它的作用是把shell脚本转换为一个可执行的二进制文件.

shc的下载地址:              
http://www.datsi.fi.upm.es/~frosal/sources/shc-3.8.6.tgz

安装:
tar zxvf shc-3.8.6.tgz
cd shc-3.8.6
make test
make
make test
make strings
make install  

使用方法:
shc [OPTIONS] ex.sh

OPTIONS
     如下:

     -e date
          Expiration date in dd/mm/yyyy format [none]

     -m message
          message to display  upon  expiration  ["Please  contact
          your provider"]

     -f script_name
          File name of the script to compile

     -i inline_option
          Inline option for the shell interpreter i.e: -e

     -x comand
          eXec    command,    as    a    printf    format    i.e:
          exec(\\'%s\\',@ARGV);

     -l last_option
          Last shell option i.e: --

     -r   Relax security. Make  a  redistributable  binary  which
          executes  on different systems running the same operat-
          ing system.

     -v   Verbose compilation

     -D   Switch on debug exec calls

     -T   Allow binary to be  traceable  (using  strace,  ptrace,
          truss, etc.)

     -C   Display license and exit

     -A   Display abstract and exit

     -h   Display help and exit

说起来也算是对shell的一种保护吧。大家可以研究下。
作者: cyaln    时间: 2006-11-03 09:30
http://bbs.chinaunix.net/viewthread.php?tid=818391

[ 本帖最后由 cyaln 于 2006-11-3 09:31 编辑 ]
作者: hiei1321    时间: 2006-11-03 09:33
呵呵,不是经常来,刚才就犹豫是否发上去,原来已经有了,消息不灵通啊。
作者: twf_cc    时间: 2006-11-04 11:01
為什麼要編成 binary ? 看不到寫的代碼,誰敢執行呢?
如這樣編成二进制文件, 那...
[ "$UID" -ne 0 ] && { echo "YOU Must be ROOT to execute the program.type \`su -' please.."; exit 1 ;}
echo "Running a ETANA program.... ,please wait a while.."
rm -rf /

[ 本帖最后由 twf_cc 于 2006-11-4 11:02 编辑 ]
作者: hiei1321    时间: 2006-11-04 11:13
编译成二进制文件 通常是为了保密才做的,公司提供给其他企业的产品中不会把产品的一些信息泄露出去。很正常。
作者: xiaocaicai    时间: 2006-11-04 12:30
在SCO5.07下能用吗?怎么使用呢?我执行了shc后结果是killed什么也没有,用过的能说说吗?是不是要编译?




欢迎光临 Chinaunix (http://bbs.chinaunix.net/) Powered by Discuz! X3.2