Service installation on a base function and provision of a pass function with a service-free base function semantic
First Claim
1. A computer readable medium storing data representing a service installation system for modifying a base function to introduce therein additional processing implemented in a service function, the service installation system comprising:
- a construct function comprising instructions for creating a pass function, wherein the pass function comprises an unconditional branch instruction to the base function; and
an install function comprising instructions for replacing the first one or more instructions of the base function with an unconditional branch instruction to the service function, the install function further comprising instructions for making pass function instructions include the replaced first one or more instructions followed by an unconditional branch instruction to the instruction in the base function that follows the unconditional branch instruction in the base function.
2 Assignments
0 Petitions
Accused Products
Abstract
A base function provides a base function semantic. During service installation, an unconditional branch instruction to a service function replaces one or more instructions at the beginning of a base function. The service function provides a service semantic such as instrumentation, redirection, replacement, or extension. After service installation, a pass function includes the replaced base function instructions and an unconditional branch instruction to the logically subsequent base function instruction. Thus, the pass function provides a service-free base function semantic. The service function calls the pass function an arbitrary number of times before and/or after executing any other service function instructions. The pass function is allocated statically or dynamically. A statically allocated pass function is callable before and/or after service installation to guarantee a service-free base function semantic. A service removal function restores a base function and conforms a pass function to the restored base function. A pass function is callable before and/or after service removal. A library of service installation functions includes functions for installing and removing a service on a base function. A library of binary editing functions includes functions for attaching service installation functions and associated data payloads to a binary file.
210 Citations
57 Claims
-
1. A computer readable medium storing data representing a service installation system for modifying a base function to introduce therein additional processing implemented in a service function, the service installation system comprising:
-
a construct function comprising instructions for creating a pass function, wherein the pass function comprises an unconditional branch instruction to the base function; and
an install function comprising instructions for replacing the first one or more instructions of the base function with an unconditional branch instruction to the service function, the install function further comprising instructions for making pass function instructions include the replaced first one or more instructions followed by an unconditional branch instruction to the instruction in the base function that follows the unconditional branch instruction in the base function. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16)
before replacing, enumerating the first one or more instructions of the base function;
copying the first one or more instructions of the base function to the beginning of the pass function; and
writing the unconditional branch instruction in the pass function to the instruction in the base function that follows the last copied instruction.
-
-
4. The computer readable medium of claim 1 wherein the instructions are fixed length instructions.
-
5. The computer readable medium of claim 1 wherein the instructions are variable length instructions.
-
6. The computer readable medium of claim 1 wherein the construct function is a macro, and wherein the pass function is statically allocated.
-
7. The computer readable medium of claim 1 wherein the service function conditionally bypasses the pass function.
-
8. The computer readable medium of claim 1 wherein a single function supplies the semantics of the construct function and install function.
-
9. The computer readable medium of claim 1 wherein the construct function takes as parameters a pass function prototype and the name of the base function.
-
10. The computer readable medium of claim 1 wherein the install function takes as parameters a reference to the pass function and a reference to the service function.
-
11. The computer readable medium of claim 1 wherein the install function takes as parameters a reference to the base function and a reference to the service function, and wherein the install function returns a reference to a dynamically-allocated pass function.
-
12. A method for installing a software library that includes the construct function and install function of claim 1, the method comprising:
-
modifying an application binary to include a service installation section, wherein the service installation section comprises an import table, and wherein the import table lists the software library that includes the construct function and the install function, and wherein the import table further lists one or more software libraries for the application binary; and
linking the modified application binary with the software libraries listed in the import table.
-
-
13. The computer readable medium of claim 1 further comprising:
an editing function comprising instructions for modifying an import table of a service installation section in an application binary that includes a service installation section.
-
14. The computer readable medium of claim 1 further comprising:
a pointer locating function comprising instructions for finding a pointer that references a base function.
-
15. The computer readable medium of claim 1 further comprising:
-
a payload adding function comprising instructions for adding a payload to a service installation section in an application binary that includes a service installation section, wherein a payload comprises configuration data for access by a service function; and
a payload removing function comprising instructions for removing a payload from a service installation section in an application binary that includes a service installation section.
-
-
16. The computer readable medium of claim 1 further comprising:
a remove service function comprising instructions for restoring the base function, wherein the remove service function further comprises instructions for conforming the pass function to the restored base function.
-
17. A computer readable memory device storing data representing plural function images, where a function image comprises one or more instructions for a function in memory, the plural function images including:
-
a base function image comprising plural instructions;
a pass function image comprising one or more instructions, wherein the one or more instructions of the pass function image provide a service-free semantic for the base function with an unconditional branch instruction to an instruction in the base function image; and
a service function image comprising one or more instructions, wherein the service function image includes at least one call to the pass function. - View Dependent Claims (18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30)
-
-
31. A method for using a link symbol for a base function to create a statically allocated pass function, wherein the statically allocated pass function provides a service-free base function semantic, the method comprising:
-
providing a pass function prototype;
providing a base function comprising one or more instructions, wherein the one or more instructions provide a base function semantic; and
creating a statically allocated pass function comprising one or more instructions, wherein the statically allocated pass function includes an unconditional branch instruction to an instruction in the base function. - View Dependent Claims (32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42)
providing a service function comprising one or more instructions, wherein the service function includes at least one call to the statically allocated pass function.
-
-
35. The method of claim 34 wherein the service function conditionally bypasses a call to the statically allocated pass function.
-
36. The method of claim 34 further comprising:
-
modifying the base function to unconditionally branch to the service function; and
conforming the pass function to the modified base function.
-
-
37. The method of claim 36 wherein modifying and conforming occur by calling an install function.
-
38. The method of claim 36 further comprising, before and/or after conforming, calling the pass function from a user module.
-
39. The method of claim 36 wherein conforming comprises
copying the first one or more instructions of the unmodified base function to the beginning of the pass function; - and
writing an unconditional branch instruction in the pass function to the instruction in the base function that follows the last copied instruction.
- and
-
40. The method of claim 36 wherein modifying and conforming occur by calling an install function.
-
41. The method of claim 36 further comprising, before and/or after conforming, calling the pass function from a user module.
-
42. The method of claim 31 further comprising:
calling a remove service function comprising instructions for restoring the base function, wherein the remove service function further comprises instructions for conforming the pass function to the restored base function.
-
43. A method for creating a dynamically allocated pass function while installing a service in a base function, wherein the dynamically allocated pass function provides a service-free base function semantic, the method comprising:
-
providing a base function comprising one or more instructions, wherein the one or more instructions provide a base function semantic;
providing a service function comprising one or more instructions; and
calling an install function to replace the first one or more instructions of the base function with an unconditional branch instruction to the service function, wherein the install function also creates a dynamically allocated pass function comprising one or more instructions that provide a service-free base function semantic. - View Dependent Claims (44, 45, 46, 47)
finding a pointer that references the base function using a pointer locating function.
-
-
47. The method of claim 43 further comprising:
calling a remove service function comprising instructions for restoring the base function, wherein the remove service function further comprises instructions for conforming the pass function to the restored base function.
-
48. A method for using a standard calling convention to maintain state consistency for a service system, wherein calling triggers a state change by pushing a call frame on the call stack, wherein branching transfers execution without a call stack change, and wherein a base function, pass function, and service function have the same call signature, the method comprising:
-
from a start function, calling a base function;
within the base function, unconditionally branching to a service function, wherein the service function comprises one or more instructions;
within the service function, calling a pass function;
within the pass function, unconditionally branching to the base function instruction that follows the unconditional branch to the service function; and
upon completion of the base function, returning to the service function, wherein the service function executes instructions before and/or after calling the pass function. - View Dependent Claims (49, 50, 51, 52, 53)
-
-
54. A method for calling a pass function as a sub-routin e in a service function to provide a service-free base function semantic, the method comprising:
-
modifying a base function to unconditionally branch to a service function;
calling the base function, whereby execution branches to the service function;
within the service function, calling at least one time the pass function to provide the service-free semantic for the base function before and/or after executing other instructions in the service function. - View Dependent Claims (55, 56, 57)
within a user module, calling at least one time the pass function to provide the service-free semantic for the base function before and/or after modifying.
-
-
57. The method of claim 54 further comprising:
within the service function, conditionally bypassing the call to the pass function.
Specification