发明名称 Runtime patching of native-code programs
摘要 During execution of a program, a code patching component may insert a redirection patch into a native-code representation of the program. The code patching component may identify a patch area in the native-code representation, copy existing code from the patch area to another location for subsequent emulation by a trap handler, determine the number of instructions and type of native-code elements within the patch area, and replace native-code elements in the patch area with native-code elements representing a jump type instruction and a target address argument for the jump type instruction (directly or indirectly indicating the location of new code that replaces the code in the patch area). The target address argument may be determined by the code patching component based on the program's characteristics, and may include a collection of elements representing existing code, trap type instructions, NOP type instructions, or arbitrary values.
申请公布号 US9164754(B1) 申请公布日期 2015.10.20
申请号 US201314133515 申请日期 2013.12.18
申请人 Amazon Technologies, Inc. 发明人 Pohlack Martin Thomas
分类号 G06F9/44;G06F9/445 主分类号 G06F9/44
代理机构 Meyertons, Hood, Kivlin, Kowert & Goetzel, P.C. 代理人 Kowert Robert C.;Meyertons, Hood, Kivlin, Kowert & Goetzel, P.C.
主权项 1. A method, comprising: performing, by one or more computers: during execution of an existing binary code representation of a software program located in a memory: identifying a patch area in the existing binary code representation, wherein the patch area comprises a portion of the existing binary code representation that is to be replaced in the memory with a binary code representation of a redirection patch, and wherein a redirection patch is a patch that comprises a jump type instruction and a target address argument for the jump type instruction;copying the portion of the existing binary code representation in the patch area from its location in the memory to another location in the memory, wherein the copy of the portion of the existing binary code representation in the other location in the memory is executable by a trap handler;determining the target address argument for the jump type instruction that is to be included in the redirection patch, wherein said determining is dependent, at least in part, on one or more characteristics of the existing binary code representation of the software program; andinserting the binary code representation of the redirection patch comprising the jump type instruction and the determined target address argument for the jump type instruction in the location of the patch area in the memory.
地址 Reno NV US