Comments (17)
it suppose to work as it works on Ubuntu 16.04
--- sample.sh --
#!/bin/bash
echo " sample.sh output"
-- end sample.sh --
shc -f sample.sh
./sample.sh.x suppose to display "sample.sh output", but it does not, even terminal does not exists, have to press ctrl+c to terminate
Thanks,
from shc.
The version is now 4.0.0 and way different than the original 3.8.9b.
The latest stable release is 3.9.8
I'm still having the same issue on ubuntu 18.04.
I don't know if anyone already noticed it, but if you download the 4.0.0 from the link of this reply, and read the content of README.md file, they are including a way to download shc version 4.0.0 from a PPA
sudo add-apt-repository ppa:neurobin/ppa
sudo apt update
sudo apt install -y shc
dpkg -s shc
returns Version: 4.0.1-1
I reran and tested SHC on ubuntu 18.04, and the executable file finally worked as expected.
from shc.
I can confirm this same behavior.
When I try to compile sysinfo.sh (see below), I only get a stalled output when running sysinfo.sh.x
#!/bin/bash
# sysinfo.sh
# Print identifying information and info for running services
#############
# Variables #
#############
USER=$(whoami)
HOST=$(hostname)
INTERNAL_IP=$(ip addr | grep eno1 | tail -1 | awk '{print $2}' | awk -F / '{print $1}')
EXTERNAL_IP=$(curl -s ipv4.icanhazip.com)
# Print current user and hostname
echo ${USER}@${HOST}
# Print internal and external IP addresses
echo Internal IP: ${INTERNAL_IP}
echo External IP: ${EXTERNAL_IP}
$ shc -f sysinfo.sh
$ ls -l
-rwxrwxr-x 1 user user 462 Sep 13 12:50 sysinfo.sh
-rwx-wx--x 1 user user 11400 Nov 13 18:41 sysinfo.sh.x
-rw-rw-r-- 1 user user 11943 Nov 13 18:41 sysinfo.sh.x.c
$ ./sysinfo.sh.x
(Hangs...)
System Information
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 18.04.1 LTS
Release: 18.04
Codename: bionic
shc Information
$ shc -h
shc Version 3.8.9b, Generic Script Compiler
shc Copyright (c) 1994-2015 Francisco Rosales <[email protected]>
shc Usage: shc [-e date] [-m addr] [-i iopt] [-x cmnd] [-l lopt] [-rvDTCAh] -f script
...
from shc.
What do you mean by "it does not work as it is supposed to work"?
from shc.
can you check with the last version and with the H flag
from shc.
The version is now 4.0.0 and way different than the original 3.8.9b.
The latest stable release is 3.9.8
from shc.
Same Problem occured when i am executing sysinfo.sh.x in ubuntu 18.04 but same file is executing in ubuntu 16.04
from shc.
Yes I can confirm the same. What I did notice is that the GNU Library is 2 different versions which generally is expected between 2 major release version of any OS distro. On 2 most current patch set of Ubuntu:
16.04 (most recent patch set): libc-dev-bin / 2.23-0ubuntu11
18.04 (most recent patch set): libc-dev-bin / 2.27-3ubuntu1
Thanks
from shc.
Yes I can confirm the same. What I did notice is that the GNU Library is 2 different versions which generally is expected between 2 major release version of any OS distro. On 2 most current patch set of Ubuntu:
16.04 (most recent patch set): libc-dev-bin / 2.23-0ubuntu11
18.04 (most recent patch set): libc-dev-bin / 2.27-3ubuntu1Thanks
Hi,
So did you managed to make it work? I am in same situation on Ubuntu 18.x.
from shc.
Yes I can confirm the same. What I did notice is that the GNU Library is 2 different versions which generally is expected between 2 major release version of any OS distro. On 2 most current patch set of Ubuntu:
16.04 (most recent patch set): libc-dev-bin / 2.23-0ubuntu11
18.04 (most recent patch set): libc-dev-bin / 2.27-3ubuntu1
ThanksHi,
So did you managed to make it work? I am in same situation on Ubuntu 18.x.
Sorry, no I was not able to make this work. The fix from my point of view would be to make shc work with the new version of the GNU Library.
Thanks
from shc.
can you check with the last version and with the H flag
Not sure if anyone else tried this, but I did and I receive the following executing an shc encoded script:
Operation not permitted
Killed
Thanks
from shc.
Okay... hold the phone here. So with version 4.0.2, I encoded a couple scripts as such:
./shc-4.0.2/src/shc -v -r -f script_name.sh
Then ran the .x with success on the same 18.04 patch set of Ubuntu (libc-dev-bin / 2.27-3ubuntu1).
Did anything other than typos change since 4.0.1?
274e98d
Thanks
from shc.
Nothing worked for me as I am stuck at "make" and hence can't compile the script.
Shall we downgrade to 16.x if shc works fine with previous releases?
from shc.
The version is now 4.0.0 and way different than the original 3.8.9b.
The latest stable release is 3.9.8
Hi, what's the difference between shc released by Francisco Rosales and your version?
With these setup, I can confirm that shc is working fine on my environment (LM 19 Tara based on Ubuntu 18.04 Bionic)
Environment informations
$ lsb_release -a
No LSB modules are available.
Distributor ID: LinuxMint
Description: Linux Mint 19 Tara
Release: 19
Codename: tara
$ uname -a
Linux masedi-X450CC 4.15.0-20-generic #21-Ubuntu SMP Tue Apr 24 06:16:15 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
$ shc -h
shc Version 4.0.3, Generic Shell Script Compiler
shc GNU GPL Version 3 Md Jahidul Hamid [email protected]
from shc.
Can you run your compiled executables that hang with strace to see which syscall they hang on?
from shc.
I succeeded to compile the program under 16.04 as it fails on 18.0x.
from shc.
When compiled with debug flag you can see it's stuck in an endless loop:
argc=2
argv[0]=./my_script.x
argv[1]=1
argv[2]=<null>
getenv(xe9a6c2731f6572fa)=<null>
shll=/bin/sh
argc=5
argv[0]=./my_script.x
argv[1]=-c
argv[2]=exec './my_script.x' "$@"
argv[3]=./my_script.x
argv[4]=1
argv[5]=<null>
shll=main
argc=2
argv[0]=./my_script.x
argv[1]=1
argv[2]=<null>
getenv(xe9e10f35be4f92fa)=<null>
shll=/bin/sh
argc=5
argv[0]=./my_script.x
argv[1]=-c
argv[2]=exec './my_script.x' "$@"
argv[3]=./my_script.x
argv[4]=1
argv[5]=<null>
shll=main
argc=2
argv[0]=./my_script.x
argv[1]=1
argv[2]=<null>
getenv(xe9bcbcbd79aff2fa)=<null>
shll=/bin/sh
argc=5
argv[0]=./my_script.x
argv[1]=-c
argv[2]=exec './my_script.x' "$@"
argv[3]=./my_script.x
argv[4]=1
argv[5]=<null>
shll=main
argc=2
argv[0]=./my_script.x
argv[1]=1
argv[2]=<null>
getenv(xe9bc67704bbe12fa)=<null>
shll=/bin/sh
argc=5
argv[0]=./my_script.x
argv[1]=-c
argv[2]=exec './my_script.x' "$@"
argv[3]=./my_script.x
argv[4]=1
argv[5]=<null>
shll=main
argc=2
argv[0]=./my_script.x
argv[1]=1
argv[2]=<null>
getenv(xe9e1a6323aa732fa)=<null>
shll=/bin/sh
..........
and so on
from shc.
Related Issues (20)
- There is no shc file and ./configure gives error HOT 1
- Compiling jq and its /usr/lib dependencies into single executable
- Release page doesn't contain compiled binary HOT 2
- Use environment commands HOT 1
- SHC binary having problems with jailed user HOT 2
- Is a compiled binary faster than the original script? HOT 1
- confused.
- Compile on arm64 for Intel X86_64 HOT 1
- /bin/csh: Event not found. HOT 2
- the -H argument compatibility
- Argument list too long (maybe caused by a bunch of commented lines) HOT 6
- Unable to run the compiled script on CheckPoint GAIA which is Red Had based
- executable does not run again following reboot HOT 3
- Pipes instead of command line and random locks HOT 5
- All Shellcommands are visible in the processlist HOT 4
- LeakSanitizer: detected memory leaks HOT 1
- Checksum of compiled output changes even if input is exactly the same
- Compiled shc not working on M2 Pro CPU HOT 2
- After using the shc 4.0.3 encrypted shell script in Centos7, running the encrypted script and using ps ax can reveal the source code HOT 2
- pollution of ps / top HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from shc.