Skip to content

Commit

Permalink
Merge pull request #1057 from MainMemory/master
Browse files Browse the repository at this point in the history
Panacea: Steam compatibility fix.
  • Loading branch information
Vladabdf authored Jun 15, 2024
2 parents 277a9b1 + aa9fd49 commit a5cfde6
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions OpenKh.Research.Panacea/OpenKH.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ void Hook()
Hook(pfn_Axa_AxaResourceMan_SetResourceItem, "\x48\x89\x5C\x24\x00\x55\x56\x57\x48\x81\xEC\x00\x00\x00\x00\x48\x8B\x05\x00\x00\x00\x00\x48\x33\xC4\x48\x89\x84\x24\x00\x00\x00\x00\x49\x8B\xF0\x8B\xFA\x48\x8B", "xxxx?xxxxxx????xxx????xxxxxxx????xxxxxxx");
Hook(pfn_Axa_PackageMan_GetFileInfo, "\x40\x53\x55\x56\x48\x83\xEC\x50\x48\x8B\x05\x00\x00\x00\x00\x48\x33\xC4\x48\x89\x44\x24\x00\x44\x8B\x05", "xxxxxxxxxxx????xxxxxxx?xxx");
Hook(pfn_Axa_CalcHash, "\x40\x53\x56\x57\x48\x81\xEC\x00\x00\x00\x00\x48\x8B\x05\x00\x00\x00\x00\x48\x33\xC4\x48\x89\x84\x24\x00\x00\x00\x00\x8B\xFA\x48\x8B\xD9\x48\x8D\x54\x24", "xxxxxxx????xxx????xxxxxxx????xxxxxxxxx");
Hook(pfn_Axa_SetReplacePath, "\x4C\x8D\x81\x60\x02\x00\x00\x4C\x8B\xCA\x48\x8D\x15\x00\x00\x00\x00\x48\x8D\x0D", "xxxxxxxxxxxxx????xxx");
Hook(pfn_Axa_SetReplacePath, "\x4C\x8D\x81\x00\x00\x00\x00\x4C\x8B\xCA\x48\x8D\x15\x00\x00\x00\x00\x48\x8D\x0D", "xxx????xxxxxx????xxx");
Hook(pfn_Axa_FreeAllPackages, "\x48\x89\x6C\x24\x00\x56\x48\x83\xEC\x20\x8B\x05\x00\x00\x00\x00\x33\xED\x8B\xF5", "xxxx?xxxxxxx????xxxx");
Hook(pfn_Axa_CFileMan_GetRemasteredCount, "\x48\x63\x05\x00\x00\x00\x00\x48\x8D\x0D\x00\x00\x00\x00\x48\x8B\x04\xC1\x8B\x80", "xxx????xxx????xxxxxx");
Hook(pfn_Axa_CFileMan_GetRemasteredEntry, "\x48\x63\x05\x00\x00\x00\x00\x4C\x8D\x0D\x00\x00\x00\x00\x4D\x8B\x0C\xC1\x4D\x8B", "xxx????xxx????xxxxxx");
Expand Down Expand Up @@ -101,6 +101,8 @@ void Hook()

int QuickLaunch = 0;
__int64 (*LaunchGame)(int game);
__int64 (*LaunchGameEpic)(int game);
__int64 (*LaunchGameSteam)(int game);
void QuickBootHook()
{
LaunchGame(QuickLaunch);
Expand Down Expand Up @@ -155,8 +157,13 @@ void OpenKH::Initialize()
Hook(framefunc, "\x40\x57\x48\x83\xEC\x40\x48\xC7\x44\x24\x00\x00\x00\x00\x00\x48\x89\x5C\x24\x00\x48\x8B\xD9\x8B\x41\x34", "xxxxxxxxxx?????xxxx?xxxxxx");
else
Hook(framefunc, "\x40\x57\x48\x83\xEC\x40\x48\xC7\x44\x24\x00\x00\x00\x00\x00\x48\x89\x5C\x24\x00\x48\x8B\xF9\x83\x79\x34\x00", "xxxxxxxxxx?????xxxx?xxxxxxx");
Hook(LaunchGame, "\x40\x53\x48\x81\xEC\x00\x00\x00\x00\x48\x8B\x05\x00\x00\x00\x00\x48\x33\xC4\x48\x89\x84\x24\x00\x00\x00\x00\x8B\xD9", "xxxxx????xxx????xxxxxxx????xx");
Hook(LaunchGameEpic, "\x40\x53\x48\x81\xEC\x00\x00\x00\x00\x48\x8B\x05\x00\x00\x00\x00\x48\x33\xC4\x48\x89\x84\x24\x00\x00\x00\x00\x8B\xD9", "xxxxx????xxx????xxxxxxx????xx");
Hook(LaunchGameSteam, "\x48\x89\x5C\x24\x00\x57\x48\x83\xEC\x30\x45\x33\xC9\x48\x8D\x05\x00\x00\x00\x00\x33\xD2", "xxxx?xxxxxxxxxxx????xx");
FindAllFuncs();
if (LaunchGameSteam)
LaunchGame = LaunchGameSteam;
else
LaunchGame = LaunchGameEpic;
intptr_t m_pReplaceFunc = (intptr_t)QuickBootHook;
unsigned char Patch[]
{
Expand Down

0 comments on commit a5cfde6

Please sign in to comment.