Patches script space limits, should be executed when limits are set.
| 78 | |
| 79 | // Patches script space limits, should be executed when limits are set. |
| 80 | void SCMlimits::PatchScriptLimits() |
| 81 | { |
| 82 | if (SCMlimits::iMAINsegmentSize == 200000 |
| 83 | && SCMlimits::iMissionSize == 69000) |
| 84 | return; |
| 85 | |
| 86 | |
| 87 | // See if sizes are multiplies of 4 |
| 88 | if (SCMlimits::iMAINsegmentSize % 4 != 0 || SCMlimits::iMissionSize % 4 != 0) |
| 89 | { |
| 90 | /*printf_MessageBox( |
| 91 | "'Max size of MAIN segment' and 'Max mission size' have to be multiplies of 4\n" |
| 92 | "Given values:\n" |
| 93 | "SCMlimits::iMAINsegmentSize = %d\n" |
| 94 | "SCMlimits::iMissionSize = %d", |
| 95 | |
| 96 | SCMlimits::iMAINsegmentSize, |
| 97 | SCMlimits::iMissionSize |
| 98 | |
| 99 | );*/ |
| 100 | |
| 101 | return; |
| 102 | } |
| 103 | |
| 104 | unsigned int ScriptSpaceSize = SCMlimits::GetScriptSpaceSize(); |
| 105 | |
| 106 | if (ScriptSpaceSize > 269000) |
| 107 | SCMlimits::CTheScripts__ScriptSpace = new unsigned __int8[ScriptSpaceSize]; |
| 108 | |
| 109 | // Patch references to CTheScripts::ScriptSpace |
| 110 | #if TRUE |
| 111 | { |
| 112 | CPatch::PatchPointer(0x44CA42 + 2, CTheScripts__ScriptSpace); // mov edx, dword ptr ds:_ZN11CTheScripts11ScriptSpaceE[eax]; CTheScripts::ScriptSpace |
| 113 | CPatch::PatchPointer(0x44CA92 + 2, CTheScripts__ScriptSpace); // mov eax, dword ptr ds:_ZN11CTheScripts11ScriptSpaceE[eax]; CTheScripts::ScriptSpace |
| 114 | CPatch::PatchPointer(0x44CAB1 + 2, CTheScripts__ScriptSpace); // mov esi, dword ptr ds:_ZN11CTheScripts11ScriptSpaceE[esi]; CTheScripts::ScriptSpace |
| 115 | CPatch::PatchPointer(0x44CB36 + 2, CTheScripts__ScriptSpace); // mov ecx, dword ptr ds:_ZN11CTheScripts11ScriptSpaceE[edi]; CTheScripts::ScriptSpace |
| 116 | CPatch::PatchPointer(0x44CB58 + 2, CTheScripts__ScriptSpace); // mov dword ptr ds:_ZN11CTheScripts11ScriptSpaceE[edi], ecx; CTheScripts::ScriptSpace |
| 117 | CPatch::PatchPointer(0x44CB60 + 2, CTheScripts__ScriptSpace); // mov ecx, dword ptr ds:_ZN11CTheScripts11ScriptSpaceE[eax]; CTheScripts::ScriptSpace |
| 118 | CPatch::PatchPointer(0x44CB6B + 2, CTheScripts__ScriptSpace); // mov dword ptr ds:_ZN11CTheScripts11ScriptSpaceE[eax], 0; CTheScripts::ScriptSpace |
| 119 | CPatch::PatchPointer(0x44CBAD + 2, CTheScripts__ScriptSpace); // mov dword ptr ds:_ZN11CTheScripts11ScriptSpaceE[edi], ecx; CTheScripts::ScriptSpace |
| 120 | CPatch::PatchPointer(0x463DAD + 1, CTheScripts__ScriptSpace); // add eax, offset _ZN11CTheScripts11ScriptSpaceE; CTheScripts::ScriptSpace |
| 121 | CPatch::PatchPointer(0x463E00 + 3, CTheScripts__ScriptSpace); // lea eax, _ZN11CTheScripts11ScriptSpaceE[ecx+edx*8]; CTheScripts::ScriptSpace |
| 122 | CPatch::PatchPointer(0x463E38 + 3, CTheScripts__ScriptSpace); // lea edx, _ZN11CTheScripts11ScriptSpaceE[eax+ecx]; CTheScripts::ScriptSpace |
| 123 | CPatch::PatchPointer(0x463E51 + 3, CTheScripts__ScriptSpace); // lea eax, _ZN11CTheScripts11ScriptSpaceE[ecx+edx]; CTheScripts::ScriptSpace |
| 124 | CPatch::PatchPointer(0x463FC7 + 2, CTheScripts__ScriptSpace); // add ecx, offset _ZN11CTheScripts11ScriptSpaceE; CTheScripts::ScriptSpace |
| 125 | CPatch::PatchPointer(0x463FE9 + 1, CTheScripts__ScriptSpace); // add eax, offset _ZN11CTheScripts11ScriptSpaceE; CTheScripts::ScriptSpace |
| 126 | CPatch::PatchPointer(0x4640DE + 2, CTheScripts__ScriptSpace); // mov edx, dword ptr ds:_ZN11CTheScripts11ScriptSpaceE[eax]; CTheScripts::ScriptSpace |
| 127 | CPatch::PatchPointer(0x464159 + 2, CTheScripts__ScriptSpace); // mov edx, dword ptr ds:_ZN11CTheScripts11ScriptSpaceE[edx]; CTheScripts::ScriptSpace |
| 128 | CPatch::PatchPointer(0x464165 + 3, CTheScripts__ScriptSpace); // mov edx, dword ptr ds:_ZN11CTheScripts11ScriptSpaceE[eax+edx*4]; CTheScripts::ScriptSpace |
| 129 | CPatch::PatchPointer(0x464191 + 3, CTheScripts__ScriptSpace); // mov edx, dword ptr ds:_ZN11CTheScripts11ScriptSpaceE[eax+edx*4]; CTheScripts::ScriptSpace |
| 130 | CPatch::PatchPointer(0x4641BA + 2, CTheScripts__ScriptSpace); // mov edx, dword ptr ds:_ZN11CTheScripts11ScriptSpaceE[edx]; CTheScripts::ScriptSpace |
| 131 | CPatch::PatchPointer(0x46429A + 2, CTheScripts__ScriptSpace); // mov eax, dword ptr ds:_ZN11CTheScripts11ScriptSpaceE[eax]; CTheScripts::ScriptSpace |
| 132 | CPatch::PatchPointer(0x464310 + 3, CTheScripts__ScriptSpace); // mov eax, dword ptr ds:_ZN11CTheScripts11ScriptSpaceE[eax+edx*4]; CTheScripts::ScriptSpace |
| 133 | CPatch::PatchPointer(0x4643C0 + 2, CTheScripts__ScriptSpace); // mov dword ptr ds:_ZN11CTheScripts11ScriptSpaceE[eax], edx; CTheScripts::ScriptSpace |
| 134 | CPatch::PatchPointer(0x464412 + 2, CTheScripts__ScriptSpace); // mov edx, dword ptr ds:_ZN11CTheScripts11ScriptSpaceE[edx]; CTheScripts::ScriptSpace |
| 135 | CPatch::PatchPointer(0x464420 + 3, CTheScripts__ScriptSpace); // mov dword ptr ds:_ZN11CTheScripts11ScriptSpaceE[eax+edx*4], esi; CTheScripts::ScriptSpace |
| 136 | CPatch::PatchPointer(0x46444C + 3, CTheScripts__ScriptSpace); // mov dword ptr ds:_ZN11CTheScripts11ScriptSpaceE[eax+edx*4], esi; CTheScripts::ScriptSpace |
| 137 | CPatch::PatchPointer(0x464473 + 2, CTheScripts__ScriptSpace); // mov edx, dword ptr ds:_ZN11CTheScripts11ScriptSpaceE[edx]; CTheScripts::ScriptSpace |
nothing calls this directly
no outgoing calls
no test coverage detected