mirror of
https://github.com/geode-sdk/geode.git
synced 2024-11-27 01:45:35 -05:00
fix addresser for some cocos funcs
This commit is contained in:
parent
1db0d1e6a1
commit
8b9860be5b
2 changed files with 9 additions and 1 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue