Skip to content

Instantly share code, notes, and snippets.

@Kif11
Created July 11, 2026 09:23
Show Gist options
  • Select an option

  • Save Kif11/47c886e9c17f245eab6a01e545fa8a00 to your computer and use it in GitHub Desktop.

Select an option

Save Kif11/47c886e9c17f245eab6a01e545fa8a00 to your computer and use it in GitHub Desktop.
Cyberpunk 2077 Mac crash fix — stub libGameServicesGOG.dylib to fix SIGSEGV in SetRichPresence
// Cyberpunk 2077 Mac — Crash on save load (SIGSEGV in SetRichPresence)
//
// Problem: Game crashes on any save load. GOG Galaxy not installed, so
// SetRichPresence passes a null string to syslog() -> segfault.
//
// Fix: Replace libGameServicesGOG.dylib with this no-op stub.
//
// Compile:
// clang -dynamiclib -arch arm64 -o libGameServicesGOG.dylib cyberpunk2077_mac_fix.c \
// -install_name @executable_path/../Frameworks/libGameServicesGOG.dylib
//
// Install:
// cp "/Applications/Cyberpunk 2077/Cyberpunk2077.app/Contents/Frameworks/libGameServicesGOG.dylib" \
// "/Applications/Cyberpunk 2077/Cyberpunk2077.app/Contents/Frameworks/libGameServicesGOG.dylib.bak"
// cp libGameServicesGOG.dylib "/Applications/Cyberpunk 2077/Cyberpunk2077.app/Contents/Frameworks/"
//
// Restore:
// cp "/Applications/Cyberpunk 2077/Cyberpunk2077.app/Contents/Frameworks/libGameServicesGOG.dylib.bak" \
// "/Applications/Cyberpunk 2077/Cyberpunk2077.app/Contents/Frameworks/libGameServicesGOG.dylib"
#include <stddef.h>
#include <stdarg.h>
// C++ mangled gs:: namespace functions (must match original dylib)
void _ZN2gs8WriteLogEPKcz(const char* fmt, ...) {}
void _ZN2gs13SetAllocatorsEPFPvS0_mmEPFvPKvE(void* a, void* b) {}
void _ZN2gs4FreeEPKv(const void* p) {}
void* _ZN2gs7ReallocEPvmm(void* p, size_t a, size_t b) { return NULL; }
// C-linkage exports
void Initialize(void) {}
void Uninitialize(void) {}
void Update(void) {}
void SignIn(void) {}
void SetRichPresence(const char* a, void* b, void* c) {}
void SyncAchievement(void) {}
void SyncAchievementList(void) {}
void UnlockAchievement(void) {}
void SetNetworkState(int s) {}
void SetOverlayHandler(void* h) {}
void SetCommandLineHandler(void* h) {}
void SetLogger(void* l) {}
void RequestEncryptedAppTicket(void) {}
void OpenWebBrowser(const char* u) {}
const char* GetPlatformName(void) { return "stub"; }
const char* GetLanguageCodeName(void) { return "en"; }
const char* GetLibraryVersion(void) { return "0.0.0"; }
void VerifyDataIntegrity(void) {}
void CheckAdditionalContentStatus(void) {}
int IsPurchaseThroughAppEnabled(void) { return 0; }
int IsInstallThroughAppEnabled(void) { return 0; }
void RequestAdditionalContentPurchase(void) {}
void RequestAdditionalContentInstall(void) {}
void SetAddtionalContentInstallCallback(void* c) {}
void CloudSaveReady(void) {}
void FetchCloudSavedGameData(void) {}
void DeleteCloudSavedGameData(void) {}
void SaveDataToCloud(void) {}
@tlentulen

tlentulen commented Jul 25, 2026 •

Copy link
Copy Markdown

Hi, thank you - this helped with the crashes! But it introduced another problem now: the game doesn't see the Phantom Liberty DLC, even though it's installed. Any idea how to fix that?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment