debuggingvisual-studio-2017

How do I change memory bytes in Visual Studio 2017?


I am trying to change bytes in memory, in a memory window, when debugging a C++ project in my Visual Studio 2017. The memory window is pointing at memory holding code, as I am trying to patch a piece of code quickly (just need to change parameter value) without needing to stop and re-compile. I also noticed that you cannot change values in the memory window even for data memory. Is there some hidden configuration setting to let you do that. It was possible to do this in VS6.


Solution

  • In the immediate window you can evaluate this to change the memory:

    *((int*)0x00111111)=0x00000022  
    // this writes 0x00000022 at memory 0x00111111