> (load "/usr/share/newlisp/util/link.lsp")Quote
(lambda (orgExe newExeName lispSourceName) (println "original newlisp executable:"
orgExe)
(println "new executable:" newExeName)
(println "source:" lispSourceName)
(set 'size (first (file-info orgExe)))
(copy-file orgExe newExeName)
(set 'buff (pack "ld" size))
(set 'handle (open newExeName "u"))
(search handle "@@@@@@@@")
(write-buffer handle buff 4)
(set 'buff (read-file lispSourceName))
(set 'keylen (pack "ld" (length buff)))
(write-buffer handle keylen 4)
(seek handle size)
(set 'buff (encrypt buff (string (length buff))))
(write-buffer handle buff (length buff))
(close handle))
then
> (link "/usr/bin/newlisp" "hw" "hw.lsp")Quote
original newlisp executable:/usr/bin/newlisp
new executable:hw
source:hw.lsp
true