How to disable a programmatical breakpoint / assert?

后端 未结 2 972
臣服心动
臣服心动 2020-12-23 15:03

I am using Visual Studio, developing a native application, I have a programmatical breakpoint (assert) in my code placed using __asm int 3 or __debugbreak. Sometimes when I

2条回答
  •  孤独总比滥情好
    2020-12-23 15:42

    x86 / x64

    Assuming you are writing x86/x64 application, write following in your watch window:

    x86: *(char *)eip,x

    x64: *(char *)rip,x

    You should see a value 0xcc, which is opcode for INT 3. Replace it with 0x90, which is opcode for NOP. You can also use the memory window with eip as an address.

    PPC

    Assuming you are writing PPC application (e.g. Xbox 360), write following in your watch window:

    *(int *)iar,x

    You should see a value 0xfeNNNNNN, which is opcode for trap (most often 0x0fe00016 = unconditional trap). Replace it with 0x60000000, which is opcode for NOP.

提交回复
热议问题