Patent ID: 9465717
Filing Date: 2016-10-11
CPC Classification: G06F

Claim Text:
1. A method for hooking machine code, comprising: receiving, at a server, from an adapter module identifying information for a target function of a target application to hook; pausing, by the server, the target application; locating, by the server, the target function in the target application based on the identifying information; hooking, by the server, the target function outside the target application to create hooked code, wherein said hooking comprises: determining whether the target application was designed for a first architecture type or a second architecture type, determining, in response to the target application being designed for the second architecture type, whether a distance between a location of the target function and a location of the hooked code is greater than a pre-set address offset, overlaying an instruction set having a first size to jump to a first new code location in response to the target application being designed for the first architecture type or in response to determining that the distance is less than the pre-set offset, and overlaying an instruction set having a second size to jump to a second new code location in response to determining that the distance is greater than the pre-set offset, wherein the second size is larger than the first size; and maintaining, by the server, a tracking table for tracking hook points, wherein the hook points correspond to locations where one or more target functions are hooked.