This repository has been archived by the owner on Jul 9, 2023. It is now read-only.
forked from salva/ring3k
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathring3k.in
executable file
·105 lines (92 loc) · 2.11 KB
/
ring3k.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
#!/bin/sh
#
# ring3k - a user mode kernel for windows executables
#
# Copyright 2007-2009 (C) Mike McCormack
#
# ring3k Launch script
#
# Checks that the c: drive directory is present
# then launches the kernel binary
#Uncomment winlogon_replacement variable to start program
#Or comment all to start original winlogon
#winlogon_replacement="programs/minitris/minitris.exe"
#winlogon_replacement="programs/winemine/winemine.exe"
#winlogon_replacement="programs/clock/clock.exe"
#winlogon_replacement="programs/minshell/minshell.exe"
#winlogon_replacement="programs/pixels/pixels.exe"
#winlogon_replacement="programs/winlogon/winlogon.exe"
# from Wine's launch script
appdir=""
case "$0" in
*/*)
# $0 contains a path, use it
appdir=`dirname "$0"`
;;
*)
# no directory in $0, search in PATH
saved_ifs=$IFS
IFS=:
for d in $PATH
do
IFS=$saved_ifs
if [ -x "$d/$0" ]
then
appdir="$d"
break
fi
done
;;
esac
# find the kernel
kernel="$appdir/ring3k-bin"
if test \! -x "$kernel"
then
kernel="$appdir/kernel/ring3k-bin"
if test \! -x "$appdir"
then
echo "ring3k-bin not found in $appdir"
exit 1
fi
fi
# check for a c: link
if test \! -d "drive"
then
extract="$appdir/ring3k-setup"
if test -r "$extract"
then
. "$extract"
else
echo "c: not present and ring3k-setup script not found"
exit 2
fi
fi
winlogon_path="drive/winnt/system32/winlogon.exe"
if test -f "$winlogon_replacement"
then
echo "Replacing winlogon.exe with $winlogon_replacement"
if test \! -f "$winlogon_path.bak"
then
cp -f "$winlogon_path" "$winlogon_path.bak"
fi
cp -f "$winlogon_replacement" "$winlogon_path"
else
if test -f "$winlogon_path.bak"
then
echo "Replacing custom winlogon.exe with original one"
cp -f "$winlogon_path.bak" "$winlogon_path"
fi
fi
for var in "$@"
do
if [ $var = "-r" ]; then
if [ $2 = "redis" ]; then
echo "executing redis clean up script"
killall -9 redis-server
SCRIPTPATH=`pwd -P`
cp -n ./redis/original.rdb ./redis/redis.rdb
redis-server --dir "$SCRIPTPATH/redis" 1>/dev/null &
fi
fi
done
exec "$kernel" $*