Want to convert to exe file


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Want to convert to exe file
# 8  
Old 05-08-2014
You can obfuscate the script all you want, but to run the script on a machine, it must decrypt on the machine, so that doesn't actually get you anything.
# 9  
Old 05-08-2014
You may have to write it directly in C and then write an installation script that you can deliver it with. The script would (probably) extract & decrypt your source C, compile it and then remove the source code.

Not a great plan, because I can hardly write in C myself, so it's no easy task. You might be able to script a similar logic using shc, but it might be tricky to ensure it will work for every server you might want to deliver it to.

..... and like Corona688 says, it's only obscuring it. There will always be a way to reverse engineer it if the end user is determined enough. It might be enough to deter a casual curious customer though.



Robin
# 10  
Old 05-08-2014
Hi.

There is a built-in compiler with ksh (93):
Code:
SHCOMP(1)                 User Environment Utilities                 SHCOMP(1)

NAME
       shcomp - compile a ksh93 shell script

SYNOPSIS
       shcomp [ options ] [infile] [outfile]]

...

EXAMPLE
       ( echo '#! /bin/ksh93' ; shcomp myscript ) > myscript.bin &&
       chmod 755 myscript.bin
       ./myscript.bin

-- excerpt from man shcomp.

That seems to be easy to try. Whether it is good for the OP requirements is hard to say.

Best wishes ... cheers, drl
This User Gave Thanks to drl For This Post:
# 11  
Old 05-09-2014
I'm not sure that shcomp is in ksh93. I think it is a separate executable and not always supplied by default. I have AIX 6.1.8 which doesn't have it and RHEL 6.5 which doesn't even list it if I yum whatprovides */shcomp I did, however, get zsh offered on a wider search but that seems to be a different shell altogether.

I did find a hit here for source code, but not being a C programmer, I have no idea how to compile it other than:-
Code:
gcc -o shcomp shcomp.c

..... which gave a load of errors that I don't understand at all.


I've used shc but struggled with the limited portability of the object. Perhaps shcomp is an alternative with more portability, even if there is reduced obscurity. Can anyone suggest where we can get it to do some testing?



Robin
# 12  
Old 05-09-2014
There is another thread about this:
convert shell script into a binary executable
shcomp does not really obfuscate the contents...

Last edited by Scrutinizer; 05-09-2014 at 11:34 AM..
# 13  
Old 05-09-2014
Hi.
Quote:
Originally Posted by rbatte1
I'm not sure that shcomp is in ksh93. I think it is a separate executable and not always supplied by default. I have AIX 6.1.8 which doesn't have it and RHEL 6.5 which doesn't even list it if I yum whatprovides */shcomp I did, however, get zsh offered on a wider search but that seems to be a different shell altogether.

I did find a hit here for source code, but not being a C programmer, I have no idea how to compile it other than:-
Code:
gcc -o shcomp shcomp.c

..... which gave a load of errors that I don't understand at all.

I've used shc but struggled with the limited portability of the object. Perhaps shcomp is an alternative with more portability, even if there is reduced obscurity. Can anyone suggest where we can get it to do some testing?

Robin
Thanks for the correction; it is part of the ksh93 distribution, but not a builtin.

There is a tar file of ksh93 at https://packages.debian.org/stable/shells/ksh , however I didn't try to comple it, I just looked it over. There is a tar file of Debian patches, some of which seem to relate to shcomp, but I just skimmed it, noting that file rules is a makefile that seems to make ksh93, including shcomp for the Debian environment.

As Scrutinizer noted in the other thread, there is not much obfuscation, but the topic of encryption of shell scripts has been talked about extensively, with the consensus that encryption is not viable because one needs the key to decrypt the encrypted source. Perhaps with shcomp some obfuscation is enough.

I did find a shell-to-perl converter, which can obscure the source for the non-perl-savvy, but that seems to be getting far afield.

There is a reference to ccsh at Compile ksh scripts into binaries - Toolbox for IT Groups to C++ Compilers From Comeau Computing Targeting ANSI/ISO C++ Standard / C and C++ Compiler for Multi-platform Needs , but I could not tell if they were still in business.

Best wishes ... cheers, drl
This User Gave Thanks to drl For This Post:
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Solaris

Solaris 11 open exe file

I have a question about how can I open some exe file in Solaris OS? I have tried to install wine, but I found only old wine version to solaris 5.11. I think the file is too old. I use Solaris 11. I used that commands # bunzip2 Wine-1.1.2-solaris-5.11-i86pc.pkg.bz2 # pkgadd -d... (4 Replies)
Discussion started by: Tsuisou
4 Replies

2. UNIX and Linux Applications

Convert .sh file into .exe file

Currently im using putty to execute .sh file. This file is currently saved onto a server. The .sh file tries to get files from other server and load the files into the current server. Now i want this .sh file to run as an .exe file on my desktop. So that by just double clicking the file and... (3 Replies)
Discussion started by: Dhanashree
3 Replies

3. UNIX for Dummies Questions & Answers

how to convert .sh to .exe file

Hi, I have prepared 1 .sh script that is running fine in UNIX box. Now I wanted to run that script from windows box. I am thinking of converting it to .exe so that can run this in windows server and use it. Overview: Script basically checks for some values in logs of process running in unix box... (1 Reply)
Discussion started by: ankush_mehra
1 Replies

4. Homework & Coursework Questions

Invoke an exe file!!

Hello, Thank you for reading my Thread. I am very very new to Perl / Shell Scripting here. I m assigned some tasks here. I have an exe file on our server. I have to navigate to the path and invoke the exe file. Can someone please guide me with that. Thanks you, Skaranth (1 Reply)
Discussion started by: skaranth
1 Replies

5. Shell Programming and Scripting

extract .exe file

guys! any clue how to extract .exe file in linux? Regards, Kiran (3 Replies)
Discussion started by: dddkiran
3 Replies

6. HP-UX

How to run .exe file

Hello, I have an test.exe file under a directory. When i execute the .exe file directory from the prompt, i get following error: $ test.exe <enter> ksh: test.exe: not found How do i solve this error? TIA, Ramesh (1 Reply)
Discussion started by: brap45
1 Replies

7. Programming

how To edit exe to insert a serial no wich can be usd by runing exe

At time of installation I have to open the resource. and i have to insert a string serial number in the exe. please provide me code to edit the exe (in solaris) to insert a serial number which can be used by exe at run time. (6 Replies)
Discussion started by: ssahu
6 Replies

8. UNIX for Advanced & Expert Users

.exe file

Hello all, how to run windows .exe file in Linux and vice the versa (3 Replies)
Discussion started by: rajashekaran
3 Replies

9. Programming

link with others .exe file

hi all, i need your help, want syntax can i write in my programming file so i can combine one executable file with another executable file when i select my executeable file (based on unix operating system)? :( (1 Reply)
Discussion started by: lala
1 Replies

10. Programming

about exe file

Hi, I am using dual operating system(windows/linux) in my system.Now the problem is i want to run my .exe(of c languege) before system ask for loading of operating system.Like my system ask for linux or dos.I want to run my .exe before this. Tell me how can i use this. (2 Replies)
Discussion started by: at_renai2001
2 Replies
Login or Register to Ask a Question