?? thunk.pas
字號:
unit thunk;
interface
{function SetGDIHook: WORD;
function UnSetGDIHook:word;}
implementation
uses SysUtils, Windows;
{ Undocumented Kernel32 calls. }
{function LoadLibrary16(LibraryName: PChar): THandle; stdcall; external kernel32 index 35;
procedure FreeLibrary16(HInstance: THandle); stdcall; external kernel32 index 36;
function GetProcAddress16(Hinstance: THandle; ProcName: PChar): Pointer; stdcall; external kernel32 index 37;
procedure QT_Thunk; cdecl; external kernel32 name 'QT_Thunk';
var
hInst16: THandle; {}
{ pFunc: Pointer; {函數指針}
{ QT_Thunk 需要堆棧}
{$StackFrames On}
{function SetGDIHook: WORD;
var
ThunkTrash: array[0..$20] of Word;
begin
ThunkTrash[0] := hInst16;
hInst16 := LoadLibrary16('PROJECT1.DLL');
if hInst16 < 32 then
raise Exception.Create('不能載入Project1.DLL');
pFunc := GetProcAddress16(hInst16, 'TextHookCreate');
if pFunc = nil then
raise Exception.Create('不能獲取函數TextHookCreate的地址');
asm
mov edx, pFunc { 載入16-bit過程指針 }
{ call QT_Thunk {調用替換程序 }
{ mov Result, ax { 保存結果}
{ end;
FreeLibrary16(hInst16);
end;
function UnSetGDIHook: WORD;
var
ThunkTrash: array[0..$20] of Word;
begin
ThunkTrash[0] := hInst16;
hInst16 := LoadLibrary16('PROJECT1.DLL');
if hInst16 < 32 then
raise Exception.Create('不能載入Project1.DLL');
pFunc := GetProcAddress16(hInst16, 'TextHookFree');
if pFunc = nil then
raise Exception.Create('不能獲取函數TextHookCreate的地址');
asm
mov edx, pFunc { 載入16-bit過程指針 }
{ call QT_Thunk {調用替換程序 }
{ mov Result, ax { 保存結果}
{ end;
FreeLibrary16(hInst16);
end;}
end.
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -