Skip to content

Commit

Permalink
FEAR: add expansion pack (FEARXP/FEARXP2) support
Browse files Browse the repository at this point in the history
  • Loading branch information
anzz1 authored Aug 25, 2023
1 parent a6b4efc commit c7bae1f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
4 changes: 2 additions & 2 deletions dllmain.c
Original file line number Diff line number Diff line change
Expand Up @@ -244,10 +244,10 @@ int __stdcall DllMain(HINSTANCE hInstDLL, DWORD dwReason, LPVOID lpReserved) {
} else if (!__stricmp(p, "vietcong2.exe") || !__stricmp(p, "vc2ded.exe")) { // Vietcong 2
force_bind_ip = 0;
patch_vc2();
} else if (!__stricmp(p, "fearmp.exe")) { // FEAR (Client)
} else if (!__stricmp(p, "fearmp.exe") || !__stricmp(p, "fearxp.exe") || !__stricmp(p, "fearxp2.exe")) { // FEAR (Client)
force_bind_ip = 0;
patch_fear_cli();
} else if (!__stricmp(p, "fearserver.exe")) { // FEAR (Server)
} else if (!__stricmp(p, "fearserver.exe") || !__stricmp(p, "fearserverxp.exe")) { // FEAR (Server)
force_bind_ip = 0;
patch_fear_srv();
} else if (!__stricmp(p, "bond.exe") || !__stricmp(p, "bond_ded.exe")) { // James Bond - Nightfire
Expand Down
8 changes: 6 additions & 2 deletions include/game_fear.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,12 @@ __forceinline static void fear_disable_key_request(ULONG_PTR addr) {
}

DWORD __stdcall fear_hk_GetPrivateProfileStringA(LPCSTR lpAppName, LPCSTR lpKeyName, LPCSTR lpDefault, LPSTR lpReturnedString, DWORD nSize, LPCSTR lpFileName) {
if (lpAppName && lpKeyName && !__strcmp(lpAppName, "FEAR") && !__strcmp(lpKeyName, "CDKey")) {
if (lpFileName && __strstr(lpFileName, "FEARCombat"))
if (lpAppName && lpReturnedString && lpKeyName && nSize >= 24 && !__strcmp(lpKeyName, "CDKey")) {
if (!__strcmp(lpAppName, "FEARXP"))
__strcpy(lpReturnedString, "SAP6-NUD3-LAP5-RAP2-9565"); // Generic FEARXP
else if (!__strcmp(lpAppName, "FEARXP2"))
__strcpy(lpReturnedString, "TAP6-WAB6-CAG3-BES3-9883"); // Generic FEARXP2
else if (!__strcmp(lpAppName, "FEAR") && lpFileName && __strstr(lpFileName, "FEARCombat"))
__strcpy(lpReturnedString, "LER7-BAB6-JYX5-BYX6-6324"); // Generic MPFREE
else
__strcpy(lpReturnedString, "NAS3-XUS9-SER5-JET6-5558"); // Generic Retail
Expand Down

0 comments on commit c7bae1f

Please sign in to comment.