在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
library Project2; uses SysUtils, Classes, windows, Dialogs; {$R *.res} function GetModuleHandleA(a: string): Integer; stdcall; external 'kernel32.dll' {取程序或DLL句柄 a:DLL名 } function GetProcAddress(a: integer; b: string): Integer; stdcall; external 'kernel32.dll' {取DLL函数地址 a:模块句柄 b:函数名 } function GetCurrentProcess: Integer; stdcall; external 'kernel32.dll' {取伪句柄 } function Test11(aa: string): string; begin Result := aa; end; var b: array[1..3] of byte = ($C2, $10, $0); function Test2(): Integer; var a: Integer; c: Integer; WriteByte: DWORD; begin //GetModuleHandleA('user32.dll'); a := GetModuleHandleA('user32.dll'); c := GetProcAddress(a, 'SetWindowsHookExA'); WriteProcessMemory(GetCurrentProcess(), Pointer(c), @b[1], 3, WriteByte); ShowMessage('hook成功'); Result := 1; end; exports Test2; begin Test2(); end.
|
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论