@@ -249,54 +249,6 @@ void* InitSteamClient(HMODULE* phMod, bool bLocal, const char* iface)
249249 return nullptr ;
250250}
251251
252- // ============================================================
253- // BIsSubscribedApp Hook - always return true
254- // Fixes games with hardcoded AppID subscription checks
255- // ~ credits to xinerqu ~
256- // ============================================================
257-
258- typedef bool (S_CALLTYPE *Fn_BIsSubscribedApp)(void *, AppId_t);
259- static Fn_BIsSubscribedApp g_pfnOriginalBIsSubscribedApp = nullptr ;
260-
261- static bool S_CALLTYPE Hooked_BIsSubscribedApp (void * pSteamApps, AppId_t appId)
262- {
263- UCOLOG (" [UCOnline2] BIsSubscribedApp(%u) -> hooked, returning true" , appId);
264- return true ;
265- }
266-
267- void InstallBIsSubscribedAppHook ()
268- {
269- if (!g_bClientReady || !g_ClientCtx.SteamApps ())
270- {
271- UCOLOG (" [UCOnline2] Cannot install BIsSubscribedApp hook: client not ready or SteamApps is null" );
272- return ;
273- }
274-
275- void ** vtable = *reinterpret_cast <void ***>(g_ClientCtx.SteamApps ());
276-
277- // ISteamApps vtable layout (from isteamapps.h):
278- // 0: BIsSubscribed, 1: BIsLowViolence, 2: BIsCybercafe, 3: BIsVACBanned,
279- // 4: GetCurrentGameLanguage, 5: GetAvailableGameLanguages, 6: BIsSubscribedApp
280- void * pOriginalFunc = vtable[6 ];
281-
282- MH_STATUS mhStatus = MH_Initialize ();
283- UCOLOG (" [UCOnline2] MH_Initialize status: %d" , mhStatus);
284-
285- mhStatus = MH_CreateHook (pOriginalFunc, &Hooked_BIsSubscribedApp, reinterpret_cast <void **>(&g_pfnOriginalBIsSubscribedApp));
286- if (mhStatus == MH_OK)
287- {
288- mhStatus = MH_EnableHook (pOriginalFunc);
289- if (mhStatus == MH_OK)
290- UCOLOG (" [UCOnline2] BIsSubscribedApp hook installed successfully" );
291- else
292- UCOLOG (" [UCOnline2] MH_EnableHook failed for BIsSubscribedApp: %d" , mhStatus);
293- }
294- else
295- {
296- UCOLOG (" [UCOnline2] MH_CreateHook failed for BIsSubscribedApp: %d" , mhStatus);
297- }
298- }
299-
300252
301253// ============================================================
302254// LoadGameOverlay
0 commit comments