摘要 |
A first section of executable computer code of a computer program is dynamically patched by performing the following. A breakpoint is inserted at the first section of executable computer code. During execution of the computer program, an instruction counter is incremented on an instruction-by-instruction basis through the computer program. The instruction counter indicates a current instruction of the computer program being executed. The breakpoint where the instruction counter points to the first section of executable computer code is encountered, which results in a breakpoint handler being called. The breakpoint handler changes the instruction pointer to instead point to a second section of executable computer code. The second section of executable computer code is a patched version of the first section of executable computer code. Upon the breakpoint handler returning, the second section of executable computer code is executed in lieu of the first section of executable computer code.
|