1

I wanna create a exe which has the Shell Script and Simple CPP file which calls the Shell Script using system() function. Lets say exe name 'myInstaller' which has files myintsaller.cpp and myShell.sh. When i run the exe myInstaller , it must execute shell script. I want to do like this so i can protect my Shell Script code ,which has over 3000 lines of Code.

How do i do this ... I m in real need of this.

1
  • 1
    google around for shell compilers (there are a few, and the purpose is to protect shell code from prying eyes). Good luck. Commented Mar 2, 2012 at 22:17

3 Answers 3

1

As far as i've searched, there is no way to bundle the script inside the exe. Either it would be Shell Compiler as shelter suggested or plain shell scripts. No work around for this.

Sign up to request clarification or add additional context in comments.

Comments

0

I guess it's Windows platform since you speak about exe. In this case you can add your script as a resource to your exe, extract it in run-time and execute.

1 Comment

NO , i m talking about linux. Remember i m using Shell Script , and i don't want to extract it. If i extract it, user will be able to see my code
0

You could keep the script as a string in your C++ code and call system("sh -c '" + code + "'"). Quoting may be an issue though. Otherwise, write it to a temp location, execute it and then unlink it.

1 Comment

You meant to add 3000 lines of Script to a CPP as a String ..? That won't be quite good i hope.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.