Runtime code hooking for print driver and functionality testing
First Claim
Patent Images
1. A method comprising:
- locating a target function to modify on a computing device, the target function compiled to include a place holder instruction added as a non-operative entry point in the target function to enable hooking a hook function to the target function;
identifying the hook function to execute when a call is made to the target function the hook function being configured to test printer functionality provided at least in part through a print subsystem of the computing device by at least determining which printer handles are being used by the print subsystem, how long the print handles have been in use, and whether handle leaks related to the target function are suspected; and
overwriting the place holder instruction of the target function with instruction to cause execution of the hook function, the place holder instruction being overwritten without preserving and without copying the place holder instruction of the target function.
2 Assignments
0 Petitions
Accused Products
Abstract
Runtime code hooking techniques are described in which a place holder instruction within a compiled module is used as an entry point to enable code hooking. A hook function to modify a target function is developed. At runtime, the target function to be modified is located. A place holder instruction within the target function is overwritten with instructions to cause execution of the hook function when the target function is called.
-
Citations
20 Claims
-
1. A method comprising:
-
locating a target function to modify on a computing device, the target function compiled to include a place holder instruction added as a non-operative entry point in the target function to enable hooking a hook function to the target function; identifying the hook function to execute when a call is made to the target function the hook function being configured to test printer functionality provided at least in part through a print subsystem of the computing device by at least determining which printer handles are being used by the print subsystem, how long the print handles have been in use, and whether handle leaks related to the target function are suspected; and overwriting the place holder instruction of the target function with instruction to cause execution of the hook function, the place holder instruction being overwritten without preserving and without copying the place holder instruction of the target function. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9)
-
-
10. One or more computer-readable memory devices comprising instructions that are stored thereon and are executable to:
-
call one or more application programming interfaces (APIs) of an operating system of a computing device to receive a memory location of a target function to be modified on the computing device, the target function compiled to include a place holder instruction introduced into the target function as a non-operative instruction to enable hooking of a hook function to the target function, the hook function being configured to track handle leaks related to the target function by at least determining which handles are being used by the computing device, how long the handles have been in use, and whether handle leaking is suspected; and overwrite the place holder instruction of the target function with a jump instruction to cause execution of the hook function, the place holder instruction overwritten without preserving and without copying the place holder instruction of the target function. - View Dependent Claims (11, 12, 13, 14)
-
-
15. A computing device comprising:
-
a processor; memory storing; an operating system having a print subsystem; a hook function configured to modify printing functionality provided at least in part through the print subsystem; and one or more modules stored in the memory and executable via the processor to; receive information to identify the hook function and a target function to modify on the computing device with the hook function, the target function compiled to include a place holder instruction added as an entry point to the target function and configured to be overwritten to enable the modification, the hook function configured to determine which handles are being used by the print subsystem, how long the handles have been in use, and whether handle leaking is suspected; at runtime, call one or more application programming interfaces (APIs) of the operating system to; locate the target function; and overwrite the place holder instruction of the target function with instructions to cause execution of the hook function when the target function is called, the place holder overwritten without preserving and without maintaining a copy of the place holder instruction of the target function. - View Dependent Claims (16, 17, 18, 19, 20)
-
Specification