# US 2012/0255015 A1 · Method and apparatus for transparently instrumenting an application program

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

- Number: US 2012/0255015 A1
- Document ID: US20120255015A1
- Status: Published application
- Kind: A1
- Application number: 13/076,378
- Filed: 2011-03-30
- Published: 2012-10-04
- Earliest claimed: 2011-03-30
- Assignees: Intel Corporation
- Inventors: Ravi L. Sahita; David M. Durham; Prashant Dewan; Manohar R. Castelino
- Web page: https://patentgrep.com/patent/US20120255015A1

## CPC

- G06F 21/54: by adding security routines or objects to programs
- G06F 11/3644: {by instrumenting at runtime}
- G06F 21/566: {Dynamic detection, i.e. detection performed at run-time, e.g. emulation, suspicious activities}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Generally, this disclosure describes systems and methods for transparently instrumenting a computer process. The systems and methods are configured to allow instrumenting executable code while permitting legacy memory scanning tools to monitor corresponding uninstrumented executable code stored in memory.

## Claims

### Claim 1

A method, comprising:
storing at least a portion of an executable application program in a host system physical memory at a first host physical address;
instrumenting a copy of said portion of said executable application program and storing said instrumented copy in said host system physical memory at a second host physical address;
setting a corresponding access permission to read only for said first host physical address and setting a corresponding access permission to execute only for said second host physical address; and
executing said instrumented copy or reading said portion of said executable application program based, at least in part, on said access permissions.

### Claim 2 (depends on 1)

The method of claim 1, further comprising:
generating a page fault in response to an attempt to read said second host physical address or an attempt to execute said portion of said executable application program stored at said first host physical address.

### Claim 3 (depends on 2)

The method of claim 2, further comprising:
determining a type of said page fault; and
updating an extended page table entry to correspond to said second host physical address if said page fault is an execute fault or to correspond to said first host physical address if said page fault is a read fault.

### Claim 4 (depends on 1)

The method of claim 1, wherein a memory scanner is configured to read said portion of said executable application program.

### Claim 5 (depends on 1)

The method of claim 1, further comprising:
generating a first extended page table associated with said first host physical address and a second extended page table associated with said second host physical address; and
instrumenting a memory scanner with a first instruction, said first instruction configured to select said first extended page table,
wherein said memory scanner is configured to read said portion of said executable application program and said first instruction is configured to be executed prior to said memory scanner reading said portion of said executable application program.

### Claim 6 (depends on 5)

The method of claim 5, further comprising:
instrumenting said memory scanner with a second instruction, said second instruction configured to select said second extended page table,
wherein said second instruction is configured to be executed after said memory scanner has read said portion of said executable application program.

### Claim 7 (depends on 1)

The method of claim 1, further comprising:
monitoring execution of said executable application program using said instrumented copy, wherein said monitoring is configured to detect malware.

### Claim 8 (depends on 1)

The method of claim 1, further comprising:
generating a first extended page table associated with said first host physical address and a second extended page table associated with said second host physical address;
generating a page fault in response to an attempt to read said second host physical address or an attempt to execute said portion of said executable application program stored at said first host physical address; and
selecting one of said first and second extended page tables in response to the page fault.

### Claim 9

A system comprising, one or more storage mediums having stored thereon, individually or in combination, instructions that, when executed by one or more processors, result in the following operations comprising:
storing at least a portion of an executable application program in a host system physical memory at a first host physical address;
instrumenting a copy of said portion of said executable application program and storing said instrumented copy in said host system physical memory at a second host physical address;
setting a corresponding access permission to read only for said first host physical address and setting a corresponding access permission to execute only for said second host physical address; and
executing said instrumented copy or reading said portion of said executable application program based, at least in part, on said access permissions.

### Claim 10 (depends on 9)

The system of claim 9, wherein the instructions result in the following additional operations comprising:
generating a page fault in response to an attempt to read said second host physical address or an attempt to execute said portion of said executable application program stored at said first host physical address.

### Claim 11 (depends on 10)

The system of claim 10, wherein the instructions result in the following additional operations comprising:
determining a type of said page fault; and
updating an extended page table entry to correspond to said second host physical address if said page fault is an execute fault or to correspond to said first host physical address if said page fault is a read fault.

### Claim 12 (depends on 9)

The system of claim 9, wherein a memory scanner is configured to read said portion of said executable application program.

### Claim 13 (depends on 9)

The system of claim 9, wherein the instructions result in the following additional operations comprising:
generating a first extended page table associated with said first host physical address and a second extended page table associated with said second host physical address; and
instrumenting a memory scanner with a first instruction, said first instruction configured to select said first extended page table,
wherein said memory scanner is configured to read said portion of said executable application program and said first instruction is configured to be executed prior to said memory scanner reading said portion of said executable application program.

### Claim 14 (depends on 13)

The system of claim 13, wherein the instructions result in the following additional operations comprising:
instrumenting said memory scanner with a second instruction, said second instruction configured to select said second extended page table,
wherein said second instruction is configured to be executed after said memory scanner has read said portion of said executable application program.

### Claim 15 (depends on 9)

The system of claim 9, wherein the instructions result in the following additional operations comprising:
monitoring execution of said executable application program using said instrumented copy wherein said monitoring is configured to detect malware.

### Claim 16 (depends on 9)

The system of claim 9, wherein the instructions result in the following additional operations comprising:
generating a first extended page table associated with said first host physical address and a second extended page table associated with said second host physical address;
generating a page fault in response to an attempt to read said second host physical address or an attempt to execute said portion of said executable application program stored at said first host physical address; and
selecting one of said first and second extended page tables in response to the page fault.

### Claim 17

A system, comprising:
host physical memory; and
a processor configured to:
store at least a portion of an executable application program in said host system physical memory at a first host physical address;
instrument a copy of said portion of said executable application program and store said instrumented copy in said host system physical memory at a second host physical address;
set a corresponding access permission to read only for said first host physical address and set a corresponding access permission to execute only for said second host physical address; and
execute said instrumented copy or read said portion of said executable application program based, at least in part, on said access permissions.

### Claim 18 (depends on 17)

The system of claim 17, wherein the processor is further configured to:
generate a page fault in response to an attempt to read said second host physical address or an attempt to execute said portion of said executable application program stored at said first host physical address.

### Claim 19 (depends on 18)

The system of claim 18, wherein the processor is further configured to:
determine a type of said page fault; and
updating an extended page table entry to correspond to said second host physical address if said page fault is an execute fault or to correspond to said first host physical address if said page fault is a read fault.

### Claim 20 (depends on 17)

The system of claim 17, wherein the processor is further configured to:
generate a first extended page table associated with said first host physical address and a second extended page table associated with said second host physical address; and
instrument a memory scanner with a first instruction, said first instruction configured to select said first extended page table,
wherein said memory scanner is configured to read said portion of said executable application program and said first instruction is configured to be executed prior to said memory scanner reading said portion of said executable application program.

### Claim 21 (depends on 20)

The system of claim 20, wherein the processor is further configured to:
instrument said memory scanner with a second instruction, said second instruction configured to select said second extended page table,
wherein said second instruction is configured to be executed after said memory scanner has read said portion of said executable application program.

### Claim 22 (depends on 17)

The system of claim 17, wherein the processor is further configured to:
monitor execution of said executable application program using said instrumented copy, said monitoring is configured to detect malware.
