Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void *handle = dlopen("/usr/lib/libsubstitute.dylib", RTLD_NOW); //libsubstitute dylib. Nothing much.
- if (!handle) {
- logToFile("[ERROR] %s", dlerror()); //No error happens here. Assume we're good
- return;
- }
- int (*substitute_hook_functions)(const struct substitute_function_hook *hooks, size_t nhooks, struct substitute_function_hook_record **recordp, int options) = dlsym(handle, "substitute_hook_functions");
- if (!substitute_hook_functions) {
- logToFile("[ERROR] %s", dlerror()); //No error happens here. Assume we're good
- return;
- }
- struct substitute_function_hook psp_fake_hook;
- psp_fake_hook.function = posix_spawn;
- psp_fake_hook.replacement = fake_psx_spawn;
- psp_fake_hook.old_ptr = &old_psx_spawn;
- psp_fake_hook.options = 0;
- substitute_hook_functions(&psp_fake_hook, 1, NULL, SUBSTITUTE_NO_THREAD_SAFETY);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement