Skip to content

Commit

Permalink
3.9.3
Browse files Browse the repository at this point in the history
  • Loading branch information
neurobin committed Jul 30, 2016
1 parent 7e67649 commit a06051e
Show file tree
Hide file tree
Showing 5 changed files with 134 additions and 181 deletions.
12 changes: 9 additions & 3 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
CHANGES

3.9.3 Sat Jul 30 18:46:34 BDT 2016

* 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:
Expand All @@ -15,9 +21,9 @@ CHANGES

3.9.0 Wed Apr 01 08:35:22 AM GMT 2015

Thanks to me http://github.com/neurobin,
for adding output file option with [-o filename]
and fixing bug on make install (manual install failed)
(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.

Expand Down
55 changes: 1 addition & 54 deletions README
Original file line number Diff line number Diff line change
@@ -1,54 +1 @@
# Shell Script Compiler

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.

The compiled binary will still be dependent on the shell specified in the
first line of the shell code (i.e shebang) (i.e. #!/bin/sh), thus shc does not create com‐
pletely independent binaries.

shc itself is not a compiler such as cc, it rather encodes and encrypts a
shell script and generates C source code with the added expiration capability.
It then uses the system compiler to compile a stripped binary which behaves
exactly like the original script. Upon execution, the compiled binary will
decrypt and execute the code with the shell -c option.

Install:
--------

1. cd to directory "main": `cd main`
2. do a `make`
3. and then `sudo make install`
4. or simply run the `install` script/file provided, in terminal.

Usage:
------
```
shc [options]
shc -f script.sh -o binary
```



Testing:
--------

1. cd to `test` directory: `cd test`
2. Try: `shc -f test.bash -o test`
3. output binary file will be test. If no output file is specified
by the `-o` option, then it will create an executable with `.x` extension by default.


Known 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 - !!
<h2><a href="http://neurobin.github.io/shc">WebPage</a></h2>
README.md
248 changes: 124 additions & 124 deletions autom4te.cache/requests
Original file line number Diff line number Diff line change
Expand Up @@ -34,47 +34,47 @@
'configure.ac'
],
{
'AM_PROG_INSTALL_SH' => 1,
'AM_SET_CURRENT_AUTOMAKE_VERSION' => 1,
'_AC_AM_CONFIG_HEADER_HOOK' => 1,
'_AM_DEPENDENCIES' => 1,
'_AM_SET_OPTIONS' => 1,
'AM_OUTPUT_DEPENDENCY_COMMANDS' => 1,
'_AM_IF_OPTION' => 1,
'AM_AUTOMAKE_VERSION' => 1,
'_m4_warn' => 1,
'AM_AUX_DIR_EXPAND' => 1,
'm4_pattern_forbid' => 1,
'm4_pattern_allow' => 1,
'AM_CONDITIONAL' => 1,
'AM_INIT_AUTOMAKE' => 1,
'_AM_AUTOCONF_VERSION' => 1,
'_AM_OUTPUT_DEPENDENCY_COMMANDS' => 1,
'AC_DEFUN' => 1,
'_AM_PROG_TAR' => 1,
'AM_AUX_DIR_EXPAND' => 1,
'include' => 1,
'_AM_SUBST_NOTMAKE' => 1,
'AC_CONFIG_MACRO_DIR_TRACE' => 1,
'AM_INIT_AUTOMAKE' => 1,
'AM_PROG_CC_C_O' => 1,
'AU_DEFUN' => 1,
'AM_SET_LEADING_DOT' => 1,
'_AC_AM_CONFIG_HEADER_HOOK' => 1,
'_AM_PROG_TAR' => 1,
'AM_SET_DEPDIR' => 1,
'AM_DEP_TRACK' => 1,
'AM_PROG_INSTALL_STRIP' => 1,
'AC_CONFIG_MACRO_DIR' => 1,
'_m4_warn' => 1,
'AM_MISSING_HAS_RUN' => 1,
'AM_MISSING_PROG' => 1,
'AM_CONDITIONAL' => 1,
'_AM_MANGLE_OPTION' => 1,
'AC_DEFUN_ONCE' => 1,
'_AM_PROG_CC_C_O' => 1,
'AM_SET_DEPDIR' => 1,
'AM_SANITY_CHECK' => 1,
'_AM_IF_OPTION' => 1,
'AM_OUTPUT_DEPENDENCY_COMMANDS' => 1,
'AM_MAKE_INCLUDE' => 1,
'AM_SILENT_RULES' => 1,
'_AM_SUBST_NOTMAKE' => 1,
'AM_SUBST_NOTMAKE' => 1,
'_AM_CONFIG_MACRO_DIRS' => 1,
'AC_CONFIG_MACRO_DIR_TRACE' => 1,
'AM_AUTOMAKE_VERSION' => 1,
'AM_PROG_INSTALL_SH' => 1,
'AM_MAKE_INCLUDE' => 1,
'AM_MISSING_PROG' => 1,
'm4_pattern_allow' => 1,
'_AM_AUTOCONF_VERSION' => 1,
'AM_RUN_LOG' => 1,
'_AM_SET_OPTIONS' => 1,
'_AM_DEPENDENCIES' => 1,
'AM_SUBST_NOTMAKE' => 1,
'AM_PROG_CC_C_O' => 1,
'include' => 1,
'_AM_MANGLE_OPTION' => 1,
'AC_DEFUN_ONCE' => 1,
'AM_PROG_INSTALL_STRIP' => 1,
'AU_DEFUN' => 1,
'_AM_OUTPUT_DEPENDENCY_COMMANDS' => 1,
'AM_SANITY_CHECK' => 1,
'_AM_SET_OPTION' => 1,
'm4_include' => 1
'm4_include' => 1,
'AM_SET_CURRENT_AUTOMAKE_VERSION' => 1
}
], 'Autom4te::Request' ),
bless( [
Expand All @@ -91,64 +91,64 @@
'configure.ac'
],
{
'LT_CONFIG_LTDL_DIR' => 1,
'AC_FC_SRCEXT' => 1,
'_AM_MAKEFILE_INCLUDE' => 1,
'm4_pattern_allow' => 1,
'AC_FC_PP_SRCEXT' => 1,
'AC_CONFIG_SUBDIRS' => 1,
'AM_PROG_FC_C_O' => 1,
'AC_CANONICAL_HOST' => 1,
'AC_SUBST_TRACE' => 1,
'AM_PROG_CXX_C_O' => 1,
'_AM_SUBST_NOTMAKE' => 1,
'AM_MAINTAINER_MODE' => 1,
'm4_include' => 1,
'_AM_COND_IF' => 1,
'AC_CONFIG_FILES' => 1,
'AC_CANONICAL_BUILD' => 1,
'LT_SUPPORTED_TAG' => 1,
'AC_LIBSOURCE' => 1,
'AM_SILENT_RULES' => 1,
'AC_CONFIG_HEADERS' => 1,
'AC_CANONICAL_SYSTEM' => 1,
'AM_PROG_F77_C_O' => 1,
'AC_SUBST' => 1,
'AM_MAKEFILE_INCLUDE' => 1,
'AM_AUTOMAKE_VERSION' => 1,
'AM_GNU_GETTEXT_INTL_SUBDIR' => 1,
'AC_INIT' => 1,
'AC_CONFIG_LINKS' => 1,
'AC_CONFIG_LIBOBJ_DIR' => 1,
'AM_CONDITIONAL' => 1,
'AM_ENABLE_MULTILIB' => 1,
'm4_sinclude' => 1,
'AH_OUTPUT' => 1,
'AC_FC_PP_SRCEXT' => 1,
'LT_INIT' => 1,
'AC_CONFIG_AUX_DIR' => 1,
'AM_MAINTAINER_MODE' => 1,
'AC_FC_FREEFORM' => 1,
'_AM_COND_ENDIF' => 1,
'AM_GNU_GETTEXT' => 1,
'AC_FC_SRCEXT' => 1,
'AC_INIT' => 1,
'AM_INIT_AUTOMAKE' => 1,
'_AM_COND_ELSE' => 1,
'AC_CONFIG_LINKS' => 1,
'include' => 1,
'AM_PROG_CC_C_O' => 1,
'AC_CONFIG_AUX_DIR' => 1,
'AC_PROG_LIBTOOL' => 1,
'm4_include' => 1,
'AM_POT_TOOLS' => 1,
'AC_CONFIG_SUBDIRS' => 1,
'AM_PROG_LIBTOOL' => 1,
'_AM_SUBST_NOTMAKE' => 1,
'AC_CANONICAL_TARGET' => 1,
'AM_GNU_GETTEXT_INTL_SUBDIR' => 1,
'LT_INIT' => 1,
'LT_SUPPORTED_TAG' => 1,
'AM_PROG_AR' => 1,
'AM_PROG_FC_C_O' => 1,
'_LT_AC_TAGCONFIG' => 1,
'AM_CONDITIONAL' => 1,
'AM_PROG_MOC' => 1,
'AC_CANONICAL_HOST' => 1,
'm4_pattern_allow' => 1,
'm4_pattern_forbid' => 1,
'AC_LIBSOURCE' => 1,
'AC_CONFIG_LIBOBJ_DIR' => 1,
'AM_ENABLE_MULTILIB' => 1,
'AM_PATH_GUILE' => 1,
'AM_XGETTEXT_OPTION' => 1,
'include' => 1,
'AM_PROG_AR' => 1,
'AM_NLS' => 1,
'AC_DEFINE_TRACE_LITERAL' => 1,
'sinclude' => 1,
'_AM_COND_IF' => 1,
'_AM_MAKEFILE_INCLUDE' => 1,
'AM_PROG_CXX_C_O' => 1,
'AC_FC_PP_DEFINE' => 1,
'AC_CANONICAL_BUILD' => 1,
'AM_INIT_AUTOMAKE' => 1,
'AM_NLS' => 1,
'AM_PROG_F77_C_O' => 1,
'AC_CANONICAL_SYSTEM' => 1,
'_LT_AC_TAGCONFIG' => 1,
'AH_OUTPUT' => 1,
'sinclude' => 1,
'AM_AUTOMAKE_VERSION' => 1,
'AM_GNU_GETTEXT' => 1,
'_m4_warn' => 1,
'AC_SUBST' => 1,
'AC_CONFIG_HEADERS' => 1,
'AC_REQUIRE_AUX_FILE' => 1,
'AM_XGETTEXT_OPTION' => 1,
'_m4_warn' => 1
'LT_CONFIG_LTDL_DIR' => 1,
'AM_PROG_MOC' => 1,
'AM_MAKEFILE_INCLUDE' => 1,
'_AM_COND_ENDIF' => 1,
'AM_POT_TOOLS' => 1,
'AM_PROG_LIBTOOL' => 1,
'm4_pattern_forbid' => 1,
'AC_PROG_LIBTOOL' => 1
}
], 'Autom4te::Request' ),
bless( [
Expand All @@ -163,66 +163,66 @@
'configure.ac'
],
{
'AM_EXTRA_RECURSIVE_TARGETS' => 1,
'AC_CANONICAL_SYSTEM' => 1,
'AC_CONFIG_HEADERS' => 1,
'AC_SUBST' => 1,
'AM_PROG_F77_C_O' => 1,
'LT_CONFIG_LTDL_DIR' => 1,
'AC_SUBST_TRACE' => 1,
'AM_SILENT_RULES' => 1,
'AM_MAINTAINER_MODE' => 1,
'AC_CONFIG_FILES' => 1,
'_AM_SUBST_NOTMAKE' => 1,
'AM_PROG_CXX_C_O' => 1,
'AC_FC_FREEFORM' => 1,
'AM_GNU_GETTEXT' => 1,
'_AM_COND_ENDIF' => 1,
'AM_AUTOMAKE_VERSION' => 1,
'AM_MAKEFILE_INCLUDE' => 1,
'AC_FC_PP_SRCEXT' => 1,
'AH_OUTPUT' => 1,
'AM_MAINTAINER_MODE' => 1,
'm4_sinclude' => 1,
'AC_CONFIG_AUX_DIR' => 1,
'AM_PROG_CC_C_O' => 1,
'LT_INIT' => 1,
'AC_CONFIG_LIBOBJ_DIR' => 1,
'AM_ENABLE_MULTILIB' => 1,
'AM_CONDITIONAL' => 1,
'AC_CONFIG_LINKS' => 1,
'include' => 1,
'AC_PROG_LIBTOOL' => 1,
'_AM_COND_ELSE' => 1,
'AM_GNU_GETTEXT_INTL_SUBDIR' => 1,
'AC_INIT' => 1,
'AC_FC_SRCEXT' => 1,
'AM_PROG_LIBTOOL' => 1,
'AM_POT_TOOLS' => 1,
'm4_include' => 1,
'AC_CONFIG_SUBDIRS' => 1,
'AM_PROG_AR' => 1,
'AM_SILENT_RULES' => 1,
'AC_CANONICAL_BUILD' => 1,
'LT_SUPPORTED_TAG' => 1,
'_LT_AC_TAGCONFIG' => 1,
'AC_LIBSOURCE' => 1,
'AC_CONFIG_FILES' => 1,
'm4_include' => 1,
'_AM_COND_IF' => 1,
'AM_PROG_FC_C_O' => 1,
'AC_CANONICAL_TARGET' => 1,
'LT_INIT' => 1,
'AM_GNU_GETTEXT_INTL_SUBDIR' => 1,
'AM_ENABLE_MULTILIB' => 1,
'AM_PATH_GUILE' => 1,
'AC_CONFIG_LIBOBJ_DIR' => 1,
'AM_PROG_MKDIR_P' => 1,
'AC_SUBST_TRACE' => 1,
'AC_CANONICAL_HOST' => 1,
'AM_PROG_MOC' => 1,
'AM_CONDITIONAL' => 1,
'AC_LIBSOURCE' => 1,
'm4_pattern_forbid' => 1,
'm4_pattern_allow' => 1,
'AC_FC_PP_DEFINE' => 1,
'AC_FC_PP_SRCEXT' => 1,
'AC_CONFIG_SUBDIRS' => 1,
'AC_FC_SRCEXT' => 1,
'_AM_MAKEFILE_INCLUDE' => 1,
'AM_EXTRA_RECURSIVE_TARGETS' => 1,
'AM_PROG_LIBTOOL' => 1,
'AC_PROG_LIBTOOL' => 1,
'm4_pattern_forbid' => 1,
'_AM_COND_ENDIF' => 1,
'AM_POT_TOOLS' => 1,
'AM_MAKEFILE_INCLUDE' => 1,
'AM_PROG_MOC' => 1,
'AM_PROG_MKDIR_P' => 1,
'AC_REQUIRE_AUX_FILE' => 1,
'AM_NLS' => 1,
'AC_CANONICAL_BUILD' => 1,
'AM_INIT_AUTOMAKE' => 1,
'LT_CONFIG_LTDL_DIR' => 1,
'AM_AUTOMAKE_VERSION' => 1,
'AM_GNU_GETTEXT' => 1,
'AC_CONFIG_HEADERS' => 1,
'AC_SUBST' => 1,
'_m4_warn' => 1,
'AC_CANONICAL_SYSTEM' => 1,
'sinclude' => 1,
'_AM_COND_IF' => 1,
'AH_OUTPUT' => 1,
'_LT_AC_TAGCONFIG' => 1,
'AC_FC_PP_DEFINE' => 1,
'AM_PROG_F77_C_O' => 1,
'AC_DEFINE_TRACE_LITERAL' => 1,
'_AM_MAKEFILE_INCLUDE' => 1,
'_m4_warn' => 1,
'AM_XGETTEXT_OPTION' => 1
'AM_PROG_CXX_C_O' => 1,
'include' => 1,
'AM_NLS' => 1,
'AM_PROG_AR' => 1,
'AM_XGETTEXT_OPTION' => 1,
'AC_CANONICAL_TARGET' => 1,
'_AM_SUBST_NOTMAKE' => 1,
'AM_PATH_GUILE' => 1,
'_AM_COND_ELSE' => 1,
'AM_INIT_AUTOMAKE' => 1,
'AM_PROG_CC_C_O' => 1
}
], 'Autom4te::Request' )
);
Expand Down
Binary file modified bin/x32/shc
Binary file not shown.
Binary file modified bin/x64/shc
Binary file not shown.

0 comments on commit a06051e

Please sign in to comment.