lib: when using debug mode, remap debug keys

This commit is contained in:
itsmattkc 2022-07-14 15:57:24 -07:00
parent 9bc71ff0de
commit 2321dd0ab0

View file

@ -69,6 +69,13 @@ __declspec(dllexport) DWORD WINAPI Patch()
SearchReplacePattern(dllBase, "OGEL", "\x0GEL", 4, TRUE);
}
// If using WASD, swap debug keys
{
const char *dbg_map_pattern = "\x18\x18\x18\x18\x18\x18\x18\x18\x18\x18\x18\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x18\x18\x18\x18\x18\x18\x18\x02\x18\x03\x04\x18\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x18\x0E\x18\x18\x0F\x18";
const char *dbg_map_replace = "\x02\x18\x04\x0F\x18\x18\x18\x18\x18\x18\x18\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x18\x18\x18\x18\x18\x18\x18\x18\x18\x03\x18\x18\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x18\x0E\x18\x18\x18\x18";
SearchReplacePattern(dllBase, dbg_map_pattern, dbg_map_replace, 48, TRUE);
}
// Disable auto-finish in build sections
if (config.GetInt(_T("DisableAutoFinishBuilding"))) {
// Pattern used in August build (jump is much shorter so it uses a different opcode)