neurobin / shc

Shell script compiler

Home Page:https://neurobin.org/projects/softwares/unix/shc/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

compiled bash file doesn't run on another OS

Milad-Abooali opened this issue · comments

I have a bash file and tested it on several OSes (CentOs, Fedora, Debian. Ubuntu, Kali) and it work fine.

I installed shc 4.0.3 (also 3.8 & 3.9) and compiled the bash file.

Case A:
When I compiled the bash file on CentOs it work on CentOs and Fedora fine.
But dose not work on Debian, Ubuntu, Kali and maybe other Debian base distros.

Case B:
I compiled the bash file using shc 4.03 on Debian, work fine on Debian, Ubuntu ...
but now dose not work on CentOS, Fedora and maybe other same distros.

Am I missing some configuration? is it my fault?
Thanks.

what command did you use? Please show us the procedure you followed to create the binary..

file : test.sh

$ shc -f test.sh
$ chmod +x ./test.sh.x
$ ./test.sh.x ;OK on machine that I complied there.

I transfer the file to other machine by SCP, and try to run:

$ chmod +x ./test.sh.x
$ ./test.sh.x ;But not work, out put is some obfuscated string. sometimes ended with "has expired".

Also I try:

$ setarch $(uname -m) -R ./test.sh.x ;Same result and not work.

All OSes are 64bit on virtual machines with same processor.

use the -r flag, shc -rf test.sh

Solved.
Thanks again.