摘选自:《SKILL Language User Guide Product Version 06.40 August 2005》第十章的第三小节(P238)
Allegro SKILL提供了两种方法使得发布的代码对终端用户是不可读的:加密和压缩。
在Allegro SKILL中可以对SKILL 程序 和数据文件进行加密。加密后的文件可以被load,loadi和include函数重新加载。encrypt函数加密源代码,然后生成的源代码保存为另一个文件。如果加密过程中设置了密码,那么在加载代码时,提供同样的密码。
;;This is a demo
axlCmdRegister("Test" 'Test)
defun(Test ()
setq( x 5 )
printf("x = %d\n", x)
if( (x < 10)
printf("if: x < 10\n")
)
printf("this is a test\n")
) ;;end defun
;;设置密码
encrypt( "test.il" "test_enc_passwd.il" "password")
或
(encrypt "test.il" "test_enc_passwd.il" "password")
;;无密码
encrypt( "test.il" "test_enc_passwd.il" )
或
(encrypt "test.il" "test_enc_passwd.il" )
;;无密码
load( "test_enc.il" )
;;有密码
load( "test_enc_passwd.il" "password")

1.在Allegro CMD中键入skill,回车;
2.在Skill提示符右侧键入:encrypt( "test.il" "test_enc_passwd.il" "password")
3.加载加密后脚本(提供解密密码):load("test_enc_passwd.il" "password")
4.测试:在skill提示符右侧键入Test
免责声明:本文系网络转载或改编,未找到原创作者,版权归原作者所有。如涉及版权,请联系删