Last active
January 9, 2024 11:42
-
-
Save TheIndra55/c58300173ac47b500bb25e1d5fb5156c to your computer and use it in GitHub Desktop.
EventDebug
This file contains hidden or 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
struct EventVar | |
{ | |
char* name; | |
int offset; // offset in eventvars array | |
}; | |
struct UnsavedVar | |
{ | |
char* name; | |
int* var; | |
}; | |
// ... | |
auto level = *(Level**)(GAMETRACKER + 8); | |
if (level) | |
{ | |
// get the level reloc module | |
auto reloc = level->reloc; | |
auto eventVars = reinterpret_cast<EventVar*>(RELOC_GetProcAddress(reloc, "EventDebug")); | |
if (eventVars) | |
{ | |
// global event vars | |
auto eventVarVals = *(int**)(0x007C8A50 /* GlobalData */ + 0xE8 /* event vars */); | |
int i = 0; | |
while (true) | |
{ | |
auto var = eventVars[i++]; | |
if (var.name == nullptr) | |
break; | |
ImGui::Text("%s %d", var.name, eventVarVals[var.offset]); | |
} | |
auto unsavedVars = (UnsavedVar*)eventVars; | |
while (true) | |
{ | |
auto var = unsavedVars[i++]; | |
if (var.name == nullptr || var.var == nullptr) | |
break; | |
ImGui::Text("%s %d", var.name, *var.var); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment