CVideoMode_Common__CreateGameWindow.Offset(0x2C).Patch({0xE9,0x9A,0x00,0x00,0x00});// PUS --> XOR | Prevent ShowWindow and CreateGameWindow from being initialized (STGS RPak datatype is registered here).
CMaterialSystem__Init.Offset(0x406).Patch({0xE9,0x55,0x05,0x00,0x00});// MOV --> JMP | Jump over material KeyValue definitions and 'CMatRenderContextBase::sm_RenderData([x])'.
InitMaterialSystem.Offset(0x7D).Patch({0xC3});// JMP --> RET | Return early to prevent 'InitDebugMaterials' from being executed. // RESEARCH NEEDED.
// Note: The registers here seems to contains pointers to material data and 'CMaterial' class methods when the shader system is initialized.
CStudioRenderContext__LoadModel.Offset(0x17D).Patch({0x90,0x90,0x90,0x90});// MOV --> NOP | RAX + RCX are both nullptrs.
CStudioRenderContext__LoadModel.Offset(0x181).Patch({0x90,0x90,0x90});// MOV --> NOP | RCX is nullptr when trying to dereference.
CStudioRenderContext__LoadModel.Offset(0x184).Patch({0x90,0x90,0x90,0x90,0x90,0x90});// CAL --> NOP | RAX is nullptr during virtual call resulting in exception 'C0000005'.
CStudioRenderContext__LoadMaterials.Offset(0x28).Patch({0xE9,0x80,0x04,0x00,0x00});// FUN --> RET | 'CStudioRenderContext::LoadMaterials' is called virtually by the 'RMDL' streaming job.
CModelLoader__LoadModel.Offset(0x462).Patch({0x90,0x90,0x90,0x90,0x90});// CAL --> NOP | Prevent call to 'CStudioRenderContext::LoadMaterials'.
CModelLoader__Studio_LoadModel.Offset(0x325).Patch({0x90,0x90,0x90,0x90,0x90,0x90});// CAL --> NOP | Virtual call to 'CMaterialSystem::FindMaterialEx' fails as RAX is nullptr.
CModelLoader__Studio_LoadModel.Offset(0x33D).Patch({0x90,0x90,0x90,0x90,0x90,0x90});// CAL --> NOP | Virtual call to 'CMaterialGlue' class method fails as RAX is nullptr.
CModelLoader__Studio_LoadModel.Offset(0x359).Patch({0x90,0x90,0x90,0x90,0x90,0x90});// CAL --> NOP | Virtual call to 'CMaterialGlue' class method fails as RAX is nullptr.
CModelLoader__Studio_LoadModel.Offset(0x374).Patch({0x90,0x90,0x90,0x90,0x90,0x90});// CAL --> NOP | Virtual call to 'CMaterialGlue' class method fails as RAX is nullptr.
CModelLoader__Studio_LoadModel.Offset(0x38D).Patch({0x90,0x90,0x90,0x90,0x90,0x90});// CAL --> NOP | Virtual call to 'ReturnZero' fails as RAX is nullptr.
CModelLoader__Studio_LoadModel.Offset(0x3A4).Patch({0x90,0x90,0x90,0x90,0x90,0x90});// CAL --> NOP | Virtual call to 'CMaterialGlue' class method fails as RAX is nullptr.
gHost_Init_0.Offset(0xC2).Patch({0xEB,0x34});// CAL --> NOP | Disable 'vpk/client_common.bsp' loading.
gHost_Init_0.Offset(0x182).Patch({0x90,0x90,0x90,0x90,0x90});// CAL --> JMP | Disable UI material asset initialization.
gHost_Init_0.Offset(0x859).Patch({0xE9,0x19,0x04,0x00,0x00});// LEA --> RET | Disable 'client.dll' library initialization.
gHost_Init_0.Offset(0xC77).Patch({0xE8,0x44,0xCF,0xFF,0xFF});// CAL --> CAL | Disable user config loading and call entitlements.rson initialization instead.
gHost_Init_1.Offset(0x609).Patch({0xEB,0x2B});// JE --> JMP | Skip client.dll Init_PostVideo() validation code.
gHost_Init_1.Offset(0x621).Patch({0xEB,0x0C});// JNE --> JMP | Skip client.dll Init_PostVideo() validation code.
gHost_Init_1.Offset(0x658).Patch({0xE9,0x8C,0x00,0x00,0x00});// JE --> JMP | Skip NULL call as client is never initialized.
gHost_Init_1.Offset(0x6E9).Patch({0xE9,0xB0,0x00,0x00,0x00});// JNE --> JMP | Skip shader preloading as cvar can't be checked due to client being NULL.
p_EbisuSDK_SetState.Offset(0x0).FindPatternSelf("0F 84",ADDRESS::Direction::DOWN).Patch({0x0F,0x85});// JE --> JNZ | Prevent EbisuSDK from initializing on the engine and server.
FairFight_Init.Offset(0x0).FindPatternSelf("0F 87",ADDRESS::Direction::DOWN,200).Patch({0x0F,0x85});// JA --> JNZ | Prevent 'FairFight' anti-cheat from initializing on the server by comparing RAX against 0x0 instead. Init will crash since the plugins aren't shipped.
CollisionBSPData_LinkPhysics.Offset(0x129).Patch({0x90,0x90,0x90});// MOV --> NOP | RCX is nullptr during dereference since shadersystem isn't initialized. Exception 'C0000005'.
CollisionBSPData_LinkPhysics.Offset(0x12C).Patch({0x90,0x90,0x90});// CAL --> NOP | Virtual call to 'CTexture' class member in RAX + 0x78 fails. Previous instruction could not dereference.
// Note: At [14028F3B0 + 0x5C7] RSP seems to contain a block of pointers to data for the static prop rmdl in question. [RSP + 0x70] is a pointer to (what seems to be) shader/material data. The pointer will be NULL without a shader system.
p_CalcPropStaticFrustumCulling.Offset(0x5E0).Patch({0x90,0x90,0x90,0x90,0x90});// MOV --> NOP | RSP + 0x70 is a nullptr which gets moved to R13, R13 gets used here resulting in exception 'C0000005'.
p_CalcPropStaticFrustumCulling.Offset(0x5EB).Patch({0x90,0x90,0x90,0x90,0x90,0x90});// CAL --> NOP | RAX is nullptr during virtual call resulting in exception 'C0000005'.
p_WASAPI_GetAudioDevice.Offset(0x410).FindPattern("FF 15 ?? ?? 01 00",ADDRESS::Direction::DOWN,100).Patch({0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0xEB});// CAL --> NOP | Disable debugger check when miles searches for audio device to allow attaching the debugger to the game upon launch.
FairFight_Init.Offset(0x0).FindPatternSelf("0F 87",ADDRESS::Direction::DOWN,200).Patch({0x0F,0x85});// JA --> JNZ | Prevent 'FairFight' anti-cheat from initializing on the server by comparing RAX against 0x0 instead. Init will crash since the plugins aren't shipped.
SCR_BeginLoadingPlaque.Offset(0x1AD).FindPatternSelf("75 27",ADDRESS::Direction::DOWN).Patch({0xEB,0x27});// JNE --> JMP | Prevent connect command from crashing by invalid call to UI function.