Update attach.sh, add linux equivilents of make and create_projects, update gitignore and update premake with c++20 for linux builds (#20)
This commit is contained in:
parent
1aa3cfe750
commit
5357480f24
5
.gitignore
vendored
5
.gitignore
vendored
@ -610,4 +610,7 @@ __pycache__/
|
||||
bin/
|
||||
*.vcxproj
|
||||
*.sln
|
||||
premake/
|
||||
premake/
|
||||
gdb.txt
|
||||
core
|
||||
|
||||
|
13
attach.sh
13
attach.sh
@ -18,11 +18,15 @@ if [ -z "$pid" ]; then
|
||||
fi
|
||||
|
||||
# Get the full path of the .so that we'll be faking
|
||||
victim_lib=$(cat /proc/${pid}/maps | grep /usr/lib32/ | shuf -n 1)
|
||||
victim_lib=$(cat /proc/${pid}/maps | grep ".so" | shuf -n 1)
|
||||
|
||||
echo $victim_lib
|
||||
|
||||
victim_lib=${victim_lib##* }
|
||||
|
||||
# Some magic that I copied straight from StackOverflow
|
||||
victim_lib_array=(${victim_lib//./ })
|
||||
|
||||
number_to_spoof=${victim_lib_array[-1]}
|
||||
library_path=$(IFS=. ; echo "${victim_lib_array[*]}")
|
||||
|
||||
@ -66,8 +70,7 @@ sudo killall -19 steam
|
||||
sudo killall -19 steamwebhelper
|
||||
|
||||
# Uses dlmopen instead of normal dlopen - Credit to LWSS
|
||||
input="$(
|
||||
sudo gdb -n -q -batch \
|
||||
sudo gdb -n \
|
||||
-ex "set logging on" \
|
||||
-ex "set logging file /dev/null" \
|
||||
-ex "attach $pid" \
|
||||
@ -82,9 +85,7 @@ sudo gdb -n -q -batch \
|
||||
-ex "call \$dlmopen(0, \"$library_path\", 1)" \
|
||||
-ex "set \$error = call dlerror()" \
|
||||
-ex "x/s \$error" \
|
||||
-ex "detach" \
|
||||
-ex "quit"
|
||||
)"
|
||||
-ex "catch syscall exit exit_group"
|
||||
|
||||
# Resume Steam
|
||||
sleep 1
|
||||
|
6
create_projects.sh
Executable file
6
create_projects.sh
Executable file
@ -0,0 +1,6 @@
|
||||
echo creating projects...
|
||||
|
||||
./premake5 "gmake"
|
||||
./premake5 "export-compile-commands"
|
||||
|
||||
echo finished.
|
11
make.sh
Executable file
11
make.sh
Executable file
@ -0,0 +1,11 @@
|
||||
# set cwd to script directory
|
||||
cd "${0%/*}"
|
||||
|
||||
./create_projects.sh
|
||||
|
||||
echo building...
|
||||
cd premake/
|
||||
make -j4
|
||||
|
||||
echo done.
|
||||
exit
|
11
premake5.lua
11
premake5.lua
@ -15,17 +15,20 @@ workspace "doghook"
|
||||
filter "platforms:x32"
|
||||
architecture "x32"
|
||||
|
||||
filter "configurations:Debug"
|
||||
filter "system:windows"
|
||||
cppdialect "C++17"
|
||||
|
||||
filter "system:linux"
|
||||
buildoptions "-std=c++2a"
|
||||
filter {}
|
||||
|
||||
|
||||
filter "configurations:Debug"
|
||||
defines { "DEBUG", "_DEBUG" }
|
||||
optimize "Off"
|
||||
symbols "Full"
|
||||
runtime "Debug"
|
||||
|
||||
filter "configurations:Release"
|
||||
cppdialect "C++17"
|
||||
|
||||
defines { "NDEBUG" }
|
||||
optimize "Full"
|
||||
symbols "Off"
|
||||
|
@ -149,7 +149,9 @@ static auto player_anim_layer_vector(Player *p) -> UtlVector<AnimationLayer> & {
|
||||
UtlVector<AnimationLayer> *anim_overlays = reinterpret_cast<UtlVector<AnimationLayer> *>(p + 2216);
|
||||
return *anim_overlays;
|
||||
} else if constexpr (doghook_platform::linux()) {
|
||||
assert(0);
|
||||
} else if constexpr (doghook_platform::osx()) {
|
||||
assert(0);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user