Tiny Core Linux
Tiny Core Extensions => TCE Q&A Forum => Topic started by: malikawan on October 10, 2017, 05:47:13 AM
-
I have compile shc with out any error :D but when i convert my shell script with shc to binary it gives me error xxx.sh.x: applet not found :-[
Please any idea about that.
Thanks
Regards
Malik Awan
-
what does "ldd yourshellscriptbinary" give?
-
Hi malikawan
... it gives me error xxx.sh.x: applet not found ...
You're not clear if the error occurs while converting your script or if it occurs when running the executable that was created.
sch requires a compiler in order to run, so compiletc.tcz should be installed.
The output from shc is not an independent binary. It still relies on the shell scripting language specified on the first line
of your script. So if the first line of your script reads:
#!/bin/bash
then your executable will expect to find /bin/bash.
-
I believe it's a busybox issue.
In the C code it generated:
.....
#define BUSYBOXON 0 /* Define as 1 to enable work with busybox */
.....
#if BUSYBOXON
varg[j++] = "busybox";
varg[j++] = "sh";
#else
varg[j++] = argv[0]; /* My own name at execution */
#endif
.....
You'll need to enable busybox.
tc@box:/tmp/hello$ shc -B -f hello.sh -o hello
tc@box:/tmp/hello$ ./hello
Hello world!
I don't really see the benefit of it though, the binaries are bigger than their original source scripts. :o
-
Hi polikuo
I don't really see the benefit of it though, the binaries are bigger than their original source scripts.
From what I could tell, it lets you hide a scripts contents and prevent modification. Aside from larger binaries, they would not
run any faster since they are still being passed through the shell interpreter.
-
From what I could tell, it lets you hide a scripts contents and prevent modification. Aside from larger binaries, they would not
run any faster since they are still being passed through the shell interpreter.
Oh! :o
That could come in handy some day.
I just read the manual (https://neurobin.org/projects/softwares/unix/shc/man.html):
shc's main purpose is to protect your shell scripts from modification or inspection. You can use it if you wish to distribute your scripts but don't want them to be easily readable by other people.
BTW, the manual also states that one can set an expiration date. :o
If you supply an expiration date with the -e option, the compiled binary will refuse to run after the date specified. The message Please contact your provider will be displayed instead. This message can be changed with the -m option.
Never jump to conclusions. :P
-
Hi polikuo
BTW, the manual also states that one can set an expiration date.
Forgot about that, but it was 2 weeks ago that I glanced through the manual and my memory isn't what it used to be. ::)