fix addresser for some cocos funcs

This commit is contained in:
matcool 2023-08-27 11:10:08 -03:00
parent 1db0d1e6a1
commit 8b9860be5b
No known key found for this signature in database
GPG key ID: BF58756086D7AB1C
2 changed files with 9 additions and 1 deletions

View file

@ -310,7 +310,7 @@ class cocos2d::CCFileUtils : cocos2d::TypeInfo {
static void purgeFileUtils();
virtual void addSearchPath(const char* path);
virtual void removeSearchPath(const char *path);
virtual std::string fullPathForFilename(const char* filename, bool unk);
virtual gd::string fullPathForFilename(const char* filename, bool unk);
void removeAllPaths() = mac 0x241600;
}

View file

@ -91,6 +91,14 @@ namespace geode::addresser {
*reinterpret_cast<intptr_t*>(reinterpret_cast<intptr_t>(ins) + thunk) + index
);
#ifdef GEODE_IS_WINDOWS
// if the first instruction is a long jmp then this might still be a thunk
if (*reinterpret_cast<uint8_t*>(address) == 0xE9) {
auto relative = *reinterpret_cast<uint32_t*>(address + 1);
address = address + relative + 5;
}
#endif
address = followThunkFunction(address);
return address;