Added a way to disable the memPatch function for those worried about T2 ROP being used with memPatch

This commit is contained in:
Robert MacGregor 2016-05-06 22:33:49 -04:00
parent ee256dfe16
commit 524dd4b205
3 changed files with 17 additions and 0 deletions

View file

@ -68,6 +68,8 @@ bool conForceUpdate(Linker::SimObject *obj, S32 argc, const char* argv[]);
// General Commands ---------------------------------
const char* conSprintf(Linker::SimObject *obj, S32 argc, const char* argv[]);
bool conTSExtensionUpdate(Linker::SimObject *obj, S32 argc, const char *argv[]);
// memPatch Disabler -------------------------------
bool disableMempatch(Linker::SimObject* obj, S32 argc, const char* argv[]);
// Regex Commands ----------------------------------
const char* reIterNext(Linker::SimObject* obj, S32 argc, const char* argv[]);
bool reIterEnd(Linker::SimObject* obj, S32 argc, const char* argv[]);

View file

@ -377,6 +377,19 @@ const char* conSprintf(Linker::SimObject *obj, S32 argc, const char* argv[])
return result;
}
// memPatch Disabler
bool memPatchStub(Linker::SimObject* obj, S32 argc, const char* argv[])
{
Con::errorf(0, "TSExtension: Attempted usage of memPatch after disabling it!");
return false;
}
bool disableMempatch(Linker::SimObject* obj, S32 argc, const char* argv[])
{
Con::addMethodB(NULL, "memPatch", &memPatchStub,"Currently not available.", 1, 1);
return true;
}
// RE Commands -----------------------------------
#include <regex>

View file

@ -459,6 +459,8 @@ __declspec(naked) void updateMoveHook()
// General
Con::addMethodS(NULL, "sprintf", &conSprintf,"Formats a string. See the C sprintf.", 2, 20);
Con::addMethodB(NULL, "tsExtensionUpdate", &conTSExtensionUpdate,"Updates the TSExtension.", 1, 1);
// memPatch Disabler
Con::addMethodB(NULL, "disableMempatch", &disableMempatch,"Disables memPatch.", 1, 1);
// Regex
Con::addMethodB(NULL, "reSearch", &reSearch,"reSearch(pattern, target): Searches for a pattern within the target string.", 3, 3);
Con::addMethodB(NULL, "reMatch", &reMatch,"reMatch(pattern, target): Attempts to match the entire target string to a pattern.", 3, 3);