Skip to content

Sections
You are here: Home » Patents » OBJECT CODE LOGIC ANALYSIS AND AUTOMATED MODIFICATION SYSTEM AND METHOD

OBJECT CODE LOGIC ANALYSIS AND AUTOMATED MODIFICATION SYSTEM AND METHOD

.

Inventor: Robert H Nagel

US patent number: 6,071,317

US patent application date: December 9, 1998
US patent issue Date: June 6, 2000.

Published under the World Intellectual Property Organization (WIPO) WO 99/30229: June 17, 1999

SYNOPSIS OF THE INVENTION

A system that automatically analyzes compiled code (e.g., object or machine code) to identify specific program instructions that are to be modified, wherein manual analysis, or even possession or remediation of source code is unnecessary.

Therefore, in a Y2K remediation embodiment, the system relics on identification of the particular instructions or program execution points, e.g., date references or date-related code, in compiled load modules, which are then preferably patched in a manner which do not require alteration of the size of the data field or alteration of the general execution of the program. Since the references or locations within the original compiled program are corrected by discrete patches, this process may even be performed at the time the software module is actually loaded. In some systems, this "just-in-time" patching is particularly advantageous. Thus, where the load module or other compiled program is compressed or watermarked, or otherwise inaccessible for alteration without significant efforts, after loading in memory, the code may be subject to a patch overlay, containing the discrete changes, prior to execution.

In this context, it is also possible to provide a dynamic overlay, which changes during the course of program execution. While the code being executed is fixed, a typical program includes multiple sections, only a portion of which are subject to execution at any given time. This allows, therefore, the logic of the "patch" to be dynamically changed based upon extrinsic circumstances. Therefore, a set of conditions may be defined for introduction of a patch, which may then be removed after the conditions are absent.

This selective modification of program logic reduces the possibility of unintended consequences of patch logic and further reduces the testing burden to only those conditions for which the patch logic is executed and the use of the resulting results. Further, in the case of dynamic patching, a number of different conditions may be established, each with a different type of patch logic.

A particular advantage of dynamic patching is that, where the conditions are not met, the program remains effectivley unchanged, and therefore the incidence of new errors and impaired program execution efficiency is reduced.

The dynamic patching method would be useful, for example, in a Microsoft Windows-type operating system, wherein multiple threads execute simultaneously (e.g., the main program logic, the conditional sensing logic, and the program patching logic), and wherein loading of software modules is controlled through the operating system.

The preferred embodiment of the present invention employs alterations to the operation of the computing system at the most common (and basic) level of programming available, the machine code. Machine code in executable form is typically the result of successful compiling, assembly and linking processes, as well as possible preexisting patches.

All higher level computer languages are compiled and assembled into machine code for a specific computer architecture, which is then executed directly by the computing machine under the control of an operating environment.

In some instances, code may be compiled for a "virtual machine", which is then implemented on specific hardware. In this case, the patch is typically applied at the level of execution of the program in the virtual machine, and not in the real machine, unless the remediation is specific for flaws in the virtual machine itself, or where functions provided by the virtual machine are particularly adapted for, and used by, program code in a predictable manner for a logical function. In a virtual machine environment, it is possible to virtualize machine behavior, and therefore it is possible to modify both the program logic, to insert traps, calls, and specialized instructions, as well as the virtual machine, to respond to the specialized instructions, in a manner analogous to the addition of new microinstructions to be implemented in hardware.

The present invention can provide modifications at the machine code or assembler code level because the objective of the present system is relatively narrow: to find and correct only that portion of the program that directly or indirectly deals with particular program "events", such as date references; the normal program logic and flow is left intact, and indeed the low level structure is preferably left substantially unaltered, other than the necessary changes, reducing the incidence of creation of or functional discovery of new or latent program flaws. The process according to the present invention comprises a number of steps, which may be summarized as (1) Inspection, (2) Analysis, (3) Remediation, and (4) Storage of Results. In the first step, inspection, the system is inspected to define the context and relation of program and data elements. Thus, in a relatively high level manner, the state, inputs, outputs, environment, and interrelation of elements is determined.

In the second step, the program logic is analyzed for references to the specified "event", for example, reference to or use of date related data. This step encompasses, for example, disassembly of machine code and tracing of program logic. It is noted that not every instance of a reference to the specified "event" must be altered, and therefore the analysis preferably determines whether such alteration is necessary.

In the third step, the remediation is applied to alter the program logic. In the preferred embodiment, this remediation takes the form of selection of an appropriate alteration of program logic to achieve a desired result, and patching of the program by substitution of simple program flow control instructions for altered program logic, as well as a logic for circumventing remaining program logic which is undesired.

In the fourth step, the revised program logic is stored for execution. While the disassembled code may be reassembled, with the patches, the defined patches in the remediation step may also be applied to directly to unmodified compiled program code, without changing program length by inserting traps to the patch code.