unit1.pas
来自「口袋西游。明文包截取。只需要修改发包CALL地址。就可以使用了。」· PAS 代码 · 共 59 行
PAS
59 行
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm2 = class(TForm)
Button1: TButton;
Edit1: TEdit;
procedure FormCreate(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
const
WM_TestMessage = WM_USER + 2000;
var
Form2: TForm2;
myhwnd:hwnd;
function HookOn(lpHwnd:HWND):bool;stdcall;external 'OLHookdll.dll' name 'sethook';
function hookoff(lpHwnd:HWND):Bool;stdcall;external 'OLHookdll.dll' name 'endhook';
implementation
{$R *.dfm}
procedure TForm2.FormCreate(Sender: TObject);
begin
myhwnd:=findwindow(nil,'口袋西游');
if myhwnd<>0 then
begin
if HookOn(myhwnd) then
EDIT1.Text:='$'+inttohex(myhwnd,8);
end;
end;
procedure TForm2.FormClose(Sender: TObject; var Action: TCloseAction);
begin
if myhwnd<>0 then
hookoff(myhwnd);
end;
procedure TForm2.Button1Click(Sender: TObject);
begin
if myhwnd<>0 then
begin
sendmessage(myhwnd,WM_TestMessage,0,0);
end;
end;
end.
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?