1. A system for restricting execution of portions of an application program, said system comprising: a memory area for storing an application program, said application program having a plurality of functions associated therewith, said memory area being associated with a computing device, said computing device having one or more hardware components associated therewith; and a processor programmed to: select a first function from the plurality of functions associated with the application program stored in the memory area; identify at least one of the hardware components; define an expected state for the identified hardware component; modify the selected first function to depend on the defined, expected state of the identified hardware component for execution; identify a second function from the plurality of functions, said identified second function calling the first function; and modify the identified second function to transform an execution state of the identified hardware component into the defined expected state prior to calling the first function.