Comments (3)
I'm not intimately familiar with shc
(or FreeBSD, lol) but I assume it stat
s itself, its directory, or some character device like /dev/null
Missing a system call name is kind of interesting though, I guess it's likely that shc
compiled a call to libc's stat
wrapper for the FBSD system call and that name was resolved differently, at a different offset, in a different shared library, etc etc by the ELF interpreter on the minimal system
(that capital letter in Stat
is kind of interesting, i hope that's an artifact and not a problem)
if you have a C compiler on the target system, can you compile and run a small program like this? (it works on Linux, hopefully on FreeBSD)
#include <sys/stat.h>
#include <unistd.h>
#include <sys/syscall.h>
#include <errno.h>
#include <stdio.h>
int main (int argc, char** argv) {
struct stat s;
if (stat(argv[0], &s)) {
perror("stat #1");
return 1;
}
if (syscall(SYS_stat, argv[0], &s)) {
perror("stat #2");
return 1;
}
}
if it compiles and runs and file ./stat
says dynamically linked
then the problem is a version or address mismatch for the symbol and / or library that loads the stat
symbol between your two systems, and you might have to force static linking when shc
compiles.
(if it attempted to actually compile a call to a symbol named stat@FBSD_15
or something, then it really is a version mismatch)
from shc.
Can you test with the last version with the flag 'H'
Also compile your bash without any additional flag and try again
Also with the same unprotected binary, can you run strace your-binary
and report back
from shc.
Yes, this was a user error on my part. Once I ran with -r this issue disappeared.
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.