发明名称 Method for altering execution of a program, debugger, and computer-readable medium
摘要 A method for altering execution of a program on a computer. The program resides in a memory unit that has a logical address space assigned thereto. The method comprises: operating the computer to start executing the program; operating the computer to suspend execution of the program; selecting a patch insertion address within a logical address range of the program, saving the original code residing at the patch insertion address; generating a patch routine; writing a jump instruction to the patch insertion address, thus overwriting said original code, wherein the jump instruction is arranged to instruct the computer to jump to a start address of the patch routine; and operating the computer to resume execution of the program. The patch routine is arranged to prompt the computer to: save a current context of the program; execute a user code; restore the saved context of the program; and execute a surrogate code.
申请公布号 US9639343(B2) 申请公布日期 2017.05.02
申请号 US201414528451 申请日期 2014.10.30
申请人 NXP USA, INC. 发明人 Nistor Mihail-Marian;Madan Teodor;Miloiu Dragos
分类号 G06F9/45;G06F9/445;G06F9/48;G06F11/36;G06F9/44 主分类号 G06F9/45
代理机构 代理人
主权项 1. A method for altering execution of a program on a computer, wherein the program resides in a memory unit that has a logical address space assigned to it, and wherein the method comprises: operating the computer to start executing the program; operating the computer to suspend execution of the program; selecting a patch insertion address within a logical address range of the program, saving original code residing at the patch insertion address; generating a patch routine comprising user-defined code for modifying a function of the program; writing a jump instruction to the patch insertion address, thus overwriting said original code, wherein the jump instruction is arranged to instruct the computer to jump to a start address of the patch routine; compiling only the patch routine without recompiling the entire program; and operating the computer to resume execution of the program; wherein the patch routine is arranged to prompt the computer to: save a current context of the program; execute the user-defined code; restore the saved current context of the program; and execute a surrogate code which is equivalent to said original code, and wherein the patch insertion address is selected such that said action of operating the computer to resume execution of the program prompts the computer to reach the patch insertion address and, accordingly, to execute the patch routine.
地址 Austin TX US