Skip to content

Commit 9d11916

Browse files
committed
try removing bissubscribedhook
1 parent dddfdfa commit 9d11916

4 files changed

Lines changed: 1 addition & 51 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@ build32/
22
build64/
33
build/
44
.vs/
5+
/relbuild

dllmain.cpp

Lines changed: 0 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -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

include/api/api_client.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -274,8 +274,6 @@ S_API ESteamAPIInitResult S_CALLTYPE SteamInternal_SteamAPI_Init(const char* psz
274274

275275
if (g_bClientReady)
276276
{
277-
// try and make sure this works, thank you xinerqu
278-
InstallBIsSubscribedAppHook();
279277

280278
return k_ESteamAPIInitResult_OK;
281279
}

include/globals.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -374,4 +374,3 @@ void UCOColor(WORD color, const char* text);
374374
void* InitSteamClient(HMODULE* phModule, bool bLocal, const char* iface);
375375
void LoadBreakpadSymbols(HMODULE hMod);
376376
void UpdateMinidumpSteamID(uint64 sid);
377-
void InstallBIsSubscribedAppHook();

0 commit comments

Comments
 (0)