-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add GarbageCollectorForcer ASI. Make AceSlammer buildable (disable ra…
…gdoll features)
- Loading branch information
Showing
13 changed files
with
341 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
#include <chrono> | ||
#include <string> | ||
#include "../ME3SDK/SdkHeaders.h" | ||
#include "../detours/detours.h" | ||
|
||
#define _CRT_SECURE_NO_WARNINGS | ||
#pragma comment(lib, "detours.lib") //Library needed for Hooking part. | ||
|
||
typedef void(__thiscall* tProcessEvent)(class UObject*, class UFunction*, void*, void*); | ||
tProcessEvent ProcessEvent = (tProcessEvent)0x00453120; | ||
|
||
auto _personalization_lastForcedGC = std::chrono::steady_clock::now(); // Init at app boot | ||
auto _personalizationGCInterval = 8; | ||
|
||
void __fastcall HookedPE(UObject *pObject, void *edx, UFunction *pFunction, void *pParms, void *pResult) | ||
{ | ||
char* szName = pFunction->GetFullName(); | ||
|
||
// Force Garbage Collection when the personalization UI is open (armor locker) every 8 seconds. | ||
if (strcmp(szName, "Function SFXGame.SFXSFHandler_PCPersonalization.Update") == 0) | ||
{ | ||
auto now = std::chrono::steady_clock::now(); | ||
auto time_elapsed = std::chrono::duration_cast<std::chrono::seconds>(now - _personalization_lastForcedGC).count(); | ||
if (time_elapsed > _personalizationGCInterval) | ||
{ | ||
USFXSFHandler_PCPersonalization* sfxHandler = static_cast<USFXSFHandler_PCPersonalization*>(pObject); | ||
sfxHandler->oWorldInfo->ForceGarbageCollection(false); | ||
_personalization_lastForcedGC = now; | ||
} | ||
} | ||
ProcessEvent(pObject, pFunction, pParms, pResult); | ||
} | ||
|
||
void onAttach() | ||
{ | ||
DetourTransactionBegin(); | ||
DetourUpdateThread(GetCurrentThread()); //This command set the current working thread to the game current thread. | ||
DetourAttach(&(PVOID&)ProcessEvent, HookedPE); //This command will start your Hook. | ||
DetourTransactionCommit(); | ||
} | ||
|
||
BOOL WINAPI DllMain(HMODULE hModule, DWORD dwReason, LPVOID lpReserved) | ||
{ | ||
switch (dwReason) | ||
{ | ||
case DLL_PROCESS_ATTACH: | ||
DisableThreadLibraryCalls(hModule); | ||
CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)onAttach, NULL, 0, NULL); | ||
return true; | ||
break; | ||
|
||
case DLL_PROCESS_DETACH: | ||
return true; | ||
break; | ||
} | ||
return true; | ||
}; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<ItemGroup> | ||
<Filter Include="Source Files"> | ||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier> | ||
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions> | ||
</Filter> | ||
<Filter Include="Header Files"> | ||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier> | ||
<Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions> | ||
</Filter> | ||
<Filter Include="Resource Files"> | ||
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier> | ||
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions> | ||
</Filter> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<ClCompile Include="KismetLogger.cpp"> | ||
<Filter>Source Files</Filter> | ||
</ClCompile> | ||
</ItemGroup> | ||
</Project> |
Binary file not shown.
Oops, something went wrong.