 |
program ProcessFunc;
..\.
uses Windows, madCodeHook, madStrings;
function SomeFunc(str1, str2: string) : string;
begin
result := str1 + str2;
end;
var SomeFuncNextHook : function (str1, str2: string) : string;
function SomeFuncHookProc(str1, str2: string) : string;
begin
str1 := 'blabla';
str2 := UpStr(str2);
result := SomeFuncNextHook(str1, str2);
Delete(result, 1, 3);
end;
begin
MessageBox(0, pchar(SomeFunc('str1', 'str2')), '"str1" + "str2"', 0);
HookCode(@SomeFunc, @SomeFuncHookProc, @SomeFuncNextHook);
MessageBox(0, pchar(SomeFunc('str1', 'str2')), '"str1" + "str2"', 0);
UnhookCode(@SomeFuncNextHook);
end.
|
|