diff --git a/src/core/hooking/Hooking.cpp b/src/core/hooking/Hooking.cpp index 88585ee..9667da0 100644 --- a/src/core/hooking/Hooking.cpp +++ b/src/core/hooking/Hooking.cpp @@ -19,6 +19,7 @@ namespace YimMenu BaseHook::Add(new DetourHook("QueueDependency", Pointers.QueueDependency, Hooks::Anticheat::QueueDependency)); BaseHook::Add(new DetourHook("PrepareMetricForSending", Pointers.PrepareMetricForSending, Hooks::Anticheat::PrepareMetricForSending)); BaseHook::Add(new DetourHook("GetThreadContext", reinterpret_cast(GetProcAddress(LoadLibraryA("kernel32.dll"), "GetThreadContext")), Hooks::Anticheat::GetThreadContext)); + BaseHook::Add(new DetourHook("HttpStartRequest", Pointers.HttpStartRequest, Hooks::Anticheat::HttpStartRequest)); BaseHook::Add(new DetourHook("RunScriptThreads", Pointers.RunScriptThreads, Hooks::Script::RunScriptThreads)); BaseHook::Add(new DetourHook("InitNativeTables", Pointers.InitNativeTables, Hooks::Script::InitNativeTables)); diff --git a/src/game/hooks/Anticheat/HttpStartRequest.cpp b/src/game/hooks/Anticheat/HttpStartRequest.cpp new file mode 100644 index 0000000..96b2d01 --- /dev/null +++ b/src/game/hooks/Anticheat/HttpStartRequest.cpp @@ -0,0 +1,24 @@ +#include "common.hpp" +#include "core/hooking/DetourHook.hpp" +#include "game/hooks/Hooks.hpp" + + +namespace YimMenu::Hooks +{ + void Anticheat::HttpStartRequest(void* request) + { + uintptr_t req_ptr = reinterpret_cast(request); + const char** host_ptr = reinterpret_cast(req_ptr + 0x18F8); + const char* path = *reinterpret_cast(req_ptr + 0x1900); + + if (path && strstr(path, "Bonus")) + { + *const_cast(host_ptr) = "0.0.0.0"; + LOG(WARNING) << "Blocked Bonus Report"; + return BaseHook::Get>()->Original()(request); + } + + + return BaseHook::Get>()->Original()(request); + } +} \ No newline at end of file diff --git a/src/game/hooks/Hooks.hpp b/src/game/hooks/Hooks.hpp index 1bf9be0..e88af87 100644 --- a/src/game/hooks/Hooks.hpp +++ b/src/game/hooks/Hooks.hpp @@ -37,6 +37,7 @@ namespace YimMenu::Hooks extern void QueueDependency(__int64 a1); extern bool PrepareMetricForSending(rage::JsonSerializer* ser, void* a2, void* a3, rage::rlMetric* metric); extern BOOL GetThreadContext(HANDLE hThread, LPCONTEXT lpContext); + extern void HttpStartRequest(void* request); } namespace Info diff --git a/src/game/pointers/Pointers.cpp b/src/game/pointers/Pointers.cpp index ec422fb..75702df 100644 --- a/src/game/pointers/Pointers.cpp +++ b/src/game/pointers/Pointers.cpp @@ -276,6 +276,11 @@ namespace YimMenu ObjectPool = ptr.Add(5).Add(3).Rip().As(); }); + constexpr auto HttpStartRequestPtrn = Pattern<"56 57 48 83 EC 28 48 89 CE 8B 81 ? ? ? ? FF C8 83 F8 04 0F 87">("HttpStartRequest"); + scanner.Add(HttpStartRequestPtrn, [this](PointerCalculator ptr) { + HttpStartRequest = ptr.As(); + }); + if (!scanner.Scan()) { LOG(FATAL) << "Some patterns could not be found, unloading."; diff --git a/src/game/pointers/Pointers.hpp b/src/game/pointers/Pointers.hpp index 448fe23..ab2f0e4 100644 --- a/src/game/pointers/Pointers.hpp +++ b/src/game/pointers/Pointers.hpp @@ -113,6 +113,7 @@ namespace YimMenu PoolEncryption* PedPool; PoolEncryption* ObjectPool; rage::fwVehiclePool*** VehiclePool; + PVOID HttpStartRequest; }; struct Pointers : PointerData