Runtime code hooking for print driver and functionality testing
First Claim
Patent Images
1. A method comprising:
- testing a device driver of an operating system, the testing comprising;
calling an application programming interface exposed by the operating system to determine a location of a target function of the device driver to modify on a computing device, the device driver compiled to inject place holder instructions as non-operative entry points into each function of the device driver including the target function;
responsive to the calling, obtaining location information for the target function via the application programming interface;
identifying a hook function within a code library to execute instead of the target function when a call is made to the target function, the hook function configured to test capabilities of the device driver and at least identify incompatible communication formats between the operating system and the device driver; and
overwriting a place holder instruction injected into the target function with a jump instruction to cause execution of the hook function.
3 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.
34 Citations
20 Claims
-
1. A method comprising:
testing a device driver of an operating system, the testing comprising; calling an application programming interface exposed by the operating system to determine a location of a target function of the device driver to modify on a computing device, the device driver compiled to inject place holder instructions as non-operative entry points into each function of the device driver including the target function; responsive to the calling, obtaining location information for the target function via the application programming interface; identifying a hook function within a code library to execute instead of the target function when a call is made to the target function, the hook function configured to test capabilities of the device driver and at least identify incompatible communication formats between the operating system and the device driver; and overwriting a place holder instruction injected into the target function with a jump instruction to cause execution of the hook function. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9)
-
10. A method implemented by a computing device for testing a device driver of an operating system, the method comprising:
-
determining, based on a call to an application programming interface exposed by the operating system of the computing device, a location of a target function of the device driver to be modified on the computing device, the device driver including place holder instructions injected as non-operative entry points into each function of the device driver including the target function and gaps maintained between functions in code for the device driver; overwriting a place holder instruction of the target function with a jump instruction to jump to one of said gaps to initiate execution of a hook function instead of the target function when the target function is called, the hook function configured to at least identify incompatible communication formats between the operating system and the device driver; and inserting instructions in the one of said gaps sufficient to cause execution of the hook function responsive to execution of the jump instruction to jump to the one of said gaps. - View Dependent Claims (11, 12, 13, 14, 15)
-
-
16. A system comprising:
-
one or more device drivers; one or more processing devices; and memory storing; target code; a hook function configured to modify functionality provided by a target function of the target code to enable testing of driver capabilities including at least testing a device driver of the one or more device drivers for incompatible communication formats; and one or more modules stored in the memory and executable via the one or more processing devices to test the device driver, the testing comprising; responsive to a call to an application programming interface exposed by an operating system, receiving information to identify the hook function and the target function of the target code to modify with the hook function, the target code including place holder instructions injected as non-operative entry points into functions of the target code including at least the target function and at least one gap maintained between functions in the target code; overwriting a place holder instruction of the target function with a first jump instruction to jump to the at least one gap when the target function is called; and inserting another jump instruction in the at least one gap sufficient to cause a jump to execute the hook function responsive to execution of the first jump instruction. - View Dependent Claims (17, 18, 19, 20)
-
Specification