Я написал простой интернальный бхоп, но он прыгает вообще не в тайминги, как это исправить? Заранее спасибо
C++:
#include <Windows.h>
#include <cstdint>
#include <thread>
#include <chrono>
#include <iostream>
namespace Offsets
{
constexpr std::ptrdiff_t jump = 0x1884C40;
}
void BunnyHop(HMODULE instance) {
uintptr_t client = reinterpret_cast<uintptr_t>(GetModuleHandleA("client.dll"));
if (!client) {
std::cout << "Ошибка: клиентский модуль не найден." << std::endl;
return;
}
while (true) {
std::this_thread::sleep_for(std::chrono::milliseconds(1));
if (GetAsyncKeyState(VK_SPACE) & 0x8000) {
*reinterpret_cast<uintptr_t*>(client + Offsets::jump) = 65537;
Sleep(0.01);
*reinterpret_cast<uintptr_t*>(client + Offsets::jump) = 256;
}
}
}
int __stdcall DllMain(HMODULE instance, DWORD reason, void* reserved) {
if (reason == DLL_PROCESS_ATTACH) {
DisableThreadLibraryCalls(instance);
auto thread = CreateThread(nullptr, 0, reinterpret_cast<LPTHREAD_START_ROUTINE>(BunnyHop), instance, 0, nullptr);
if (thread)
CloseHandle(thread);
}
return TRUE;
}