mirror of
https://github.com/YimMenu/YimMenuV2.git
synced 2026-10-10 11:53:14 +08:00
Merge
This commit is contained in:
@@ -19,6 +19,7 @@ namespace YimMenu
|
||||
BaseHook::Add<Hooks::Anticheat::QueueDependency>(new DetourHook("QueueDependency", Pointers.QueueDependency, Hooks::Anticheat::QueueDependency));
|
||||
BaseHook::Add<Hooks::Anticheat::PrepareMetricForSending>(new DetourHook("PrepareMetricForSending", Pointers.PrepareMetricForSending, Hooks::Anticheat::PrepareMetricForSending));
|
||||
BaseHook::Add<Hooks::Anticheat::GetThreadContext>(new DetourHook("GetThreadContext", reinterpret_cast<void*>(GetProcAddress(LoadLibraryA("kernel32.dll"), "GetThreadContext")), Hooks::Anticheat::GetThreadContext));
|
||||
BaseHook::Add<Hooks::Anticheat::HttpStartRequest>(new DetourHook("HttpStartRequest", Pointers.HttpStartRequest, Hooks::Anticheat::HttpStartRequest));
|
||||
|
||||
BaseHook::Add<Hooks::Script::RunScriptThreads>(new DetourHook("RunScriptThreads", Pointers.RunScriptThreads, Hooks::Script::RunScriptThreads));
|
||||
BaseHook::Add<Hooks::Script::InitNativeTables>(new DetourHook("InitNativeTables", Pointers.InitNativeTables, Hooks::Script::InitNativeTables));
|
||||
|
||||
@@ -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<uintptr_t>(request);
|
||||
const char** host_ptr = reinterpret_cast<const char**>(req_ptr + 0x18F8);
|
||||
const char* path = *reinterpret_cast<const char**>(req_ptr + 0x1900);
|
||||
|
||||
if (path && strstr(path, "Bonus"))
|
||||
{
|
||||
*const_cast<const char**>(host_ptr) = "0.0.0.0";
|
||||
LOG(WARNING) << "Blocked Bonus Report";
|
||||
return BaseHook::Get<Anticheat::HttpStartRequest, DetourHook<decltype(&Anticheat::HttpStartRequest)>>()->Original()(request);
|
||||
}
|
||||
|
||||
|
||||
return BaseHook::Get<Anticheat::HttpStartRequest, DetourHook<decltype(&Anticheat::HttpStartRequest)>>()->Original()(request);
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
|
||||
@@ -276,6 +276,11 @@ namespace YimMenu
|
||||
ObjectPool = ptr.Add(5).Add(3).Rip().As<PoolEncryption*>();
|
||||
});
|
||||
|
||||
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<PVOID>();
|
||||
});
|
||||
|
||||
if (!scanner.Scan())
|
||||
{
|
||||
LOG(FATAL) << "Some patterns could not be found, unloading.";
|
||||
|
||||
@@ -113,6 +113,7 @@ namespace YimMenu
|
||||
PoolEncryption* PedPool;
|
||||
PoolEncryption* ObjectPool;
|
||||
rage::fwVehiclePool*** VehiclePool;
|
||||
PVOID HttpStartRequest;
|
||||
};
|
||||
|
||||
struct Pointers : PointerData
|
||||
|
||||
Reference in New Issue
Block a user