Answer the question
In order to leave comments, you need to log in
About sh, bat and binary files?
I'm not familiar with this kind of programming.
Found a script like this:
#!/bin/bash
function die() {
echo "$1"
exit 1
}
# Taken from Debian Developers Reference Chapter 6
function pathfind() {
OLDIFS="$IFS"
IFS=:
for p in $PATH; do
if [ -x "$p/$*" ]; then
IFS="$OLDIFS"
return 0
fi
done
IFS="$OLDIFS"
return 1
}
pathfind "java" || die "[ERROR] could not find: java in \$PATH"
exec java -jar $0 "[email protected]"
PK.... тут идет 200кб бинарных данных просто скопированных в скрипт, которые не вставляются в поле браузера.
Answer the question
In order to leave comments, you need to log in
Thanks to all. Under Windows, at random, it turned out like this:
@echo off & java -jar %0 %* & exit /b 0 ... и дальше пихаем бинарник
In fact, this script is designed to turn the *.jar Java application into a UNIX executable file.
Those binary data at the end of the PK ... and so on - this is the JAR, that is, the Java classes in the ZIP archive.
The logic of work here is simple; the script searches the list of paths in the PATH variable for the java program, and if it finds it, it launches it, passing the name of the current script as the name and, as parameters, the parameters with which the script was launched. If java is not found, reports this.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question