void PatchMW2_WeaponCamos()
{
#if PRE_RELEASE_DEMO
	// before enabling: g_modelindex: overflow
	return;
#endif

	xModelTable.set_empty_key("");
	xMaterialTable.set_empty_key("");

	/*
	xModelLoadHook.initialize(xModelLoadHookLoc, XModelLoadHookFunc);
	xModelLoadHook.installHook();

	xModelLoadHook2.initialize(xModelLoadHook2Loc, XModelLoadHookFunc);
	xModelLoadHook2.installHook();

	xModelLoadHook3.initialize(xModelLoadHook3Loc, XModelLoadHookFunc);
	xModelLoadHook3.installHook();
	*/

	forEachXAssetHook.initialize(forEachXAssetHookLoc, ForEachXAssetHookStub);
	forEachXAssetHook.installHook();

	postWeaponLoadHook.initialize(postWeaponLoadHookLoc, PostWeaponLoadHookStub);
	postWeaponLoadHook.installHook();
}
void PatchMW2_SuicideMessages()
{
	srand((unsigned int)time(NULL));

	printObituaryHook.initialize(printObituaryHookLoc, PrintObituaryHookStub);
	printObituaryHook.installHook();
}
static void PatchMW2_ClientConsole_Toggle()
{
	clKeyEventToggleConsoleHook1.initialize((PBYTE)clKeyEventToggleConsoleHook1Loc);
	clKeyEventToggleConsoleHook1.installHook(Con_ToggleConsole, false);

	clKeyEventToggleConsoleHook2.initialize(5, (PBYTE)clKeyEventToggleConsoleHook2Loc);
	clKeyEventToggleConsoleHook2.installHook(Con_ToggleConsole, true, false);
}
void PatchMW2_UserAvatars()
{
	call(0x594295, SetPlayerCardInfoHook, PATCH_CALL);

	initGFXImages.initialize(initGFXImagesLoc, InitGFXImagesHook);
	initGFXImages.installHook();

	call(0x59449F, OnServerCommandStub, PATCH_JUMP);

	call(0x5910BC, DrawScoreboardRankStub, PATCH_CALL);
}
void PatchMW2_RemoteConsoleServer()
{
	// maximum size in NET_OutOfBandPrint
	*(DWORD*)0x4AEF08 = 0x1FFFC;
	*(DWORD*)0x4AEFA3 = 0x1FFFC;

	// client-side OOB handler
	*(int*)0x5AA715 = ((DWORD)SVC_RemoteCommandStub) - 0x5AA713 - 6;

	gsrCmpHook.initialize((PBYTE)gsrCmpHookLoc);
	gsrCmpHook.installHook(GsrCmpHookStub, false);
}
void PatchMW2_OOB()
{
	// maximum size in NET_OutOfBandPrint
	*(DWORD*)0x4AEF08 = 0x1FFFC;
	*(DWORD*)0x4AEFA3 = 0x1FFFC;

	// client-side OOB handler
	*(int*)0x5AA715 = ((DWORD)CL_DeployOOBStub) - 0x5AA713 - 6;

	gsrCmpHook.initialize(gsrCmpHookLoc, GsrCmpHookStub);
	gsrCmpHook.installHook();
}
Пример #7
0
void PatchMW2_Stats()
{
	writeStatsHook.initialize(writeStatsHookLoc, WriteStatsHookStub);
	writeStatsHook.installHook();

	loadOldStatsHook.initialize(loadOldStatsHookLoc, LoadOldStatsHookFunc);
	loadOldStatsHook.installHook();

	readStatsHook.initialize(readStatsHookLoc, ReadStatsHookStub);
	readStatsHook.installHook();

	// make statWriteNeeded ignored (kill stat saving?)
	//*(BYTE*)0x424BD0 = 0xEB;
}
Пример #8
0
void PatchMW2_OOB()
{
	if(version == 159)
	{
		// client-side OOB handler
		*(int*)0x65E454 = ((DWORD)CL_DeployOOBStub) - 0x65E452 - 6;
	}
	else
	{
		// client-side OOB handler
		*(int*)0x65BCE4 = ((DWORD)CL_DeployOOBStub) - 0x65BCE2 - 6;

		gsrCmpHookLoc = 0x65BCD8;
	}

	gsrCmpHook.initialize(gsrCmpHookLoc, GsrCmpHookStub);
	gsrCmpHook.installHook();
}
Пример #9
0
// patch entry point
void PatchMW2_Console()
{
	createConsoleHook.initialize(5, (PBYTE)HOOK_Sys_CreateConsole);
	createConsoleHook.installHook(Sys_CreateConsole, true, false);

	destroyConsoleHook.initialize(5, (PBYTE)HOOK_Sys_DestroyConsole);
	destroyConsoleHook.installHook(Sys_DestroyConsole, true, false);

	// TODO: get rid of weird casts
	sysPrintHook.initialize(5, (PBYTE)HOOK_Sys_Print);
	sysPrintHook.installHook((void (__cdecl *)(void))Sys_Print, true, false);

	sysErrorHook.initialize(5, (PBYTE)HOOK_Sys_Error);
	sysErrorHook.installHook((void (__cdecl *)(void))Sys_Error, true, false);

	consoleInputHook.initialize((PBYTE)HOOK_Sys_ConsoleInput);
	consoleInputHook.installHook((void (__cdecl *)(void))Sys_ConsoleInput, false);

	//PatchMW2_DebugAllocations();
}
Пример #10
0
void PatchMW2_Branding()
{
	cg_hideVersion = Dvar_RegisterBool("cg_hideVersion", false, DVAR_FLAG_SAVED, "Hide the version release branding text.");

	drawDevStuffHook.initialize(drawDevStuffHookLoc, DrawDevStuffHookStub);
	drawDevStuffHook.installHook();

	// createwindowexa on winconsole
	static DWORD wcCWEx = (DWORD)CreateWindowExAWrap_WC;
	static DWORD wcGEx = (DWORD)CreateWindowExAWrap_G;
	*(DWORD**)0x4289CA = &wcCWEx;
	*(DWORD**)0x5076AC = &wcGEx;

	// displayed build tag in UI code
	*(DWORD*)0x43F73B = (DWORD)"";

	// console '%s: %s> ' string
	*(DWORD*)0x5A44B4 = (DWORD)(VERSIONSTRING "> ");

	// console version string
	*(DWORD*)0x4B12BB = (DWORD)(VERSIONSTRING " (built " __DATE__ " " __TIME__ ")");

	// version string
	*(DWORD*)0x60BD56 = (DWORD)(VERSIONSTRING " (built " __DATE__ " " __TIME__ ")");

	// set fs_basegame to 'iw4lan' (will apply before fs_game, unlike the above line)
	*(DWORD*)0x6431D1 = (DWORD)"iw4lan";

	// increase font sizes for chat on higher resolutions
	static float float13 = 13.0f;
	static float float10 = 10.0f;
	*(float**)0x5814AE = &float13;
	*(float**)0x5814C8 = &float10;

#ifndef MATCHMAKING
	// use M2 playlists
	strcpy((char*)0x6EE7AC, "mp_playlists_m2");
	*(DWORD*)0x4D47FB = (DWORD)"mp_playlists_m2.ff";
#endif
}
Пример #11
0
void PatchMW2_Load()
{
	zoneLoadHook1.initialize(zoneLoadHook1Loc, ZoneLoadHook1Stub);
	zoneLoadHook1.installHook();

	zoneLoadHook2.initialize(zoneLoadHook2Loc, ZoneLoadHook2Stub);
	zoneLoadHook2.installHook();

	// zone folders -> remove absolute stuff
	zoneTestHook.initialize(zoneTestHookLoc, ZoneTestHookFunc);
	zoneTestHook.installHook();

	zoneSprintfHook.initialize(zoneSprintfHookLoc, ZoneSprintfHookFunc);
	zoneSprintfHook.installHook();
}
Пример #12
0
void PatchMW2_Load()
{
	// rawfile moddability
	rawFileHook1.initialize(rawFileHook1Loc, LoadModdableRawfileStub);
	rawFileHook1.installHook();

	rawFileHook2.initialize(rawFileHook2Loc, LoadModdableRawfileStub);
	rawFileHook2.installHook();

	rawFileHook3.initialize(rawFileHook3Loc, LoadModdableRawfileStub);
	rawFileHook3.installHook();

	rawFileHook4.initialize(rawFileHook4Loc, LoadModdableRawfileStub2);
	rawFileHook4.installHook();

	rawFileHook5.initialize(rawFileHook5Loc, LoadModdableRawfileStub);
	rawFileHook5.installHook();

	rawFileHook6.initialize(rawFileHook6Loc, LoadModdableRawfileStub);
	rawFileHook6.installHook();

	rawFileHook7.initialize(rawFileHook7Loc, LoadModdableRawfileStub);
	rawFileHook7.installHook();

	rawFileHook8.initialize(rawFileHook8Loc, LoadModdableRawfileStub);
	rawFileHook8.installHook();

	//rawFileHook9.initialize(rawFileHook9Loc, LoadModdableRawfileStub);
	//rawFileHook9.installHook();

	//rawFileHook10.initialize(rawFileHook10Loc, LoadModdableRawfileStub);
	//rawFileHook10.installHook();

	// fastfile loading hooks
	uiLoadHook1.initialize(uiLoadHook1Loc, UILoadHook1Stub);
	uiLoadHook1.installHook();

	ffLoadHook1.initialize(ffLoadHook1Loc, FFLoadHook1Stub);
	ffLoadHook1.installHook();

	ffLoadHook2.initialize(ffLoadHook2Loc, FFLoadHook2Stub);
	ffLoadHook2.installHook();

	zoneLoadHook1.initialize(zoneLoadHook1Loc, ZoneLoadHook1Stub);
	zoneLoadHook1.installHook();

	zoneLoadHook2.initialize(zoneLoadHook2Loc, ZoneLoadHook2Stub);
	zoneLoadHook2.installHook();

	getZoneRootHook.initialize(getZoneRootHookLoc, GetZoneRootHookFunc);
	getZoneRootHook.installHook();

	// disable 'ignoring asset' notices
	memset((void*)0x5BB902, 0x90, 5);

	// ignore 'no iwd files found in main'
	memset((void*)0x642A4B, 0x90, 5);

	if (strstr(GetCommandLine(), "fs_cdpath") != NULL)
	{
		// fs_basepath for 'players' -> fs_cdpath
		*(DWORD*)0x482408 = 0x63D0BB0;
	}

	// zone folders -> remove absolute stuff
	zoneTestHook.initialize(zoneTestHookLoc, ZoneTestHookFunc);
	zoneTestHook.installHook();

	zoneSprintfHook.initialize(zoneSprintfHookLoc, ZoneSprintfHookFunc);
	zoneSprintfHook.installHook();
}
void PatchMW2_MusicalTalent()
{
	findSoundAliasHook.initialize(findSoundAliasHookLoc, FindSoundAliasHookFunc);
	findSoundAliasHook.installHook();
}
void PatchMW2_Load()
{
	// rawfile moddability
	rawFileHook1.initialize((PBYTE)rawFileHook1Loc);
	rawFileHook1.installHook(LoadModdableRawfileStub, false);

	rawFileHook2.initialize((PBYTE)rawFileHook2Loc);
	rawFileHook2.installHook(LoadModdableRawfileStub, false);

	rawFileHook3.initialize((PBYTE)rawFileHook3Loc);
	rawFileHook3.installHook(LoadModdableRawfileStub, false);

	rawFileHook4.initialize((PBYTE)rawFileHook4Loc);
	rawFileHook4.installHook(LoadModdableRawfileStub2, false);

	// fastfile loading hooks
	uiLoadHook1.initialize((PBYTE)uiLoadHook1Loc);
	uiLoadHook1.installHook(UILoadHook1Stub, false);

	ffLoadHook1.initialize((PBYTE)ffLoadHook1Loc);
	ffLoadHook1.installHook(FFLoadHook1Stub, false);

	ffLoadHook2.initialize((PBYTE)ffLoadHook2Loc);
	ffLoadHook2.installHook(FFLoadHook2Stub, false);

	zoneLoadHook1.initialize((PBYTE)zoneLoadHook1Loc);
	zoneLoadHook1.installHook(ZoneLoadHook1Stub, false);

	zoneLoadHook2.initialize((PBYTE)zoneLoadHook2Loc);
	zoneLoadHook2.installHook(ZoneLoadHook2Stub, false);

	//ReallocateAssetPool(ASSET_TYPE_WEAPON, 1400);
	return; // TODO: change this for build 159, possibly use dynamic offsets from array start
	// reallocation of image assets
	*(DWORD*)0x799618 = 0xE00 * 2; // originally 0xE00
	*(DWORD*)0x7998D8 = (DWORD)malloc((0xE00 * 2) * 0x20);

	// reallocation of loaded_sound assets
	*(DWORD*)0x799624 = 0x546 * 2; // assetID 13
	*(DWORD*)0x7998E4 = (DWORD)malloc((0x546 * 2) * 0x2C);

	// reallocation of fx assets
	*(DWORD*)0x799668 = 600 * 2; // assetID 30
	*(DWORD*)0x799928 = (DWORD)malloc((600 * 2) * 32);

	// reallocation of localize assets
	*(DWORD*)0x79965C = 7000 * 2; // assetID 27
	*(DWORD*)0x79991C = (DWORD)malloc((7000 * 2) * 8);

	// reallocation of xanim assets
	*(DWORD*)0x7995F8 = 4096 * 2; // assetID 2
	*(DWORD*)0x7998B8 = (DWORD)malloc((4096 * 2) * 88);

	// reallocation of xmodel assets
	*(DWORD*)0x799600 = 1536 * 2; // assetID 4
	*(DWORD*)0x7998C0 = (DWORD)malloc((1536 * 2) * 304);

	// reallocation of physpreset assets
	*(DWORD*)0x7995F0 = 64 * 2; // assetID 0
	*(DWORD*)0x7998B0 = (DWORD)malloc((64 * 2) * 44);

	// set GameWorldSp pool to be a random 1024 byte buffer (GameWorldMp is just a name it seems, as such useless)
	DWORD gwSP = (DWORD)malloc(1024);

	*(DWORD*)0x7998F4 = gwSP;

	// set this bit of data loaded from the GameWorld to point to new offset in GameWorldSp (seems it got added in IW4, as such 'aww')
	//*(DWORD*)0x4137C7 = gwSP + 52;

	// try not to re/unload ui FFs
	*(BYTE*)0x60DAF0 = 0xC3;

	// allow loading of IWffu (unsigned) files
	*(BYTE*)0x414AB9 = 0xEB; // main function
	*(WORD*)0x50B3C7 = 0x9090; // DB_AuthLoad_InflateInit

	// temporary stuff to not load from maps/mp/, needs to be changed to check for mp_*
	//strcpy((char*)0x70D6CC, "maps/%s.d3dbsp");

	// ignore 'node_' entities as well
	ignoreEntityHook.initialize((PBYTE)ignoreEntityHookLoc);
	ignoreEntityHook.installHook((void(*)())IgnoreEntityHookFunc, false);

	// reallocate XAsset entries
	ReallocEntries();

	*(DWORD*)0x5BE4E0 = 789312;
}
void PatchMW2_InGameMenu()
{
	ingameMenuHook.initialize(ingameMenuHookLoc, IngameMenuHookStub);
	ingameMenuHook.installHook();
}
void PatchMW2_Extrasensory()
{
	entityWriteFieldsHook.initialize(entityWriteFieldsHookLoc, EntityWriteFieldsHookStub);
	entityWriteFieldsHook.installHook();
}
void PatchMW2_Branding()
{
	#ifdef IW4M_OLD_CODE
	// displayed build tag in UI code
	*(DWORD*)0x43F73B = (DWORD)VERSIONSTRING;

	// console '%s: %s> ' string
	*(DWORD*)0x5A44B4 = (DWORD)(VERSIONSTRING "> ");

	// console version string
	//*(DWORD*)0x4B12BB = (DWORD)(VERSIONSTRING " " BUILDHOST " (built " __DATE__ " " __TIME__ ")");

	// version string
	*(DWORD*)0x60BD56 = (DWORD)(VERSIONSTRING " (built " __DATE__ " " __TIME__ ")");

	// set fs_basegame to 'm2demo' (will apply before fs_game, unlike the above line)
	*(DWORD*)0x6431D1 = (DWORD)"m2demo";

	// increase font sizes for chat on higher resolutions
	static float float13 = 13.0f;
	static float float10 = 10.0f;
	*(float**)0x5814AE = &float13;
	*(float**)0x5814C8 = &float10;
	#endif

	#ifndef IW4M_OLD_CODE
	drawDevStuffHook.initialize(drawDevStuffHookLoc, DrawDevStuffHookStub);
	drawDevStuffHook.installHook();

	// createwindowexa on winconsole
	static DWORD wcCWEx = (DWORD)CreateWindowExAWrap_WC;
	static DWORD wcGEx = (DWORD)CreateWindowExAWrap_G;
	*(DWORD**)0x4289CA = &wcCWEx;
	*(DWORD**)0x5076AC = &wcGEx;

	// displayed build tag in UI code
	*(DWORD*)0x43F73B = (DWORD)VERSIONSTRING;

	// console '%s: %s> ' string
	*(DWORD*)0x5A44B4 = (DWORD)("W2 MP> ");

	// console version string
	*(DWORD*)0x4B12BB = (DWORD)(VERSIONSTRING " " BUILDHOST " (built " __DATE__ " " __TIME__ ")");

	// version string
	*(DWORD*)0x60BD56 = (DWORD)(VERSIONSTRING " (built " __DATE__ " " __TIME__ ")");

	// add 'm2demo' game folder
	//customSearchPathHook.initialize(5, (PBYTE)customSearchPathHookLoc);
	//customSearchPathHook.installHook(CustomSearchPathStuff, true, false);

	// set fs_basegame to 'm2demo' (will apply before fs_game, unlike the above line)
	*(DWORD*)0x6431D1 = (DWORD)"GameData/ShipFiles";

	// main to GameData/VendorPaks
	*(DWORD*)0x461A84 = (DWORD)"GameData/VendorPaks";
	*(DWORD*)0x4825A9 = (DWORD)"GameData/VendorPaks";
	*(DWORD*)0x48265A = (DWORD)"GameData/VendorPaks";
	*(DWORD*)0x4290C2 = (DWORD)"GameData/VendorPaks";

	// players -> UserData
	*(DWORD*)0x47DCB6 = (DWORD)"UserData";
	*(DWORD*)0x482410 = (DWORD)"UserData";
	*(DWORD*)0x60B1E2 = (DWORD)"UserData";
	*(DWORD*)0x5AE106 = (DWORD)"UserData";
	*(DWORD*)0x642E8F = (DWORD)"UserData";
	*(DWORD*)0x682F76 = (DWORD)"UserData";

	// devraw -> DevData/devraw, and similar
	*(DWORD*)0x4823D7 = (DWORD)"DevData/devraw";
	*(DWORD*)0x4823C4 = (DWORD)"DevData/devraw_shared";
	*(DWORD*)0x4823EA = (DWORD)"DevData/raw_shared";
	*(DWORD*)0x4823FD = (DWORD)"DevData/raw";

	// video file path
	*(DWORD*)0x51C2A4 = (DWORD)"%s\\GameData\\Videos\\%s.bik";

	// always play the intro video
	nop(0x60BECF, 2);

	*(DWORD*)0x60BED2 = (DWORD)"unskippablecinematic fdoLogo\n";

	// increase font sizes for chat on higher resolutions
	//*(BYTE*)0x5814AA = 0xEB;
	//*(BYTE*)0x5814C4 = 0xEB;
	static float float13 = 10.0f;
	static float float10 = 7.0f;

	*(float**)0x5814AE = &float13;
	*(float**)0x5814C8 = &float10;

	// safe areas; set to 1 (changing the dvar has no effect later on as the ScrPlace viewport is already made)
	static float float1 = 1.0f;
	*(float**)0x42E3A8 = &float1;
	*(float**)0x42E3D9 = &float1;

	// related to above: default cg_debugInfoCornerOffset to 0 0 instead of 0 -30
	static float float0 = 0.0f;

	*(float**)0x4F8FDB = &float0;

	// always assume a localized pak file is english
	*(BYTE*)0x4D11F3 = 0xEB;
	#endif

#ifdef PRE_RELEASE_DEMO
	// disable private parties if demo
	//*(DWORD*)0x40554E = (DWORD)CL_XStartPrivateMatch_f;
	//*(DWORD*)0x5A992E = (DWORD)CL_XStartPrivateMatch_f;
	//*(DWORD*)0x4058B9 = (DWORD)CL_XStartPrivateMatch_f; // xpartygo
	//*(DWORD*)0x4152AA = (DWORD)CL_XStartPrivateMatch_f; // map

	// use M2 playlists
	strcpy((char*)0x6EE7AC, "mp_playlists_m2");
	*(DWORD*)0x4D47FB = (DWORD)"mp_playlists_m2.ff";
#endif
}
Пример #18
0
// patches fs_game/IWD script support
void PatchMW2_Modding()
{
    // remove limit on IWD file loading
    //memset((void*)0x643B94, 0x90, 6);
    *(BYTE*)0x642BF3 = 0xEB;

    // remove convar write protection (why?)
    //*(BYTE*)0x647DD4 = 0xEB;

    // kill most of pure (unneeded in 159, 180+ messed it up)
    //memset((void*)0x45513D, 0x90, 5);
    //memset((void*)0x45515B, 0x90, 5);
    //memset((void*)0x45516C, 0x90, 5);

    //memset((void*)0x45518E, 0x90, 5);
    //memset((void*)0x45519F, 0x90, 5);

    //*(BYTE*)0x449089 = 0xEB;

    // other IWD things (pure?)
    //*(BYTE*)0x4C5E7B = 0xEB;
    //*(BYTE*)0x465107 = 0xEB;

    // default sv_pure to 0
    // TODO: implement client-side downloading/default to 1 for no-mods
    *(BYTE*)0x4D3A74 = 0;

    // disable sv_pure for .iwi/.wav/.mp3-only IWDs (for now we only want to get rid of scripts)
    /*strcpy((char*)0x6F1DBC, ".iwi");
    strcpy((char*)0x6E1B94, ".wav");
    strcpy((char*)0x71325C, ".mp3");*/

    // disable configstring checksum matching (it's unreliable at most)
    //*(BYTE*)0x4A75A7 = 0xEB; // SV_SpawnServer
    //*(BYTE*)0x5AC2CF = 0xEB; // CL_ParseGamestate
    *(BYTE*)0x5AC2C3 = 0xEB; // CL_ParseGamestate

    // steam stuff (steam authentication)
    *(DWORD*)0x414ACC = 0x90909090;
    *(WORD*)0x414AD0 = 0x9090;

    // hopefully allow alt-tab during game, used at least in alt-enter handling
    *(BYTE*)0x45ACE0 = 0xB0;
    *(BYTE*)0x45ACE1 = 0x01;
    *(BYTE*)0x45ACE2 = 0xC3;

    // set cg_scoreboardPingText to 1
    *(BYTE*)0x45888E = 1;

    // disable migration_dvarErrors
    *(BYTE*)0x60BDA7 = 0;

    // allow vid_restart even if 'connected'
    memset((void*)0x4CA1FA, 0x90, 6);

    // remove 'impure stats' checking
    *(BYTE*)0x4BB250 = 0x33;
    *(BYTE*)0x4BB251 = 0xC0;
    *(DWORD*)0x4BB252 = 0xC3909090;

    // remove fs_game profiles
    *(WORD*)0x4A5D74 = 0x9090;

    // fs_game crash fix removing some calls
    // (NOTE: CoD4 comparison shows this is related to LoadObj weaponDefs, might fix the crash we're having)
    *(BYTE*)0x452C1D = 0xEB;

    // remove fs_game check for moddable rawfiles - allows non-fs_game to modify rawfiles
    *(WORD*)0x61AB76 = 0x9090;

    // kill filesystem init default_mp.cfg check -- IW made it useless while moving .cfg files to fastfiles
    // and it makes fs_game crash

    // not nopping everything at once, there's cdecl stack cleanup in there
    memset((void*)0x461A9E, 0x90, 5);
    memset((void*)0x461AAA, 0x90, 5);
    memset((void*)0x461AB2, 0x90, 0xB1);

    // for some reason fs_game != '' makes the game load mp_defaultweapon, which does not exist in MW2 anymore as a real asset
    // kill the call and make it act like fs_game == ''
    // UPDATE 2010-09-12: this is why CoD4 had text weapon files, those are used with fs_game.
    // CLARIFY 2010-09-27: we don't have textual weapon files, as such we should load them from fastfile as usual
    // TODO: change this into a delay-loading hook for fastfile/loadobj (2011-05-20)
    *(BYTE*)0x4081FD = 0xEB;

    // exec fixing
    execIsFSHook.initialize(execIsFSHookLoc, ExecIsFSHookStub);
    execIsFSHook.installHook();

    // exec whitelist removal (YAYFINITY WARD)
    memset((void*)0x609685, 0x90, 5);
    *(WORD*)0x60968C = 0x9090;

    if (GAME_FLAG(GAME_FLAG_OFFLINE) || weWantOffline)
    {
        // allow joining 'developer 1' servers
        *(BYTE*)0x478BA2 = 0xEB;
    }

    PatchMW2_FFHash();
}
void PatchSP()
{
        // cg_fov unprotect
        *(DWORD*)0x4A3921 = DVAR_ARCHIVE;

        // small fix for infinite waiting for other players
        *(BYTE*)0x5026BC = 0x0;
        
        // function changes
        Com_Error = (Com_Error_t)0x651D90;
		Com_Printf = (Com_Printf_t)0x43BF30;

        // disable bandwidth testing / better match finding
        *(WORD*)0x693842 = 0x9090;
		
		// enable console (normally this check is !monkeytoy || blah; now it's only 'blah'
        *(BYTE*)0x58761C = 0xEB;

        // console toggling
        toggleConsoleHook1.initialize("", (PBYTE)toggleConsoleHook1Loc);
        toggleConsoleHook1.installHook((void(*)())Con_ToggleConsole, false);

        toggleConsoleHook2.initialize("", (PBYTE)toggleConsoleHook2Loc);
        toggleConsoleHook2.installHook((void(*)())Con_ToggleConsole, false);

        // player_sustainAmmo re-adding
        sustainAmmoHook.initialize("", 7, (PBYTE)sustainAmmoHookLoc);
        sustainAmmoHook.installHook(SustainAmmoHookFunc, true, false);
        
        // cg_drawVersion
        *(BYTE*)0x4A3D46 = 1; // default
        *(BYTE*)0x4A3D44 = 0x50; // flags
		
        // y 450, x 10
        *(DWORD*)0x4A3D7A = (DWORD)&drawVersionX;
        *(DWORD*)0x4A3DAF = (DWORD)&drawVersionY;

        *(DWORD*)0x9A33FC = (DWORD)customTimeBeginPeriod;

        // set port to 28960
        *(DWORD*)0x52E1D5 = 28960;

        // disable UPnP
        //*(WORD*)0x973C6B = 0x9090;

        // remove the windows hook setting function
        //*(BYTE*)0x8683D0 = 0xC3;

        // con stuff
        *(WORD*)0x79E6E5 = 0x9090; // dvar set 1

        *(BYTE*)0x5119B0 = 0xC3;   // dvar reset flag
        *(WORD*)0x4A87EB = 0x9090; // dvar exec
        *(WORD*)0x829CBE = 0x9090; // cmd  exec
        *(WORD*)0x5F5D4E = 0x9090; // dvar enum
        *(WORD*)0x610A94 = 0x9090; // cmd  enum

        windowedWindowStyleHook.initialize("aaaaa", 5, (PBYTE)windowedWindowStyleHookLoc);
        windowedWindowStyleHook.installHook(WindowedWindowStyleHookStub, false, false);

        // gethostbyname
        *(DWORD*)0x9A3470 = (DWORD)custom_gethostbyname;

        // small fix for infinite waiting for other players
        *(BYTE*)0x5026BC = 0x03;
}