Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const char aScriptDir[] = "CoopAndreas";
- const char aScriptPath[] = "CoopAndreas\\main.scm";
- const char aImgPath[] = "CoopAndreas\\script.img";
- uintptr_t CStreaming__AddImageToList_ptr = 0x0;
- uint32_t CStreaming__AddImageToList_Hook(const char* fileName, bool notPlayerFile)
- {
- if (strncmp(fileName, "DATA\\SCRIPT\\SCRIPT.IMG", 22) == 0)
- {
- fileName = aImgPath;
- }
- return plugin::CallAndReturnDyn<uint32_t>(CStreaming__AddImageToList_ptr, fileName, notPlayerFile);
- }
- void PatchSCM()
- {
- // use our main.scm
- patch::SetPointer(0x468EB5 + 1, (void*)aScriptDir);
- patch::SetPointer(0x489A45 + 1, (void*)aScriptPath);
- // hook script.img loading
- CStreaming__AddImageToList_ptr = injector::GetBranchDestination(0x5B915B).as_int();
- patch::RedirectCall(0x5B915B, CStreaming__AddImageToList_Hook);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement