Described is a system and method for dynamically modifying an executing
heterogeneous program in a heterogeneous distributed computing
environment. A system reference is obtained to a target system on which
the heterogeneous program is executing. The target system may be a local
or a remote system. Based on the system reference, a program reference
associated with the program is obtained which is used to locate a
component of the program. An executable code associated with the
component is modified to create a modified executable code based on a
modification of an internal representation of the component. The modified
code is inserted into the target system memory without requiring the
target system to go offline. The code is inserted either by patching over
an original memory area or injecting into a new memory location. The code
may be inserted when the target program is operating in user mode or
kernel mode.