diff --git a/ChangeLog b/ChangeLog index 69432b7..2e935a7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -44,29 +44,29 @@ CHANGES * zsh support * Fix issue #13 (https://github.com/neurobin/shc/issues/13) - + 3.9.2 Fri Aug 21 16:12:33 BDT 2015 - + Added BusyBox support with patch taken from: https://onedrive.live.com/prev?cid=18a41d08a9f3c543&id=18A41D08A9F3C543!231&authkey=!AJQ6Iah_5D3WJ60&v=TextFileEditor as suggested by https://github.com/marcoburatto 3.9.1 Fri Apr 03 00:22:11 GMT 2015 - + Renamed option -T to -U and reversed it's logic. So now, the executable prepared will execute without using sudo, by default. -3.9.0 Wed Apr 01 08:35:22 AM GMT 2015 +3.9.0 Wed Apr 01 08:35:22 AM GMT 2015 (http://github.com/neurobin) Added output file option with [-o filename] and fixed bug on make install (manual install failed) Now you can access manual by entering command: man shc in a terminal. - + 3.8.9 Wed Apr 25 09:24:25 CEST 2012 @@ -122,8 +122,8 @@ CHANGES - Fixed bug: "rlax" used after encryption. Thanks to Nalneesh Gaur for: - - Read permision of the script.x exposes it to disassembling. - - Group and others read permision is now removed by default. + - Read permission of the script.x exposes it to disassembling. + - Group and others read permission is now removed by default. @@ -227,16 +227,15 @@ SCO, both not used now. 3.0b1 Wed Feb 26 14:27:22 WET 1997 The main difference with 2.4 is that in it the script was -compressed an then shuffle around, now int 3.0 the script is encripted -with an inline code, so not needend any external comand to work, and been -faster at startup. Other related adventage is that the only information -not encripted in .x.c is an stamp, expiration date and provider email +compressed an then shuffle around, now int 3.0 the script is encrypted +with an inline code, so not needing any external command to work, and been +faster at startup. Other related advantage is that the only information +not encrypted in .x.c is an stamp, expiration date and provider email address. - Something equivalent to cheksums have been used to enforced at + Something equivalent to checksums have been used to enforced at execution that the executing shell has not been modified from the time -the script was compiled. If anybody tries to change the excuting shell, +the script was compiled. If anybody tries to change the executing shell, .x will refuse to execute. The generated .x.c source code is now readable. - diff --git a/man.md b/man.md index 6c3dd90..a7b3462 100644 --- a/man.md +++ b/man.md @@ -127,4 +127,3 @@ Md Jahidul Hamid # REPORT BUGS TO https://github.com/neurobin/shc/issues - diff --git a/src/shc.c b/src/shc.c index 2475311..04475a4 100644 --- a/src/shc.c +++ b/src/shc.c @@ -21,9 +21,9 @@ static const char version[] = "Version 4.0.3"; static const char subject[] = "Generic Shell Script Compiler"; static const char cpright[] = "GNU GPL Version 3"; static const struct { const char * f, * s, * e; } - provider = { "Md Jahidul", "Hamid", "" }; + provider = { "Md Jahidul", "Hamid", "" }; -/* +/* static const struct { const char * f, * s, * e; } author = { "Francisco", "Garcia", "" }; */ @@ -57,7 +57,7 @@ static const char * abstract[] = { " of the script specified at command line.", "", " Binary version will be saved with a .x extension by default.", -" You can specify output file name too with [-o filname] option.", +" You can specify output file name too with [-o outfile] option.", "", " You can specify expiration date [-e] too, after which binary will", " refuse to be executed, displaying \"[-m]\" instead.", @@ -67,7 +67,7 @@ static const char * abstract[] = { "", 0}; -static const char usage[] = +static const char usage[] = "Usage: shc [-e date] [-m addr] [-i iopt] [-x cmd] [-l lopt] [-o outfile] [-rvDSUHCAB2h] -f script"; static const char * help[] = { @@ -279,7 +279,7 @@ static const char * RTC[] = { "}", "", "/*", -" * Crypt data. ", +" * Encrypt data. ", " */", "void arc4(void * str, int len)", "{", @@ -895,7 +895,7 @@ static void parse_args(int argc, char * argv[]) if (ret == -1) err++; } while (ret); - + if (err) { fprintf(stderr, "\n%s %s\n\n", my_name, usage); exit(1); @@ -907,7 +907,7 @@ static void parse_args(int argc, char * argv[]) static unsigned char stte[256], indx, jndx, kndx; /* - * Reset arc4 stte. + * Reset arc4 stte. */ void stte_0(void) { @@ -918,7 +918,7 @@ void stte_0(void) } /* - * Set key. Can be used more than once. + * Set key. Can be used more than once. */ void key(void * str, int len) { @@ -937,7 +937,7 @@ void key(void * str, int len) } /* - * Crypt data. + * Encrypt data. */ void arc4(void * str, int len) { @@ -1167,7 +1167,7 @@ void prnt_array(FILE * o, void * ptr, char * name, int l, char * cast) int m = rand_mod(1+l/4); /* Random amount of random pre padding (offset) */ int n = rand_mod(1+l/4); /* Random amount of random post padding (tail) */ int a = (offset+m)%l; - if (cast && a) m += l - a; /* Type alignement. */ + if (cast && a) m += l - a; /* Type alignment. */ fprintf(o, "\n"); fprintf(o, "#define %s_z %d", name, l); fprintf(o, "\n"); @@ -1361,4 +1361,3 @@ int main(int argc, char * argv[]) exit(1); return 1; } - diff --git a/test/pru.sh b/test/pru.sh old mode 100644 new mode 100755 index bc7d798..341a474 --- a/test/pru.sh +++ b/test/pru.sh @@ -3,5 +3,6 @@ echo "$0" "$@" ps $$ ps wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww $$ cat /proc/$$/cmdline -touch $0.kk -read ENTER +touch "$0.kk" +# shellcheck disable=SC2034 +read -r ENTER diff --git a/test/ttest.sh b/test/ttest.sh index dbab360..9cb72ad 100755 --- a/test/ttest.sh +++ b/test/ttest.sh @@ -16,13 +16,14 @@ pc=0 fc=0 echo echo "== Running tests ..." -for shell in ${shells[@]}; do +for shell in "${shells[@]}"; do for opt in "${check_opts[@]}"; do tmpd=$(mktemp -d) - tmpf="$tmpd/test.$(basename $shell)" + tmpf="$tmpd/test.$(basename "$shell")" echo '#!'"$shell echo 'Hello World fp:'\$1 sp:\$2 " > "$tmpf" + # shellcheck disable=SC2086 "$shc" $opt -f "$tmpf" -o "$tmpd/a.out" out=$("$tmpd/a.out" first second) #~ echo " Output: $out"