[FIX / PATCH] Windows 2000 NTVDM Crash on non-VME CPUs (Intel 486 / VIA C3) - 1-Byte Hex Patch for Official Final NTVDM.EXE (5.0.2195.7061)
Body:
Hi everyone,
I have found a definitive 1-byte Hex patch to fix the infamous NTVDM crash on non-VME CPUs (such as early Intel 486, VIA C3 Samuel/Samuel2, etc.) under Windows 2000 SP4.
While there are some ancient workarounds or Source-level rebuilds (like NTVDMx64) floating around, there was no documented pinpoint Hex patch for the official final version of NTVDM.EXE (5.0.2195.7061). Now, the puzzle is solved.
♂ The Root Cause: Compiler Optimization Bug (Instruction Scheduling)
By reverse-engineering NTVDM.EXE and cross-referencing with the leaked NT source code, the crash happens in the function that handles NtVdmControl with ControlCode 4 (VdmFeatures).
The compiler's instruction scheduling optimization aggressively reordered mov instructions to initialize VME-specific register states (such as ExpVdmTib and EFLAGS 202h setup) BEFORE the NtVdmControl call actually checks if the CPU supports VME. On a non-VME CPU, this premature initialization instantly triggers an invalid opcode or privileged instruction exception, crashing NTVDM before it even knows the CPU capabilities.
Body:
Hi everyone,
I have found a definitive 1-byte Hex patch to fix the infamous NTVDM crash on non-VME CPUs (such as early Intel 486, VIA C3 Samuel/Samuel2, etc.) under Windows 2000 SP4.
While there are some ancient workarounds or Source-level rebuilds (like NTVDMx64) floating around, there was no documented pinpoint Hex patch for the official final version of NTVDM.EXE (5.0.2195.7061). Now, the puzzle is solved.
♂ The Root Cause: Compiler Optimization Bug (Instruction Scheduling)
By reverse-engineering NTVDM.EXE and cross-referencing with the leaked NT source code, the crash happens in the function that handles NtVdmControl with ControlCode 4 (VdmFeatures).
The compiler's instruction scheduling optimization aggressively reordered mov instructions to initialize VME-specific register states (such as ExpVdmTib and EFLAGS 202h setup) BEFORE the NtVdmControl call actually checks if the CPU supports VME. On a non-VME CPU, this premature initialization instantly triggers an invalid opcode or privileged instruction exception, crashing NTVDM before it even knows the CPU capabilities.