Compare commits
2 Commits
dea585ba2f
...
a3dd9d8b4a
| Author | SHA1 | Date | |
|---|---|---|---|
| a3dd9d8b4a | |||
| eea0769127 |
@@ -270,7 +270,7 @@ static void AspectFixEnabled(bool fix_enabled) {
|
|||||||
logger->info("Aspect fix enabled");
|
logger->info("Aspect fix enabled");
|
||||||
FOVFixEnabled(fix_enabled);
|
FOVFixEnabled(fix_enabled);
|
||||||
}
|
}
|
||||||
if (!fix_enabled) {
|
if (!fix_enabled && Aspectaddress) {
|
||||||
Memory::RestoreBytes(Aspectaddress);
|
Memory::RestoreBytes(Aspectaddress);
|
||||||
logger->info("Aspect ratio fix disabled");
|
logger->info("Aspect ratio fix disabled");
|
||||||
if (!g_fov_fix_enabled)
|
if (!g_fov_fix_enabled)
|
||||||
@@ -376,17 +376,11 @@ static void InitializeLogger()
|
|||||||
// Standard dll entry
|
// Standard dll entry
|
||||||
BOOL APIENTRY DllMain(HMODULE hModule, DWORD reason, LPVOID)
|
BOOL APIENTRY DllMain(HMODULE hModule, DWORD reason, LPVOID)
|
||||||
{
|
{
|
||||||
if (reason == DLL_PROCESS_ATTACH)
|
|
||||||
{
|
|
||||||
if (reason == DLL_PROCESS_ATTACH)
|
|
||||||
{
|
|
||||||
if (reason == DLL_PROCESS_ATTACH)
|
if (reason == DLL_PROCESS_ATTACH)
|
||||||
{
|
{
|
||||||
InitializeLogger();
|
InitializeLogger();
|
||||||
logger->info("Plugin {} loaded.", PLUGIN_NAME);
|
logger->info("Plugin {} loaded.", PLUGIN_NAME);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (reason == DLL_PROCESS_DETACH)
|
else if (reason == DLL_PROCESS_DETACH)
|
||||||
{
|
{
|
||||||
logger->info("Plugin {} unloaded.", PLUGIN_NAME);
|
logger->info("Plugin {} unloaded.", PLUGIN_NAME);
|
||||||
|
|||||||
@@ -19,6 +19,12 @@ const char* Memory::Float32ToHexBytes(float value) {
|
|||||||
return bytes; // pointeur vers les 4 octets bruts
|
return bytes; // pointeur vers les 4 octets bruts
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::vector<std::uint8_t> Memory::ReadBytes(const void* addr, std::size_t size) {
|
||||||
|
std::vector<std::uint8_t> buffer(size);
|
||||||
|
std::memcpy(buffer.data(), addr, size);
|
||||||
|
return buffer;
|
||||||
|
}
|
||||||
|
|
||||||
void Memory::PatchBytes(void* address, const char* bytes, size_t len)
|
void Memory::PatchBytes(void* address, const char* bytes, size_t len)
|
||||||
{
|
{
|
||||||
auto it = patches.find(address);
|
auto it = patches.find(address);
|
||||||
|
|||||||
@@ -20,6 +20,15 @@ class Memory
|
|||||||
*/
|
*/
|
||||||
static const char* Float32ToHexBytes(float value);
|
static const char* Float32ToHexBytes(float value);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Read x bytes in memory.
|
||||||
|
*
|
||||||
|
* @param address : The address to read.
|
||||||
|
* @param size : The size in bytes to read
|
||||||
|
* @std::vector<std::uint8_t> : The bytes read.
|
||||||
|
*/
|
||||||
|
static std::vector<std::uint8_t> ReadBytes(const void* addr, std::size_t size);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Patch x bytes in memory.
|
* Patch x bytes in memory.
|
||||||
*
|
*
|
||||||
|
|||||||
Reference in New Issue
Block a user