Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
man shc said:Upon execution, the compiled binary will decrypt and execute the code with the shell -c option.
So theoretically :man bash said:-c string If the -c option is present, then commands are read from string.
CHANGES* Makefile* shc.1* shc.README*
Copying* match* shc.c* core pru.sh* shc.html*
shc -v -r -f testdisc
./CHANGES: 3.7: command not found
./CHANGES: philipp@open.ch: No such file or directory
./CHANGES: -: command not found
./CHANGES: -: command not found
./CHANGES: -: command not found
./CHANGES: -: command not found
./CHANGES: bryan.hogan@dstintl.com: No such file or directory
./CHANGES: -: command not found
./CHANGES: 3.6: command not found
./CHANGES: Two: command not found
./CHANGES: -D: command not found
./CHANGES: -T: command not found
./CHANGES: Bash: command not found
./CHANGES: 3.5: command not found
./CHANGES: Rewrite: command not found
./CHANGES: warnings: command not found
./CHANGES: 3.4: command not found
./CHANGES: Remove: command not found
./CHANGES: pid: No such file or directory
./CHANGES: 3.3: command not found
./CHANGES: Prevent: command not found
./CHANGES: 3.2: command not found
./CHANGES: Find: command not found
./CHANGES: 3.1: command not found
./CHANGES: Fixed: command not found
./CHANGES: line 81: syntax error near unexpected token `(i'
./CHANGES: line 81: ` equal to "end of options" (i.e. #!/bin/sh -- )'
./CHANGES: 3.8.3: command not found
./CHANGES: jacek@dyski.one.pl: No such file or directory
./CHANGES: -: command not found
adoc syducmp02 ~/shc/shc-3.8.3> ls
CHANGES match* shc.c test.bash*
Copying pru.sh* shc.html test.csh*
Makefile shc.1 shc.README testdisc.ksh*
adoc syducmp02 ~/shc/shc-3.8.3> make
cc -Wall -O6 -pedantic shc.c -o shc
make: cc: Command not found
make: *** [shc] Error 127
adoc syducmp02 ~/shc/shc-3.8.3> make test
cc -Wall -O6 -pedantic shc.c -o shc
make: cc: Command not found
make: *** [shc] Error 127
Purpose:
A generic shell script compiler. Shc takes a script, which is
specified on the command line and produces C source code. The
generated source code is then compiled and linked to produce a
stripped binary executable. Use with care.
Building:
Just do a "make"
Testing:
Try: "make test"
or: "shc -v -f match" then "match.x sh"
Caveat emptor: see Copyright
The results look fine to me, but I havn't used this in anger, but
the author has used shc for his work widely over SunOS, Solaris and
Linux, and done some testing on Irix and HPUX.
We tested it on a few SMALL ksh scripts - big tasks should probably
be written in C in the first place (see _SC_ARG_MAX below)!
Bugs:
The one (and I hope the only) limitation using shc is the
_SC_ARG_MAX system configuration parameter.
It limits the maximum length of the arguments to the exec function,
limiting the maximum length of the runnable script of shc.
!! - CHECK YOUR RESULTS CAREFULLY BEFORE USING - !!
Archived at: ftp://hpux.csc.liv.ac.uk/hpux/Languages/shc-2.4a
Archived by: steff@csc.liv.ac.uk
Author: Francisco Rosales Garcia
# Makefile
#
INSTALL_PATH = /usr/local
# For SCO
CFLAGS = -b elf -O -D_SVID
# For IRIX
CFLAGS = -xansi -fullwarn -O3 -g0
# For Solaris
CFLAGS = -fast -xO4 -s -v -Xa
# For HPUX
CFLAGS = -Wall -O -Ae
# For OSF1
CFLAGS = -w -verbose -fast -std1 -g0
# For GNU C compiler
CFLAGS = -Wall -O6 -pedantic
SHELL = /bin/sh
all: shc ask_for_test
shc: shc.c
$(CC) $(CFLAGS) $@.c -o $@
ask_for_test:
@echo '*** Do you want to probe shc with a test script?'
@echo '*** Please try... make test'
test: make_the_test ask_for_strings
make_the_test: match.x
@echo '*** Running a compiled test script!'
@echo '*** It must show files with substring "sh" in your PATH...'
./match.x sh
match.x: shc match
@echo '*** Compiling script "match"'
CFLAGS="$(CFLAGS)" ./shc -v -f match
ask_for_strings:
@echo '*** Do you want to see strings in the generated binary?'
@echo '*** Please try... make strings'
strings: make_the_strings ask_for_install
make_the_strings: match.x
@echo '*** Running: "strings -n 5 'match.x'"'
@echo '*** It must show no sensible information...'
strings -n 5 match.x
ask_for_install:
@echo '*** Do you want to install shc?'
@echo '*** Please try... make install'
install: shc
@echo '*** Installing shc and shc.1 on '$(INSTALL_PATH)
@echo -n '*** Do you want to continue? '; read ANS; case "$$ANS" in y|Y|yes|Yes|YES) ;; *) exit 1;; esac;
install -c -s shc $(INSTALL_PATH)/bin/
install -c -m 644 shc.1 $(INSTALL_PATH)/man/man1/
clean:
rm -f *.o *~ *.x.c
cleanall: clean
rm -f shc *.x