Change a function vector in a library
Source position: exec.pas line 1281
function SetFunction( |
Library_: PLibrary; |
FuncOffset: LongInt; |
NewFunction: TProcedure |
):Pointer; |
FuncOffset |
|
The offset of the function to be replaced |
NewFunction |
|
A Pointer to new function |
Pointer to the old function that was just replaced
SetFunction is a functional way of changing where vectors in a library point. They are changed in such a way that the checksumming process will never falsely declare a library to be invalid.
Warning
While it's more or less safe to patch a library vector with SetFunction() it's not possible to safely remove the patch later. So don't use this function if it can be avoided.