#461 magic breakpoint instruction reassign ability

open
nobody
Debugger (43)
5
2012-10-15
2012-04-26
Anonymous
No

hi. today i've discovered that windows 7 boot loader uses 'xchg bx, bx' in loop and it's hard to load windows with magic breakpoint enabled without patching bootloader with 'xchg bx, bx' => nop substitution. maybe it will be good to have config option, to specify REGister for xchg's magic breakpoint - xchg REG, REG.

Discussion

  • Stanislav Shwartsman

    I could give you a patch to implement this.

    In the cpu/data_xfer16.cc search for xchg function with magic breakpoint code.

    if BX_DEBUGGER

    // Note for mortals: the instruction to trigger this is "xchgw %bx,%bx"
    if (bx_dbg.magic_break_enabled && (i->nnn() == 3) && (i->rm() == 3))
    {
    BX_CPU_THIS_PTR magic_break = 1;
    BX_NEXT_INSTR(i);
    }

    endif

    Change '== 3' to any other register you like.

    Stanislav

     
  • Comment has been marked as spam. 
    Undo

    You can see all pending comments posted by this user  here

    Anonymous - 2012-04-28

    thanks for your answer, i've already done this. it will be good to have config option such as magic_breakpoint_xchg_register=dx, for example, to specify xchg dx, dx as magic breakpoint instruction (currently i'm using dx register). seems that microsoft have used bochs to debug their boot loader.

     

Log in to post a comment.