[NTVDM]: Use the 0xCC (int 3) instruction as the memory fill byte.
authorHermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
Sun, 28 Sep 2014 22:35:05 +0000 (22:35 +0000)
committerHermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
Sun, 28 Sep 2014 22:35:05 +0000 (22:35 +0000)
svn path=/trunk/; revision=64383

reactos/subsystems/ntvdm/emulator.c

index 18121b0..06d1e23 100644 (file)
@@ -549,8 +549,12 @@ BOOLEAN EmulatorInitialize(HANDLE ConsoleInput, HANDLE ConsoleOutput)
         wprintf(L"FATAL: Failed to allocate VDM memory.\n");
         return FALSE;
     }
-    // For diagnostics purposes!!
-    RtlFillMemory(BaseAddress, MAX_ADDRESS, 0xFF);
+    /*
+     * For diagnostics purposes, we fill the memory with INT 0x03 codes
+     * so that if a program wants to execute random code in memory, we can
+     * retrieve the exact CS:IP where the problem happens.
+     */
+    RtlFillMemory(BaseAddress, MAX_ADDRESS, 0xCC);
 
     /* Initialize I/O ports */
     /* Initialize RAM */