- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: How to convert bash scripts into binary's, so ...
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-15-2008 12:13 AM
01-15-2008 12:13 AM
Re: How to convert bash scripts into binary's, so no one can read it
I tried to do using ansi c too ,
# echo $CC
/opt/ansic/bin/cc
# ldd /opt/ansic/bin/cc
libstd.so.1 => /usr/lib/hpux32/libstd.so.1
libstream.so.1 => /usr/lib/hpux32/libstream.so.1
libCsup.so.1 => /usr/lib/hpux32/libCsup.so.1
libm.so.1 => /usr/lib/hpux32/libm.so.1
libunwind.so.1 => /usr/lib/hpux32/libunwind.so.1
libc.so.1 => /usr/lib/hpux32/libc.so.1
libdl.so.1 => /usr/lib/hpux32/libdl.so.1
libuca.so.1 => /usr/lib/hpux32/libuca.so.1
libdl.so.1 => /usr/lib/hpux32/libdl.so.1
# make cleanall
rm -f *.o *~ *.x.c
rm -f shc *.x
Edited Makefile :-
Comment out all the CFLAGS line except the below
# For HPUX
CFLAGS = -Ae -O +wlint
#make test
"shc.c", line 715, procedure do_all: warning #20202-D: Allocated memory may
potentially be leaked (at line 962)
*** Compiling script "match"
CFLAGS="-Ae -O +wlint" ./shc -v -f match
shc shll=sh
shc [-i]=-c
shc [-x]=exec '%s' "$@"
shc [-l]=
shc opts=
shc: /opt/ansic/bin/cc -Ae -O +wlint match.x.c -o match.x
"match.x.c", line 284: error #2165: too few arguments in function call
mine = !ptrace(PTRACE_ATTACH, pid, 0, 0);
^
1 error detected in the compilation of "match.x.c".
./shc: Error 0
*** Error exit code 1
Stop.
Thanks,
Abi
- Tags:
- ptrace
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-15-2008 02:54 AM
01-15-2008 02:54 AM
Re: How to convert bash scripts into binary's, so no one can read it
"match.x.c", line 284: error #2165: too few arguments in function call
mine = !ptrace(PTRACE_ATTACH, pid, 0, 0);
Now that you are using a real compiler, it is obvious. You are hosed. You can't use ptrace on IPF since ptrace isn't supported. You must port to ttrace(2) instead.
http://docs.hp.com/en/B2355-60130/ttrace.2.html
>ME: If this is ptrace(2), this isn't supported on IPF. See the man page.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-27-2017 09:31 AM
06-27-2017 09:31 AM
Re: How to convert bash scripts into binary's, so no one can read it
Hi Everyone!
I find a fix for shc ..
# export CC=/usr/local/bin/gcc
# ldd /usr/local/bin/gcc
make test
make strings
make install
*** Installing shc and shc.1 on /usr/local
-n *** ¿Do you want to continue?
y
install -c -s shc /usr/local/bin/
install: The -c, -f, -n options each require a directory following!
*** Error exit code 2
And this error is removed when executing these 2 commands manually (I need to put the DIR after the -c:)
# /usr/sbin/install -c /usr/local/bin/ -s shc /usr/local/bin/
# /usr/sbin/install -c /usr/local/bin/ -m 644 shc.1 /usr/local/man/man1/
and the executable is installed by you!! :
/usr/local/bin/shc
# file /usr/local/bin/shc
/usr/local/bin/shc: ELF-32 executable object file - IA64
example of usage:
shc -r -T -f myscript.sh
And generates the executable:
myscript.sh.x
Kind Regards. !
- « Previous
- Next »