@@ -54,7 +54,7 @@ if [ -n "$SHOW_USAGE" -o $# != 2 ]; then
54
54
exit 0
55
55
fi
56
56
57
- DIR =" $( dirname " $0 " ) /src"
57
+ SRC_DIR =" $( dirname " $0 " ) /src"
58
58
[ -z " $CXX " ] && CXX=${CROSS_COMPILE} g++
59
59
[ -z " $LD " ] && LD=${CROSS_COMPILE} ld
60
60
[ -z " $STRIP " ] && STRIP=${CROSS_COMPILE} strip
@@ -127,12 +127,12 @@ if [ "$(head -c2 "$1")" = "#!" ]; then
127
127
fi
128
128
129
129
# cleanup on exit
130
- trap " rm -f \" $1 .cpp\" i.o i s.o s rc4 crc32 d.squashfs " EXIT
130
+ trap " rm -f \" $1 .cpp\" i.o i s.o s rc4 crc32 d.sfs " EXIT
131
131
132
132
echo ' => build rc4 tool...'
133
133
[ -n " $RAND_KEY " ] && RC4_KEY=" $( perl -e ' printf("%x", rand 16) for 1..8' ) " || RC4_KEY=ssc@2024
134
134
CXXFLAGS=" $CXXFLAGS -DRC4_KEY=$RC4_KEY "
135
- g++ -std=$CXX_STANDARD -w " $DIR /rc4.cpp" -o rc4 || exit 1
135
+ g++ -std=$CXX_STANDARD -w " $SRC_DIR /rc4.cpp" -o rc4 || exit 1
136
136
137
137
echo ' => encrypt script...'
138
138
[ -n " $SEGMENT " ] || SEGMENT=1
@@ -149,7 +149,7 @@ if [ -n "$EMBED_FILE" ]; then
149
149
fi
150
150
151
151
echo ' => generate c++ code...'
152
- perl -pe " s|SCRIPT_FILE_NAME|$1 |g; s@SCRIPT_SHEBANG@$SHEBANG @g" " $DIR /main.cpp" > " $1 .cpp" || exit 1
152
+ perl -pe " s|SCRIPT_FILE_NAME|$1 |g; s@SCRIPT_SHEBANG@$SHEBANG @g" " $SRC_DIR /main.cpp" > " $1 .cpp" || exit 1
153
153
154
154
if [ -n " $EXPIRE_MESSAGE " ]; then
155
155
if [ -f " $EXPIRE_MESSAGE " ]; then
@@ -160,22 +160,22 @@ if [ -n "$EXPIRE_MESSAGE" ]; then
160
160
fi
161
161
162
162
echo ' => compile c++ code...'
163
- $CXX -I" $DIR " -std=$CXX_STANDARD $CXXFLAGS " $1 .cpp" $LDFLAGS -o " $2 " || exit 1
163
+ $CXX -I" $SRC_DIR " -std=$CXX_STANDARD $CXXFLAGS " $1 .cpp" $LDFLAGS -o " $2 " || exit 1
164
164
$STRIP " $2 "
165
165
166
166
if [ -n " $SQUASHFS_DATA " ]; then
167
167
echo ' => append squashfs to binary...'
168
168
if [ -d " $SQUASHFS_DATA " ]; then
169
- mksquashfs " $SQUASHFS_DATA " d.squashfs -root-owned -noappend || exit
170
- cat d.squashfs >> " $2 "
169
+ mksquashfs " $SQUASHFS_DATA " d.sfs -root-owned -noappend || exit
170
+ cat d.sfs >> " $2 "
171
171
else
172
172
cat $SQUASHFS_DATA >> " $2 "
173
173
fi
174
174
fi
175
175
176
176
if [ -n " $VERIFY_CHECKSUM " ]; then
177
177
echo ' => build crc32 tool...'
178
- g++ -std=$CXX_STANDARD -w " $DIR /crc32.cpp" -o crc32 || exit 1
178
+ g++ -std=$CXX_STANDARD -w " $SRC_DIR /crc32.cpp" -o crc32 || exit 1
179
179
echo ' => write checksum to binary...'
180
180
OFFSET=" $( LC_ALL=C grep -abo ssccksum " $2 " | grep -o ' ^[0-9]*' ) "
181
181
CKSUM=" $( ./crc32 " $2 " ) "
0 commit comments