Patent ID: 7162715

Claim:
A method of executing a program in a controlled environment, comprising: initiating execution of an operating system with which the program is adapted to execute; inserting, at a beginning of the program, first redirection logic; executing the program such that the first redirection logic is executed; storing a current instruction pointer; redirecting execution control to a program loader; selecting, by the program loader, a first block of instructions of the program based at least in part on the stored current instruction pointer; manipulating the selected first block of instructions provide a first phantom instruction block; and executing the first phantom instruction block in the controlled environment; wherein the selected first block of instructions includes at least one instruction, and manipulating the selected first block includes copying at least a portion of the selected first block to form the first phantom instruction block; and wherein executing the first phantom instruction block in the controlled environment includes at least one of monitoring execution of the first phantom instruction block, preventing at least a first portion of the first phantom instruction block from executing, and modifying at least a second portion of the first phantom instruction block before the at least a second portion executes.