Skip to content

Make bpgoto and NOP breakpoint MT-safe#63

Open
torusrxxx wants to merge 1 commit intovs2015from
MTSafeNOPBP
Open

Make bpgoto and NOP breakpoint MT-safe#63
torusrxxx wants to merge 1 commit intovs2015from
MTSafeNOPBP

Conversation

@torusrxxx
Copy link
Member

This change makes the bpgoto (change EIP to a new location every time the breakpoint is hit) and the NOP breakpoint (breakpoint on the 0x90 NOP instruction) thread-safe. It restores the original breakpoint bytes after the callback is executed. Then it only restores the original breakpoint bytes if the breakpointed instruction must be executed and it is not a NOP instruction.

The user can create a thread-safe breakpoint at any location by copying the breakpointed instruction to a shell code space, put a bpgoto breakpoint on the original location so that it will jump to our shell code with a NOP instruction. Then put a breakpoint on the NOP instruction in our shell code. The shell code consists of a NOP instruction, the original breakpointed instruction and a JMP instruction.

@torusrxxx
Copy link
Member Author

When the target instruction of bpgoto overlaps the breakpoint, there could be wrong behaviour. To fix it we need a disassembler to determine if the target instruction could overlap the breakpoint.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant