Patent ID: 7716686

Claim:
A hooking method, comprising: inserting a holding instruction into interface code that has not yet been hooked by utilizing a processor; and after inserting the holding instruction, completing the hooking of an interface; wherein the holding instruction holds operation of the interface such that there is a delay before the hooking of the interface is completed; wherein the holding instruction holds any execution that arrives at the holding instruction for allowing the hooking of the interface to be completed without disruption; wherein the holding instruction is inserted after a yield operation for allowing modified code which has already started execution to complete, such that disruption of the modified code in a form of a race condition where interference between a thread associated with the hooking of the interface and the modified code is avoided; wherein after the yield operation, the completion of the hooking is concluded by replacing the holding instruction with a second portion of hook code, the second portion of hook code inserted after a first portion of hook code to constitute an entirety of hook code to be inserted; and wherein the holding instruction includes a relative jump instruction that operates to jump to a location of a jump instruction.