fix nmt swpa

This commit is contained in:
Gray
2025-07-19 17:34:55 -04:00
parent 82da56da66
commit 9a69c9d5c6
6 changed files with 12 additions and 9 deletions

View File

@@ -9,6 +9,11 @@
struct FMemory
{
static inline void* (*Realloc)(void* Original, SIZE_T Count, uint32_t Alignment /* = DEFAULT_ALIGNMENT */);
static void Free(void* Address)
{
Realloc(Address, 0, 0);
}
};
template <typename T = __int64>
@@ -330,7 +335,7 @@ public:
{
if (true)
{
static void (*FreeOriginal)(void* Original) = decltype(FreeOriginal)(Addresses::Free);
static void (*FreeOriginal)(void* Original) = decltype(FreeOriginal)(0);
if (FreeOriginal)
FreeOriginal(Data);

View File

@@ -88,10 +88,7 @@ struct PickupCreateData
if (bUseFMemoryRealloc)
{
static void (*FreeOriginal)(void* Original) = decltype(FreeOriginal)(Addresses::Free);
if (FreeOriginal)
FreeOriginal(ItemEntry);
FMemory::Free(ItemEntry);
}
else
{

View File

@@ -837,8 +837,8 @@ int32 UNetDriver::ServerReplicateActors()
if (!Channel)
{
if (!Offsets::IsNetRelevantFor
&& Actor->IsA(APlayerController::StaticClass()) && Actor != Connection->GetPlayerController()) // isnetrelevantfor should handle this iirc
if (// !Offsets::IsNetRelevantFor &&
Actor->IsA(APlayerController::StaticClass()) && Actor != Connection->GetPlayerController()) // isnetrelevantfor should handle this iirc
continue;
if (bLevelInitializedForActor)

View File

@@ -54,7 +54,6 @@ namespace Addresses
extern inline uint64 RemoveFromAlivePlayers = 0;
extern inline uint64 ActorChannelClose = 0;
extern inline uint64 FrameStepExplicitProperty = 0;
extern inline uint64 Free = 0;
extern inline uint64 ClearAbility = 0;
extern inline uint64 ApplyGadgetData = 0;
extern inline uint64 RemoveGadgetData = 0;

View File

@@ -318,7 +318,7 @@ uint64 ApplyGameSessionPatch()
return 0;
}
LOG_INFO(LogDev, "ByteToPatch: 0x{:x}", __int64(ByteToPatch) - __int64(GetModuleHandleW(0)));
LOG_INFO(LogDev, "[ApplyGameSessionPatch] ByteToPatch: 0x{:x}", __int64(ByteToPatch) - __int64(GetModuleHandleW(0)));
DWORD dwProtection;
VirtualProtect((PVOID)ByteToPatch, 1, PAGE_EXECUTE_READWRITE, &dwProtection);

View File

@@ -1203,6 +1203,8 @@ static inline uint64 FindGetInterfaceAddress()
static inline uint64 FindCollectGarbage()
{
if (Engine_Version == 416)
return Memcury::Scanner::FindPattern("48 8B C4 48 89 58 08 88 50 10 55 56 57 41 54 41 55 41 56 41 57 48 8D 68 A1").Get(); // 1.9
// return 0;
auto Addr = Memcury::Scanner::FindStringRef(L"STAT_CollectGarbageInternal");