Closed chayleaf closed 6 years ago
sorry, No. but you can call replacement2
in replacement1
Ok, thanks for the answer. I'm making a modification api for a C++ game, and I want multiple mods that hook the same function to be compatible. In this case I will write my own wrapper that will use updated addresses (I suppose you can do
void log(const char *text);
void hooked();
typedef void(*hooked_t)(void);
hooked_t origin1;
void replacement1() {
log("hook 1 works");
origin1();
}
hooked_t origin2;
void replacement2() {
log("hook 2 works");
origin2();
}
ZzHookReplace(
&hooked,
&replacement2,
&origin2
);
ZzHookReplace(
&replacement2,
&replacement1,
&origin1
);
hooked();
/*
* log now contains:
* hook 1 works
* hook 2 works
*/
)
something like