Compare commits
3 Commits
e5714b988d
...
7903b04694
| Author | SHA1 | Date | |
|---|---|---|---|
| 7903b04694 | |||
| 33914c53b4 | |||
| def5f5e9ab |
@@ -76,7 +76,7 @@ extern "C" __declspec(dllexport) void SetFixEnabled(bool enabled, bool init)
|
|||||||
logger->info("--------------- AOB scan started ---------------");
|
logger->info("--------------- AOB scan started ---------------");
|
||||||
if (CameraComponentaddress == nullptr) {
|
if (CameraComponentaddress == nullptr) {
|
||||||
constexpr auto FOVStringObfuscated = make_obfuscated<0x4A>("EB ?? F3 0F ?? ?? ?? ?? ?? ?? F3 0F ?? ?? ?? 8B 87");
|
constexpr auto FOVStringObfuscated = make_obfuscated<0x4A>("EB ?? F3 0F ?? ?? ?? ?? ?? ?? F3 0F ?? ?? ?? 8B 87");
|
||||||
CameraComponentaddress = Memory::AOBScan(gameExecutable, FOVStringObfuscated.decrypt(), PAGE_EXECUTE_READ);
|
CameraComponentaddress = Memory::AOBScan("", FOVStringObfuscated.decrypt(), PAGE_EXECUTE_READ, logger);
|
||||||
|
|
||||||
if (!CameraComponentaddress)
|
if (!CameraComponentaddress)
|
||||||
logger->warn("Camera component signature not found. Maybe your game has been updated and is no more compatible with this plugin.");
|
logger->warn("Camera component signature not found. Maybe your game has been updated and is no more compatible with this plugin.");
|
||||||
@@ -89,7 +89,7 @@ extern "C" __declspec(dllexport) void SetFixEnabled(bool enabled, bool init)
|
|||||||
|
|
||||||
if (!AspectRatioAxisConstraintaddress) {
|
if (!AspectRatioAxisConstraintaddress) {
|
||||||
constexpr auto AspectRatioAxisConstraintStringObfuscated = make_obfuscated<0x4A>("41 0F ?? ?? ?? ?? ?? ?? 48 8D ?? ?? ?? ?? ?? 4C ?? ?? 4D ?? ?? E8");
|
constexpr auto AspectRatioAxisConstraintStringObfuscated = make_obfuscated<0x4A>("41 0F ?? ?? ?? ?? ?? ?? 48 8D ?? ?? ?? ?? ?? 4C ?? ?? 4D ?? ?? E8");
|
||||||
AspectRatioAxisConstraintaddress = Memory::AOBScan(gameExecutable, AspectRatioAxisConstraintStringObfuscated.decrypt(), PAGE_EXECUTE_READ);
|
AspectRatioAxisConstraintaddress = Memory::AOBScan("", AspectRatioAxisConstraintStringObfuscated.decrypt(), PAGE_EXECUTE_READ);
|
||||||
|
|
||||||
if (!AspectRatioAxisConstraintaddress)
|
if (!AspectRatioAxisConstraintaddress)
|
||||||
logger->warn("HOR+ signature not found. Maybe your game has been updated and is no more compatible with this plugin.");
|
logger->warn("HOR+ signature not found. Maybe your game has been updated and is no more compatible with this plugin.");
|
||||||
@@ -114,7 +114,7 @@ extern "C" __declspec(dllexport) void SetFixEnabled(bool enabled, bool init)
|
|||||||
|
|
||||||
if (!CAaddress) {
|
if (!CAaddress) {
|
||||||
constexpr auto CAStringObfuscated = make_obfuscated<0x4A>("7F ?? 89 BB ?? ?? ?? ?? 8B ?? ?? 39 05 ?? ?? ?? ?? 7E");
|
constexpr auto CAStringObfuscated = make_obfuscated<0x4A>("7F ?? 89 BB ?? ?? ?? ?? 8B ?? ?? 39 05 ?? ?? ?? ?? 7E");
|
||||||
CAaddress = Memory::AOBScan(gameExecutable, CAStringObfuscated.decrypt(), PAGE_EXECUTE_READ);
|
CAaddress = Memory::AOBScan("", CAStringObfuscated.decrypt(), PAGE_EXECUTE_READ);
|
||||||
|
|
||||||
if (!CAaddress)
|
if (!CAaddress)
|
||||||
logger->warn("Chromatic aberrations signature not found. Maybe your game has been updated and is no more compatible with this plugin.");
|
logger->warn("Chromatic aberrations signature not found. Maybe your game has been updated and is no more compatible with this plugin.");
|
||||||
@@ -124,7 +124,7 @@ extern "C" __declspec(dllexport) void SetFixEnabled(bool enabled, bool init)
|
|||||||
|
|
||||||
if (!Vignettingaddress) {
|
if (!Vignettingaddress) {
|
||||||
constexpr auto CAStringObfuscated = make_obfuscated<0x4A>("8B ?? 83 ?? ?? 7D ?? 89 BB ?? ?? ?? ?? 89 BB");
|
constexpr auto CAStringObfuscated = make_obfuscated<0x4A>("8B ?? 83 ?? ?? 7D ?? 89 BB ?? ?? ?? ?? 89 BB");
|
||||||
Vignettingaddress = Memory::AOBScan(gameExecutable, CAStringObfuscated.decrypt(), PAGE_EXECUTE_READ);
|
Vignettingaddress = Memory::AOBScan("", CAStringObfuscated.decrypt(), PAGE_EXECUTE_READ);
|
||||||
//LittleNightmaresIII.exe + 39E9201 - 89 BB 8C 10 00 00 - mov[rbx + 0000108C], edi
|
//LittleNightmaresIII.exe + 39E9201 - 89 BB 8C 10 00 00 - mov[rbx + 0000108C], edi
|
||||||
//LittleNightmaresIII.exe + 39E9207 - 48 8B 05 2A 6C A4 02 - mov rax, [LittleNightmaresIII.exe + 642FE38]
|
//LittleNightmaresIII.exe + 39E9207 - 48 8B 05 2A 6C A4 02 - mov rax, [LittleNightmaresIII.exe + 642FE38]
|
||||||
//LittleNightmaresIII.exe + 39E920E - 8B 08 - mov ecx, [rax]
|
//LittleNightmaresIII.exe + 39E920E - 8B 08 - mov ecx, [rax]
|
||||||
@@ -139,7 +139,7 @@ extern "C" __declspec(dllexport) void SetFixEnabled(bool enabled, bool init)
|
|||||||
|
|
||||||
if (!Fogaddress) {
|
if (!Fogaddress) {
|
||||||
constexpr auto FogStringObfuscated = make_obfuscated<0x4A>("83 ?? ?? ?? 75 ?? B3 ?? EB ?? 32 ?? 48 8B");
|
constexpr auto FogStringObfuscated = make_obfuscated<0x4A>("83 ?? ?? ?? 75 ?? B3 ?? EB ?? 32 ?? 48 8B");
|
||||||
Fogaddress = Memory::AOBScan(gameExecutable, FogStringObfuscated.decrypt(), PAGE_EXECUTE_READ);
|
Fogaddress = Memory::AOBScan("", FogStringObfuscated.decrypt(), PAGE_EXECUTE_READ);
|
||||||
|
|
||||||
if (!Fogaddress)
|
if (!Fogaddress)
|
||||||
logger->warn("Fog signature not found. Maybe your game has been updated and is no more compatible with this plugin.");
|
logger->warn("Fog signature not found. Maybe your game has been updated and is no more compatible with this plugin.");
|
||||||
@@ -149,7 +149,7 @@ extern "C" __declspec(dllexport) void SetFixEnabled(bool enabled, bool init)
|
|||||||
|
|
||||||
if (!VolumetricFogaddress){
|
if (!VolumetricFogaddress){
|
||||||
constexpr auto VolumetricFogStringObfuscated = make_obfuscated<0x4A>("74 ?? F7 47 ?? ?? ?? ?? ?? 74 ?? 83 BB");
|
constexpr auto VolumetricFogStringObfuscated = make_obfuscated<0x4A>("74 ?? F7 47 ?? ?? ?? ?? ?? 74 ?? 83 BB");
|
||||||
VolumetricFogaddress = Memory::AOBScan(gameExecutable, VolumetricFogStringObfuscated.decrypt(), PAGE_EXECUTE_READ);
|
VolumetricFogaddress = Memory::AOBScan("", VolumetricFogStringObfuscated.decrypt(), PAGE_EXECUTE_READ);
|
||||||
|
|
||||||
if (!VolumetricFogaddress)
|
if (!VolumetricFogaddress)
|
||||||
logger->warn("Volumetric fog signature not found. Maybe your game has been updated and is no more compatible with this plugin.");
|
logger->warn("Volumetric fog signature not found. Maybe your game has been updated and is no more compatible with this plugin.");
|
||||||
@@ -168,11 +168,11 @@ extern "C" __declspec(dllexport) void SetFixEnabled(bool enabled, bool init)
|
|||||||
uint8_t* baseModule = reinterpret_cast<uint8_t*>(GetModuleHandleA(nullptr)); // Get game base address
|
uint8_t* baseModule = reinterpret_cast<uint8_t*>(GetModuleHandleA(nullptr)); // Get game base address
|
||||||
|
|
||||||
constexpr auto GObjetcsStringObfuscated = make_obfuscated<0x4A>("48 8B ?? ?? ?? ?? ?? 48 8B ?? ?? 48 8D ?? ?? EB ?? 33");
|
constexpr auto GObjetcsStringObfuscated = make_obfuscated<0x4A>("48 8B ?? ?? ?? ?? ?? 48 8B ?? ?? 48 8D ?? ?? EB ?? 33");
|
||||||
GObjectsaddress = Memory::AOBScan(gameExecutable, GObjetcsStringObfuscated.decrypt(), PAGE_EXECUTE_READ);
|
GObjectsaddress = Memory::AOBScan("", GObjetcsStringObfuscated.decrypt(), PAGE_EXECUTE_READ);
|
||||||
constexpr auto GNamesStringObfuscated = make_obfuscated<0x4A>("48 8D ?? ?? ?? ?? ?? EB ?? 48 8D ?? ?? ?? ?? ?? E8 ?? ?? ?? ?? C6 05 ?? ?? ?? ?? ?? 0F ?? ?? 4C");
|
constexpr auto GNamesStringObfuscated = make_obfuscated<0x4A>("48 8D ?? ?? ?? ?? ?? EB ?? 48 8D ?? ?? ?? ?? ?? E8 ?? ?? ?? ?? C6 05 ?? ?? ?? ?? ?? 0F ?? ?? 4C");
|
||||||
GNamesaddress = Memory::AOBScan(gameExecutable, GNamesStringObfuscated.decrypt(), PAGE_EXECUTE_READ);
|
GNamesaddress = Memory::AOBScan("", GNamesStringObfuscated.decrypt(), PAGE_EXECUTE_READ);
|
||||||
constexpr auto ProcessEventStringObfuscated = make_obfuscated<0x4A>("40 ?? 56 57 41 ?? 41 ?? 41 ?? 41 ?? 48 81 ?? ?? ?? ?? ?? 48 8D ?? ?? ?? 48 89 ?? ?? ?? ?? ?? 48 8B ?? ?? ?? ?? ?? 48 33 ?? 48 89 ?? ?? ?? ?? ?? 8B 41");
|
constexpr auto ProcessEventStringObfuscated = make_obfuscated<0x4A>("40 ?? 56 57 41 ?? 41 ?? 41 ?? 41 ?? 48 81 ?? ?? ?? ?? ?? 48 8D ?? ?? ?? 48 89 ?? ?? ?? ?? ?? 48 8B ?? ?? ?? ?? ?? 48 33 ?? 48 89 ?? ?? ?? ?? ?? 8B 41");
|
||||||
ProcessEventaddress = Memory::AOBScan(gameExecutable, ProcessEventStringObfuscated.decrypt(), PAGE_EXECUTE_READ);
|
ProcessEventaddress = Memory::AOBScan("", ProcessEventStringObfuscated.decrypt(), PAGE_EXECUTE_READ);
|
||||||
|
|
||||||
if (!GObjectsaddress)
|
if (!GObjectsaddress)
|
||||||
logger->warn("GObjects signature not found. Maybe your game has been updated and is no more compatible with this plugin.");
|
logger->warn("GObjects signature not found. Maybe your game has been updated and is no more compatible with this plugin.");
|
||||||
@@ -193,7 +193,7 @@ extern "C" __declspec(dllexport) void SetFixEnabled(bool enabled, bool init)
|
|||||||
if (!ProcessEventaddress)
|
if (!ProcessEventaddress)
|
||||||
logger->warn("Process Event signature not found. Maybe your game has been updated and is no more compatible with this plugin.");
|
logger->warn("Process Event signature not found. Maybe your game has been updated and is no more compatible with this plugin.");
|
||||||
else {
|
else {
|
||||||
std::optional<uint32_t> gProcessEventOffsetOpt = UE::CalculateOffset(gameExecutable, ProcessEventaddress);
|
std::optional<uint32_t> gProcessEventOffsetOpt = UE::CalculateOffset("", ProcessEventaddress);
|
||||||
uint32_t gProcessEventOffset = *gProcessEventOffsetOpt;
|
uint32_t gProcessEventOffset = *gProcessEventOffsetOpt;
|
||||||
logger->info("Process Event offset is: 0x{:X}.", gProcessEventOffset);
|
logger->info("Process Event offset is: 0x{:X}.", gProcessEventOffset);
|
||||||
Offsets::ProcessEvent = static_cast<UC::uint32>(gProcessEventOffset);// Update ProcessEvent offset
|
Offsets::ProcessEvent = static_cast<UC::uint32>(gProcessEventOffset);// Update ProcessEvent offset
|
||||||
|
|||||||
@@ -77,9 +77,10 @@ void Memory::RestoreBytes(void *address)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Memory::WaitForModule(const std::string& module_name, int timeoutMs = 15000, int intervalMs = 500)
|
MODULEINFO Memory::WaitForModule(const std::string& module_name, int timeoutMs, int intervalMs)
|
||||||
{
|
{
|
||||||
const HANDLE hProc = GetCurrentProcess();
|
const HANDLE hProc = GetCurrentProcess();
|
||||||
|
MODULEINFO modInfo{};
|
||||||
|
|
||||||
for (int waited = 0; waited < timeoutMs; waited += intervalMs)
|
for (int waited = 0; waited < timeoutMs; waited += intervalMs)
|
||||||
{
|
{
|
||||||
@@ -91,11 +92,10 @@ bool Memory::WaitForModule(const std::string& module_name, int timeoutMs = 15000
|
|||||||
for (unsigned int i = 0; i < (cbNeeded / sizeof(HMODULE)); ++i)
|
for (unsigned int i = 0; i < (cbNeeded / sizeof(HMODULE)); ++i)
|
||||||
{
|
{
|
||||||
char modName[MAX_PATH];
|
char modName[MAX_PATH];
|
||||||
if (GetModuleBaseNameA(hProc, hMods[i], modName, sizeof(modName)))
|
if (GetModuleBaseNameA(hProc, hMods[i], modName, sizeof(modName))) {
|
||||||
{
|
if (_stricmp(modName, module_name.c_str()) == 0) {
|
||||||
if (_stricmp(modName, module_name.c_str()) == 0)
|
if (GetModuleInformation(hProc, hMods[i], &modInfo, sizeof(modInfo)))
|
||||||
{
|
return modInfo;
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -105,7 +105,7 @@ bool Memory::WaitForModule(const std::string& module_name, int timeoutMs = 15000
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (_log) _log->warn("Timeout: module '{}' not found in process after {} ms.", module_name, timeoutMs);
|
if (_log) _log->warn("Timeout: module '{}' not found in process after {} ms.", module_name, timeoutMs);
|
||||||
return false;
|
return MODULEINFO{};
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string Memory::ByteToHexEscaped(const BYTE byte) {
|
std::string Memory::ByteToHexEscaped(const BYTE byte) {
|
||||||
@@ -121,14 +121,38 @@ uint8_t* Memory::AOBScan(
|
|||||||
DWORD protect_flags = PAGE_EXECUTE_READ | PAGE_EXECUTE_READWRITE | PAGE_READWRITE | PAGE_EXECUTE_WRITECOPY,
|
DWORD protect_flags = PAGE_EXECUTE_READ | PAGE_EXECUTE_READWRITE | PAGE_READWRITE | PAGE_EXECUTE_WRITECOPY,
|
||||||
std::shared_ptr<spdlog::logger> log) {
|
std::shared_ptr<spdlog::logger> log) {
|
||||||
|
|
||||||
|
bool found = false;
|
||||||
|
|
||||||
_log = log;
|
_log = log;
|
||||||
if (!WaitForModule(module_name))
|
HANDLE hProc = GetCurrentProcess();
|
||||||
{
|
MODULEINFO modInfo{};
|
||||||
if (log) log->warn("Skipping AOB scan because module '{}' is unavailable.", module_name);
|
HMODULE targetModule = nullptr;
|
||||||
|
// Get module when name is specidifed
|
||||||
|
if (!(module_name.empty() || module_name == "*")) {
|
||||||
|
if (_log) _log->info("Module name: {}", module_name);
|
||||||
|
MODULEINFO modinfo = WaitForModule(module_name);
|
||||||
|
if (modinfo.lpBaseOfDll == nullptr) {
|
||||||
|
if (_log) _log->warn("Skipping AOB scan because module '{}' is unavailable.", module_name);
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
// Fallback to determine module loaded
|
||||||
|
if (!found || module_name.empty() || module_name == "*") {
|
||||||
|
char exeBuf[MAX_PATH] = { 0 };
|
||||||
|
DWORD exeLen = GetModuleFileNameA(nullptr, exeBuf, MAX_PATH);
|
||||||
|
std::string exeName = (exeLen > 0) ? std::string(exeBuf, exeBuf + exeLen) : std::string();
|
||||||
|
size_t pos = exeName.find_last_of("\\/");
|
||||||
|
|
||||||
// Convert signature to bytes
|
if (pos != std::string::npos) exeName = exeName.substr(pos + 1);
|
||||||
|
if (_log && !exeName.empty()) _log->info("Module name: {}", exeName);
|
||||||
|
|
||||||
|
targetModule = GetModuleHandleA(nullptr);
|
||||||
|
if (!targetModule || !GetModuleInformation(hProc, targetModule, &modInfo, sizeof(modInfo))) {
|
||||||
|
if (_log) _log->error("Failed to find main module.");
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Convert AOB string into vector bytes
|
||||||
std::vector<int> pattern_bytes;
|
std::vector<int> pattern_bytes;
|
||||||
std::istringstream stream(signature);
|
std::istringstream stream(signature);
|
||||||
std::string byte_str;
|
std::string byte_str;
|
||||||
@@ -140,57 +164,45 @@ uint8_t* Memory::AOBScan(
|
|||||||
pattern_bytes.push_back(static_cast<int>(std::strtol(byte_str.c_str(), nullptr, 16)));
|
pattern_bytes.push_back(static_cast<int>(std::strtol(byte_str.c_str(), nullptr, 16)));
|
||||||
}
|
}
|
||||||
|
|
||||||
HMODULE hMods[1024];
|
if (pattern_bytes.empty()) {
|
||||||
DWORD cbNeeded;
|
if (_log) _log->warn("Empty AOB pattern passed.");
|
||||||
HANDLE hProc = GetCurrentProcess();
|
|
||||||
|
|
||||||
if (!EnumProcessModules(hProc, hMods, sizeof(hMods), &cbNeeded))
|
|
||||||
{
|
|
||||||
spdlog::error("EnumProcessModules failed.");
|
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
// Logging scanning area
|
||||||
for (unsigned int i = 0; i < (cbNeeded / sizeof(HMODULE)); ++i)
|
|
||||||
{
|
|
||||||
char modName[MAX_PATH];
|
|
||||||
if (GetModuleBaseNameA(hProc, hMods[i], modName, sizeof(modName)))
|
|
||||||
{
|
|
||||||
if (_stricmp(modName, module_name.c_str()) == 0)
|
|
||||||
{
|
|
||||||
MODULEINFO modInfo;
|
|
||||||
if (!GetModuleInformation(hProc, hMods[i], &modInfo, sizeof(modInfo)))
|
|
||||||
{
|
|
||||||
if (log) log->error("GetModuleInformation failed for '{}'", module_name);
|
|
||||||
return nullptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
uint8_t* base = reinterpret_cast<uint8_t*>(modInfo.lpBaseOfDll);
|
uint8_t* base = reinterpret_cast<uint8_t*>(modInfo.lpBaseOfDll);
|
||||||
size_t size = modInfo.SizeOfImage;
|
size_t size = modInfo.SizeOfImage;
|
||||||
if (log) log->info("Scanning memory region: 0x{:X} - 0x{:X}", reinterpret_cast<uintptr_t>(base), reinterpret_cast<uintptr_t>(base + size));
|
if (_log) _log->info("Scanning memory region: 0x{:X} - 0x{:X}",
|
||||||
|
reinterpret_cast<uintptr_t>(base), reinterpret_cast<uintptr_t>(base + size));
|
||||||
|
|
||||||
|
// Memory scan
|
||||||
MEMORY_BASIC_INFORMATION mbi{};
|
MEMORY_BASIC_INFORMATION mbi{};
|
||||||
for (uint8_t* current = base; current < base + size;)
|
for (uint8_t* current = base; current < base + size;)
|
||||||
{
|
{
|
||||||
if (!VirtualQuery(current, &mbi, sizeof(mbi)))
|
if (!VirtualQuery(current, &mbi, sizeof(mbi)))
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if ((mbi.State & MEM_COMMIT) && (mbi.Protect & protect_flags))
|
bool isCommitted = (mbi.State & MEM_COMMIT) != 0;
|
||||||
{
|
bool hasAccess = (mbi.Protect & protect_flags) != 0;
|
||||||
for (size_t i = 0; i <= mbi.RegionSize - pattern_bytes.size(); ++i)
|
bool isNoAccess = (mbi.Protect & PAGE_NOACCESS) != 0;
|
||||||
|
bool isGuard = (mbi.Protect & PAGE_GUARD) != 0;
|
||||||
|
|
||||||
|
if (isCommitted && hasAccess && !isNoAccess && !isGuard) {
|
||||||
|
uint8_t* regionBase = reinterpret_cast<uint8_t*>(mbi.BaseAddress);
|
||||||
|
size_t regionSize = mbi.RegionSize;
|
||||||
|
|
||||||
|
for (size_t i = 0; i <= regionSize - pattern_bytes.size(); ++i)
|
||||||
{
|
{
|
||||||
bool match = true;
|
bool match = true;
|
||||||
for (size_t j = 0; j < pattern_bytes.size(); ++j)
|
for (size_t j = 0; j < pattern_bytes.size(); ++j)
|
||||||
{
|
{
|
||||||
if (pattern_bytes[j] != -1 && current[i + j] != static_cast<uint8_t>(pattern_bytes[j]))
|
if (pattern_bytes[j] != -1 && regionBase[i + j] != static_cast<uint8_t>(pattern_bytes[j])) {
|
||||||
{
|
|
||||||
match = false;
|
match = false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (match)
|
if (match) {
|
||||||
{
|
uint8_t* result = regionBase + i;
|
||||||
uint8_t* result = current + i;
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -198,14 +210,6 @@ uint8_t* Memory::AOBScan(
|
|||||||
|
|
||||||
current = reinterpret_cast<uint8_t*>(mbi.BaseAddress) + mbi.RegionSize;
|
current = reinterpret_cast<uint8_t*>(mbi.BaseAddress) + mbi.RegionSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (log) log->warn("No AOB match found in module '{}'.", module_name);
|
|
||||||
return nullptr;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (log) log->warn("Module '{}' unexpectedly disappeared during scan.", module_name);
|
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
#include <windows.h>
|
||||||
|
#include <psapi.h>
|
||||||
#include <spdlog/spdlog.h>
|
#include <spdlog/spdlog.h>
|
||||||
|
|
||||||
#define AUTO_ASSEMBLE_TRAMPOLINE(ADDRESS, TRAMPOLINE_LENGTH, INSTRUCTIONS) \
|
#define AUTO_ASSEMBLE_TRAMPOLINE(ADDRESS, TRAMPOLINE_LENGTH, INSTRUCTIONS) \
|
||||||
@@ -78,7 +79,7 @@ class Memory
|
|||||||
*/
|
*/
|
||||||
static PVOID SetupOrClearHardwareBreakPointForAllThreads(uintptr_t targetAddress, PVOID vehHandle, bool enable, PVECTORED_EXCEPTION_HANDLER pVEH = nullptr, int hwIndex = 0);
|
static PVOID SetupOrClearHardwareBreakPointForAllThreads(uintptr_t targetAddress, PVOID vehHandle, bool enable, PVECTORED_EXCEPTION_HANDLER pVEH = nullptr, int hwIndex = 0);
|
||||||
private:
|
private:
|
||||||
static bool WaitForModule(const std::string& module_name, int timeoutMs, int intervalMs);
|
static MODULEINFO WaitForModule(const std::string& module_name, int timeoutMs = 15000, int intervalMs = 500);
|
||||||
struct PatchInfo {
|
struct PatchInfo {
|
||||||
void* address;
|
void* address;
|
||||||
std::vector<BYTE> originalBytes;
|
std::vector<BYTE> originalBytes;
|
||||||
|
|||||||
@@ -32,6 +32,7 @@
|
|||||||
<UseDebugLibraries>true</UseDebugLibraries>
|
<UseDebugLibraries>true</UseDebugLibraries>
|
||||||
<PlatformToolset>v143</PlatformToolset>
|
<PlatformToolset>v143</PlatformToolset>
|
||||||
<CharacterSet>Unicode</CharacterSet>
|
<CharacterSet>Unicode</CharacterSet>
|
||||||
|
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||||
@@ -45,6 +46,7 @@
|
|||||||
<UseDebugLibraries>true</UseDebugLibraries>
|
<UseDebugLibraries>true</UseDebugLibraries>
|
||||||
<PlatformToolset>v143</PlatformToolset>
|
<PlatformToolset>v143</PlatformToolset>
|
||||||
<CharacterSet>Unicode</CharacterSet>
|
<CharacterSet>Unicode</CharacterSet>
|
||||||
|
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||||
@@ -103,6 +105,7 @@
|
|||||||
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||||
<LanguageStandard>stdcpp23</LanguageStandard>
|
<LanguageStandard>stdcpp23</LanguageStandard>
|
||||||
<UseStandardPreprocessor>true</UseStandardPreprocessor>
|
<UseStandardPreprocessor>true</UseStandardPreprocessor>
|
||||||
|
<Optimization>MinSpace</Optimization>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<Link>
|
<Link>
|
||||||
<SubSystem>Windows</SubSystem>
|
<SubSystem>Windows</SubSystem>
|
||||||
@@ -130,6 +133,7 @@
|
|||||||
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||||
<LanguageStandard>stdcpp23</LanguageStandard>
|
<LanguageStandard>stdcpp23</LanguageStandard>
|
||||||
<UseStandardPreprocessor>true</UseStandardPreprocessor>
|
<UseStandardPreprocessor>true</UseStandardPreprocessor>
|
||||||
|
<Optimization>MinSpace</Optimization>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<Link>
|
<Link>
|
||||||
<SubSystem>Windows</SubSystem>
|
<SubSystem>Windows</SubSystem>
|
||||||
@@ -155,6 +159,7 @@
|
|||||||
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||||
<LanguageStandard>stdcpp23</LanguageStandard>
|
<LanguageStandard>stdcpp23</LanguageStandard>
|
||||||
<UseStandardPreprocessor>true</UseStandardPreprocessor>
|
<UseStandardPreprocessor>true</UseStandardPreprocessor>
|
||||||
|
<Optimization>MinSpace</Optimization>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<Link>
|
<Link>
|
||||||
<SubSystem>Windows</SubSystem>
|
<SubSystem>Windows</SubSystem>
|
||||||
@@ -183,6 +188,7 @@
|
|||||||
<LanguageStandard>stdcpplatest</LanguageStandard>
|
<LanguageStandard>stdcpplatest</LanguageStandard>
|
||||||
<UseStandardPreprocessor>true</UseStandardPreprocessor>
|
<UseStandardPreprocessor>true</UseStandardPreprocessor>
|
||||||
<ShowIncludes>true</ShowIncludes>
|
<ShowIncludes>true</ShowIncludes>
|
||||||
|
<Optimization>MinSpace</Optimization>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<Link>
|
<Link>
|
||||||
<SubSystem>Windows</SubSystem>
|
<SubSystem>Windows</SubSystem>
|
||||||
|
|||||||
Reference in New Issue
Block a user