|
1 |
| -# Shell Script Compiler |
2 |
| - |
3 |
| -A generic shell script compiler. Shc takes a script, which is |
4 |
| -specified on the command line and produces C source code. The |
5 |
| -generated source code is then compiled and linked to produce a |
6 |
| -stripped binary executable. |
7 |
| - |
8 |
| -The compiled binary will still be dependent on the shell specified in the |
9 |
| -first line of the shell code (i.e shebang) (i.e. #!/bin/sh), thus shc does not create com‐ |
10 |
| -pletely independent binaries. |
11 |
| - |
12 |
| -shc itself is not a compiler such as cc, it rather encodes and encrypts a |
13 |
| -shell script and generates C source code with the added expiration capability. |
14 |
| -It then uses the system compiler to compile a stripped binary which behaves |
15 |
| -exactly like the original script. Upon execution, the compiled binary will |
16 |
| -decrypt and execute the code with the shell -c option. |
17 |
| - |
18 |
| -Install: |
19 |
| --------- |
20 |
| - |
21 |
| -1. cd to directory "main": `cd main` |
22 |
| -2. do a `make` |
23 |
| -3. and then `sudo make install` |
24 |
| -4. or simply run the `install` script/file provided, in terminal. |
25 |
| - |
26 |
| -Usage: |
27 |
| ------- |
28 |
| -``` |
29 |
| -shc [options] |
30 |
| -shc -f script.sh -o binary |
31 |
| -``` |
32 |
| - |
33 |
| - |
34 |
| - |
35 |
| -Testing: |
36 |
| --------- |
37 |
| - |
38 |
| -1. cd to `test` directory: `cd test` |
39 |
| -2. Try: `shc -f test.bash -o test` |
40 |
| -3. output binary file will be test. If no output file is specified |
41 |
| -by the `-o` option, then it will create an executable with `.x` extension by default. |
42 |
| - |
43 |
| - |
44 |
| -Known bugs: |
45 |
| ------------ |
46 |
| - |
47 |
| -The one (and I hope the only) limitation using shc is the |
48 |
| -_SC_ARG_MAX system configuration parameter. |
49 |
| - |
50 |
| -It limits the maximum length of the arguments to the exec function, |
51 |
| -limiting the maximum length of the runnable script of shc. |
52 |
| - |
53 |
| -!! - CHECK YOUR RESULTS CAREFULLY BEFORE USING - !! |
54 |
| -<h2><a href="http://neurobin.github.io/shc">WebPage</a></h2> |
| 1 | +README.md |
0 commit comments