Skip to content

Commit f48c9dc

Browse files
1.01a
1 parent 75b91d0 commit f48c9dc

File tree

4 files changed

+38
-10
lines changed

4 files changed

+38
-10
lines changed

runner-extension/FakeChange/RunnerPreload.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@ void init() {
4646
if(!file) {
4747
perror("fopen()");
4848
fprintf(stderr, "Data file not found.");
49-
return;
49+
exit(1);
50+
//return;
5051
}
5152
// Get pointer to game save folder name
5253
fseek(file, 0x14, SEEK_SET);

runner-extension/README.txt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,14 @@ You only need to run the patcher once per update.
1010
Most likely, your save files will be within the DELTARUNE folder instead of the normal save location. If you're having trouble with saves not saving or going to the wrong place, this is why.
1111

1212

13-
IMPORTANT: For use in libTAS, you must remove the CAP_CHECKPOINT_RESTORE flag from the libTAS binary as having it enables secure mode for the process which stops me from loading my native library.
13+
IMPORTANT: For use in libTAS, you must remove the CAP_CHECKPOINT_RESTORE flag from the libTAS binary as having it enables secure mode for the process which stops me from loading my native library. The provided script should do it for you.
1414

1515
Version History:
16-
- 1.1:
16+
- 1.01a:
17+
- libtas.sh now removes CAP_CHECKPOINT_RESTORE for you.
18+
- gcc should no longer be required to run the patcher.
19+
- Better error logging.
20+
- 1.01:
1721
- Fixed libtas.sh.
1822
- Preserve command-line arguments when starting chapters.
1923
- Added basic support for in-place patching for future updates.

runner-extension/fakechange_patcher.sh

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,22 @@ if Patcher/FakeChangePatcher DELTARUNE; then
1010
if ! [ -d lib ]; then
1111
mkdir lib
1212
fi
13-
14-
gcc -c -fpic ../FakeChange/RunnerPreload.c
15-
gcc -shared -o lib/libfcpreload.so RunnerPreload.o
16-
rm RunnerPreload.o
1713

18-
gcc -c -fpic ../FakeChange/FakeChange.c
19-
gcc -shared -o lib/libfakechange.so FakeChange.o
20-
rm FakeChange.o
14+
if command -v gcc; then
15+
echo "Found gcc, compiling libraries..."
16+
gcc -c -fpic ../FakeChange/RunnerPreload.c
17+
gcc -shared -o lib/libfcpreload.so RunnerPreload.o
18+
rm RunnerPreload.o
19+
20+
gcc -c -fpic ../FakeChange/FakeChange.c
21+
gcc -shared -o lib/libfakechange.so FakeChange.o
22+
rm FakeChange.o
23+
else
24+
echo "Copying libraries..."
25+
cp ../FakeChange/*.so lib
26+
fi
2127
cd ..
28+
echo "Done"
2229

2330
else
2431
echo "Failed to run patcher"

runner-extension/libtas.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,20 @@
11
#!/bin/bash
2+
3+
if ! [ -e DELTARUNE/chapter0/game.unx ]; then
4+
echo "WARNING: unable to locate launcher data file"
5+
fi
6+
7+
libtas_path=$(which libTAS)
8+
9+
if setcap -v cap_checkpoint_restore+eip $libtas_path > /dev/null; then
10+
echo "libTAS has the CAP_CHECKPOINT_RESTORE flag which needs to be disabled for FakeChange to work."
11+
echo "If a password prompt appears below, please enter your user password to remove the flag."
12+
if ! sudo setcap cap_checkpoint_restore-eip $libtas_path; then
13+
echo "Failed to remove flag."
14+
exit
15+
fi
16+
fi
17+
218
cd DELTARUNE
319
LD_PRELOAD=./lib/libfcpreload.so LD_LIBRARY_PATH=./lib:$LD_LIBRARY_PATH libTAS
420
cd ..

0 commit comments

Comments
 (0)