Skip to content

Commit e0427fd

Browse files
committed
maxmia stuff
1 parent e8c29d0 commit e0427fd

1 file changed

Lines changed: 38 additions & 0 deletions

File tree

src/client/origin.cpp

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,44 @@ void ConCommand_ns_send_friend_request(const CCommand& args)
227227
}
228228

229229

230+
DECLARE_HOOK(
231+
CheckIfOriginIsInstalled,
232+
engine.dll + 0xa1850,
233+
[](auto& hook, void* a1) -> bool
234+
{
235+
if (!strstr(GetCommandLineA(), "-noOriginStartup"))
236+
return hook.Original(a1);
237+
238+
if (hook.Original(a1))
239+
{
240+
NS::log::NORTHSTAR->warn(
241+
"Origin is NOT installed according to OriginSDK's check (HKLM\\SOFTWARE\\Wow6432Node\\Origin\\ClientPath is "
242+
"missing/empty).");
243+
NS::log::NORTHSTAR->warn(
244+
"We are bypassing this check in case LSX server is remotely ran (such as in Linux in another WINE prefix), but note that "
245+
"things will fail if Origin is actually not running.");
246+
}
247+
248+
return true;
249+
});
250+
251+
DECLARE_HOOK(
252+
TryToStartOrigin,
253+
engine.dll + 0xa19b0,
254+
[](auto& hook, void* a1) -> uint64_t
255+
{
256+
if (!strstr(GetCommandLineA(), "-noOriginStartup"))
257+
return hook.Original(a1);
258+
259+
if (hook.Original(a1) != 0)
260+
{
261+
NS::log::NORTHSTAR->warn(
262+
"Origin process has failed to start. We are ignoring this and let it fail on LSX connection attempt, because LSX might "
263+
"still be up regardless, even if this failed.");
264+
}
265+
return 0;
266+
});
267+
230268
ON_DLL_LOAD_CLIENT_RELIESON("engine.dll", ClientOrigin, ConCommand, [](CModule module)
231269
{
232270
DISPATCH_MODULE(OriginHooks)

0 commit comments

Comments
 (0)