# US 2018/0321917 A1 · Generating and executing multi-entry point functions

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2018/0321917 A1
- Document ID: US20180321917A1
- Status: Published application
- Kind: A1
- Application number: 15/587,222
- Filed: 2017-05-04
- Published: 2018-11-08
- Earliest claimed: 2017-05-04
- Assignees: Microsoft Technology Licensing, LLC
- Applicants: Microsoft Technology Licensing, LLC
- Inventors: Zhongyuan LI; Tianzhuang DOU; Lei KOU
- Web page: https://patentgrep.com/patent/US20180321917A1

## CPC

- G06F 8/30: Creation or generation of source code
- G06F 9/4484: {Executing subprograms}
- G06F 8/54: Link editing before load time
- G06F 9/44521: {Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading}
- G06F 9/4486: {Formation of subprogram jump address}
- G06F 12/0646: {Configuration or reconfiguration}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

A static multi-entry point function with more than one entry point is provided. The function allows callers to enter the function at different entry points using an offset. Each entry point of the function is associated with a different offset, and includes instructions that identify data that is associated with the entry point. Each entry point further includes an instruction that jumps to a common prologue of the function. The common prologue loads the identified data into local variables. The function also includes a functional component that performs different actions depending on the data in the local variables. The function includes a default entry point that is used when the function is called without any offset, so that the function appears to behave like a normal function to scanners.

## Claims

### Claim 1

A system for providing a multi-entry point function comprising:
at least one computing device comprising a processing unit configured to:
generate a static multi-entry point function that uses static code, wherein the static multi-entry point function allows callers to enter the function at different entry points using a respective offset of a plurality of offsets, wherein each of the different entry points is associated with a different offset of the plurality of offsets, and wherein the static multi-entry point function comprises:
a plurality of entry points wherein each entry point is associated with data; and
a functional component that performs one or more actions based on the data associated with a selected entry point of the plurality of entry points;
receive a call for the static multi-entry point function, the call associated with an indication of an entry point of the plurality of entry points; and
execute the generated static multi-entry point function based on the indicated entry point; and
a memory.

### Claim 2 (depends on 1)

The system of claim 1, further comprising an index stored in memory of the at least one computing device, wherein the index includes a plurality of elements, and the data associated with each entry point comprises an element of the plurality of elements.

### Claim 3 (depends on 2)

The system of claim 2, wherein each entry point comprises an instruction to identify the element of the plurality of elements of the index that is associated with the entry point.

### Claim 4 (depends on 3)

The system of claim 3, wherein the static multi-entry point function comprises a common prologue, and the common prologue includes an instruction to read data from the identified element of the index, and to save the data as one or more local variables.

### Claim 5 (depends on 4)

The system of claim 4, wherein the functional component further performs the one or more actions based on the data from the one or more local variables.

### Claim 6

(canceled)

### Claim 7 (depends on 1)

The system of claim 1, wherein the function further comprises a common prologue and a common epilogue.

### Claim 8 (depends on 7)

The system of claim 7, wherein each entry point comprises an instruction to jump to the common prologue.

### Claim 9 (depends on 1)

The system of claim 1, wherein the static multi-entry point function is a function to monitor a plurality of functions, and each entry point is associated with a different function of the plurality of functions.

### Claim 10

A system for providing a multi-entry point function comprising:
at least one computing device comprising a processing unit configured to:
generate an index, wherein the index comprises a plurality of elements; and
generate a static multi-entry point function that uses static code, wherein the static multi-entry point function allows callers to enter the function at different entry points using a respective offset of a plurality of offsets, wherein each of the different entry points is associated with a different offset of the plurality of offsets, and wherein the static multi-entry point function comprises:
a plurality of entry points, wherein each entry point is associated with an element of the plurality of elements of the index;
a common prologue that comprises:
an instruction that creates a stack frame for the static multi-entry point function; and
an instruction that saves an identifier of a selected entry point to the stack frame; and
a functional component that comprises:
an instruction to determine the selected entry point based on the identifier;
an instruction to save the data from the element associated with the selected entry point as one or more local variables; and
an instruction to perform one or more actions based on the data from the one or more local variables; and
a memory.

### Claim 11 (depends on 10)

The system of claim 10, wherein the static multi-entry point function is optimized at compile time.

### Claim 12 (depends on 10)

The system of claim 10, wherein each entry point comprises an instruction to jump to the common prologue.

### Claim 13 (depends on 10)

The system of claim 10, wherein the processing unit is further configured to:
receive a call for the static multi-entry point function, the call associated with an indication of an entry point of the plurality of entry points; and
execute the generated static multi-entry point function based on the indicated entry point.

### Claim 14

(canceled)

### Claim 15 (depends on 10)

The system of claim 10, wherein the static multi-entry point function supports a plurality of computer architectures, and the processing unit is further configured to:
receive a plurality of templates, wherein each template corresponds to a different computer architecture of the plurality of architectures; and
generate the functional component using the plurality of templates.

### Claim 16

A method for executing a multi-entry point function comprising:
receiving a call for a static multi-entry point function by a computing device, wherein the static multi-entry point function uses static code and allows callers to enter the function at different entry points using a respective offset of a plurality of offsets, wherein each of the different entry points is associated with a different offset of the plurality of offsets, and wherein the static multi-entry point function comprises:
a plurality of entry points, wherein each entry point is associated with an element of a plurality of elements of an index;
a common prologue that comprises:
an instruction to read data from the element associated with a selected entry point of the plurality of entry points; and
an instruction to save the data from the element associated with the selected entry point as one or more local variables; and
a functional component that comprises an instruction to perform one or more actions based on the data from the one or more local variables;
determining an offset associated with the call by the computing device; and
executing the generated static multi-entry point function based on the determined offset by the computing device.

### Claim 17 (depends on 16)

The method of claim 16, wherein executing the generated static multi-entry point function based on the determined offset comprises setting an instruction pointer to an instruction in the selected entry point based on the memory offset.

### Claim 18 (depends on 17)

The method of claim 17, further comprising:
performing an instruction to store an indication of the selected entry point; and
performing an instruction to set the instruction pointer to an instruction in the common prologue.

### Claim 19 (depends on 18)

The method of claim 18, further comprising:
performing the instruction to read the data from the element associated with the selected entry point using the stored indication of the selected entry point; and
performing the instruction to save the data from the element associated with the selected entry point as the one or more local variables.

### Claim 20 (depends on 16)

The method of claim 16, wherein the static multi-entry point function is a function to monitor a plurality of functions, and each entry point is associated with a different function of the plurality of functions.
