20 April 2013

SHC 3.8.9 MSYS port

To continue previous post, I actually port shc-3.8.9 quite long time ago for fun. But now I want to see if it can act as a wrapper for shellscript (bash/perl) under plain cmd box. And boom it failed :-))

SHC is actually an encryptor not compiler, with time trial feature (not tested). I don't quite remember anymore how I patched this little tool. But as usual MSYS is lacking this and that so it need bandage or cutoff :)

SHC however does need compiler (msysdev-gcc) to build its decryptor along the launcher itself. I have tested it under bash and it works fine. Under cmd box things are bit vague, it seems like:

decryptor -> look for shell (based on shebang?) -> found, sh launched -> ...WTF?... -> launch new cmd.exe session (again) instead

Hmmm

anyway it works for MSYS :-p

Download: http://osspack32.googlecode.com/files/shc-3.8.9.7z

Note make sure msysdev-gcc is ready and always use the -T option of shc

3 comments:

  1. May be the correction of shabang path helps.
    cmd.exe can't find /bin/bash, otherwise mintty or rxvt.
    Decryptor doesn't find sh.exe and launches default shell from the system environment variable (it is just an assumption).

    ReplyDelete
    Replies
    1. I think sh/bash/perl was found and in fact launched (as reported by filemon), however the decrypted data is not/failed to be executed.

      Delete
  2. Your port is very similar to cygwin port from
    http://eschuch.blogspot.com.br/2012/06/shcexe-compiling-bash-script-under.html
    though it is very useful.

    Thank you.

    ReplyDelete