Merge branch 'master' of https://github.com/nullworks/cathook
This commit is contained in:
commit
eac15d6a44
@ -19,14 +19,14 @@ fi
|
|||||||
# Update cathook
|
# Update cathook
|
||||||
#
|
#
|
||||||
|
|
||||||
git fetch --depth 1 origin && git reset --hard latest # pull changes from github
|
git fetch --force --depth 1 origin refs/tags/latest:refs/tags/latest && git reset --hard latest # pull changes from github
|
||||||
git submodule update --depth 1 --init --recursive # update/init submodules
|
git submodule update --depth 1 --init --recursive # update/init submodules
|
||||||
|
|
||||||
#
|
#
|
||||||
# Build cathook
|
# Build cathook
|
||||||
#
|
#
|
||||||
|
|
||||||
mkdir build;cd build #create a directory for building cathook
|
mkdir -p ./build; pushd build #create a directory for building cathook
|
||||||
cmake ..;make -j$(grep -c '^processor' /proc/cpuinfo) # create makefile and build using all available threads
|
cmake ..;make -j$(grep -c '^processor' /proc/cpuinfo) # create makefile and build using all available threads
|
||||||
sudo make data # create /opt/cathook/data
|
sudo make data # create /opt/cathook/data
|
||||||
cd ..; cd ..
|
popd; cd ..
|
||||||
|
@ -80,6 +80,7 @@ template <typename T> T *BruteforceInterface(std::string name, sharedobj::Shared
|
|||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
extern "C" typedef HSteamPipe (*GetHSteamPipe_t)();
|
||||||
extern "C" typedef HSteamUser (*GetHSteamUser_t)();
|
extern "C" typedef HSteamUser (*GetHSteamUser_t)();
|
||||||
|
|
||||||
void CreateInterfaces()
|
void CreateInterfaces()
|
||||||
@ -94,24 +95,24 @@ void CreateInterfaces()
|
|||||||
g_IBaseClient = BruteforceInterface<IBaseClientDLL>("VClient", sharedobj::client());
|
g_IBaseClient = BruteforceInterface<IBaseClientDLL>("VClient", sharedobj::client());
|
||||||
g_ITrace = BruteforceInterface<IEngineTrace>("EngineTraceClient", sharedobj::engine());
|
g_ITrace = BruteforceInterface<IEngineTrace>("EngineTraceClient", sharedobj::engine());
|
||||||
g_IInputSystem = BruteforceInterface<IInputSystem>("InputSystemVersion", sharedobj::inputsystem());
|
g_IInputSystem = BruteforceInterface<IInputSystem>("InputSystemVersion", sharedobj::inputsystem());
|
||||||
uintptr_t steampipe_sig = gSignatures.GetSteamAPISignature("8D 83 ? ? ? ? 89 34 24 89 44 24 ? E8 ? ? ? ? 89 C6") + 0xE7;
|
|
||||||
typedef HSteamPipe (*GetSteamPipe)();
|
logging::Info("Initing SteamAPI");
|
||||||
GetSteamPipe GetSteamPipe_fn = GetSteamPipe(steampipe_sig);
|
GetHSteamPipe_t GetHSteamPipe = reinterpret_cast<GetHSteamPipe_t>(dlsym(sharedobj::steamapi().lmap, "SteamAPI_GetHSteamPipe"));
|
||||||
HSteamPipe sp = GetSteamPipe_fn();
|
HSteamPipe sp = GetHSteamPipe();
|
||||||
if (!sp)
|
if (!sp)
|
||||||
{
|
{
|
||||||
logging::Info("Creating new Steam Pipe...");
|
logging::Info("Connecting to Steam User");
|
||||||
sp = g_ISteamClient->CreateSteamPipe();
|
sp = g_ISteamClient->CreateSteamPipe();
|
||||||
}
|
}
|
||||||
logging::Info("Inited Steam Pipe");
|
GetHSteamUser_t GetHSteamUser = reinterpret_cast<GetHSteamUser_t>(dlsym(sharedobj::steamapi().lmap, "SteamAPI_GetHSteamUser"));
|
||||||
GetHSteamUser_t func = reinterpret_cast<GetHSteamUser_t>(dlsym(sharedobj::steamapi().lmap, "SteamAPI_GetHSteamUser"));
|
HSteamUser su = GetHSteamUser();
|
||||||
HSteamUser su = func();
|
|
||||||
if (!su)
|
if (!su)
|
||||||
{
|
{
|
||||||
logging::Info("Connecting to Steam User");
|
logging::Info("Connecting to Steam User");
|
||||||
su = g_ISteamClient->ConnectToGlobalUser(sp);
|
su = g_ISteamClient->ConnectToGlobalUser(sp);
|
||||||
}
|
}
|
||||||
logging::Info("Inited Steam User");
|
logging::Info("Inited SteamAPI");
|
||||||
|
|
||||||
g_IVModelRender = BruteforceInterface<IVModelRender>("VEngineModel", sharedobj::engine(), 16);
|
g_IVModelRender = BruteforceInterface<IVModelRender>("VEngineModel", sharedobj::engine(), 16);
|
||||||
g_ISteamFriends = nullptr;
|
g_ISteamFriends = nullptr;
|
||||||
g_IEngineVGui = BruteforceInterface<IEngineVGui>("VEngineVGui", sharedobj::engine());
|
g_IEngineVGui = BruteforceInterface<IEngineVGui>("VEngineVGui", sharedobj::engine());
|
||||||
|
9
update
9
update
@ -3,14 +3,17 @@ if [ $EUID == 0 ]; then
|
|||||||
echo -e "\033[1;31m\nThis script must not be run as root\n\033[0m"
|
echo -e "\033[1;31m\nThis script must not be run as root\n\033[0m"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
#Get updated source code
|
|
||||||
|
# Get updated source code
|
||||||
if [ "$(git rev-parse --is-shallow-repository)" == "true" ]; then
|
if [ "$(git rev-parse --is-shallow-repository)" == "true" ]; then
|
||||||
git fetch --force --depth 1 origin refs/tags/latest:refs/tags/latest && git reset --hard latest && git submodule update --depth 1 --init --recursive || { echo -e "\033[1;33m\nFailed to pull from github! Trying alternative pull (legacy)\n\033[0m"; git fetch --depth 1 && git reset --hard @{upstream} && git submodule update --depth 1 --init --recursive || { echo -e "\033[1;31m\nFailed to pull from github! A reinstall is recommended. https://github.com/nullworks/cathook\n\033[0m"; exit 1; } }
|
git fetch --force --depth 1 origin refs/tags/latest:refs/tags/latest && git reset --hard latest && git submodule update --depth 1 --init --recursive || { echo -e "\033[1;33m\nFailed to pull from github! Trying alternative pull (legacy)\n\033[0m"; git fetch --depth 1 && git reset --hard @{upstream} && git submodule update --depth 1 --init --recursive || { echo -e "\033[1;31m\nFailed to pull from github! A reinstall is recommended. https://github.com/nullworks/cathook\n\033[0m"; exit 1; } }
|
||||||
else
|
else
|
||||||
echo -e "\033[1;33m\nWarning! Running in developer mode! Expect issues!\n\033[0m" && git pull origin && git submodule update --init --recursive || { echo -e "\033[1;31m\n\nFailed to pull from github!\n\033[0m"; exit 1; }
|
echo -e "\033[1;33m\nWarning! Running in developer mode! Expect issues!\n\033[0m" && git pull origin && git submodule update --init --recursive || { echo -e "\033[1;31m\n\nFailed to pull from github!\n\033[0m"; exit 1; }
|
||||||
fi
|
fi
|
||||||
#Update cathook
|
#Create build folder in case it doesn't exist
|
||||||
|
mkdir -p ./build
|
||||||
|
# Update cathook
|
||||||
cd build && cmake .. && cmake --build . --target cathook -- -j$(grep -c '^processor' /proc/cpuinfo) || { echo -e "\033[1;31m \n \nFailed to compile cathook\n\033[0m"; exit 1; }
|
cd build && cmake .. && cmake --build . --target cathook -- -j$(grep -c '^processor' /proc/cpuinfo) || { echo -e "\033[1;31m \n \nFailed to compile cathook\n\033[0m"; exit 1; }
|
||||||
#Update data
|
# Update data
|
||||||
sudo cmake --build . --target data || { echo -e "\033[1;31m\nFailed to update /opt/cathook/data directory\n\033[0m"; exit 1; }
|
sudo cmake --build . --target data || { echo -e "\033[1;31m\nFailed to update /opt/cathook/data directory\n\033[0m"; exit 1; }
|
||||||
echo -e "\n\033[1;34mCathook updated successfully\n\033[0m"
|
echo -e "\n\033[1;34mCathook updated successfully\n\033[0m"
|
||||||
|
Reference in New Issue
Block a user