刺激战场
六合彩
贵宾厅
  • 2861阅读
  • 1回复

delphi注入 [复制链接]

上一主题 下一主题
离线啊冲
 

只看楼主 倒序阅读 使用道具 楼主  发表于: 2013-08-29
— 本帖被 啊冲 从 Delphi 移动到本区(2013-10-28) —
unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, ExtCtrls;

type
  TForm1 = class(TForm)
    Image1: TImage;
    Label1: TLabel;
    Label2: TLabel;
    edtClassName: TEdit;
    edtHwnd: TEdit;
    Timer1: TTimer;
    btnCancel: TButton;
    edtTitle: TEdit;
    Label3: TLabel;
    procedure FormCreate(Sender: TObject);
    procedure GetMousePosHwndAndClassName(Sender : TPoint);  //自定义过程的声明
    procedure Image1MouseDown(Sender: TObject; Button: TMouseButton;
      Shift: TShiftState; X, Y: Integer);
    procedure Image1MouseUp(Sender: TObject; Button: TMouseButton;
      Shift: TShiftState; X, Y: Integer);
    procedure Timer1Timer(Sender: TObject);
    procedure btnCancelClick(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;    
  hHWND: THandle;
  function HookOn(lpHwnd:HWND;lpType:Longint):Longint;stdcall;external 'Hook32.dll' name 'HookOn';
  function HookOff:Boolean;stdcall;external 'Hook32.dll' name 'HookOff';

implementation

{$R *.dfm}

procedure TForm1.GetMousePosHwndAndClassName(Sender: TPoint); //自定义过程的实现部分
var
aName: array [0..255] of char;
tName: array [0..255] of char  ;
begin
hHWND := WindowFromPoint(Sender);   // windowfrompoint 获得窗口指定点的句柄
edtHwnd.Text := IntToStr(hHWND);
if boolean(GetClassName(hHWND,aName,256)) then
  edtClassName.Text :=  string(aName)
else
  edtClassName.Text := ' not found ! ';
if boolean(GetWindowText(hHwnd,tName,256)) then
  edtTitle.Text := string(tName)
else
  edtTitle.Text := ' not found ! ';
flashwindow(hHWND,true);
end;  //这个过程大家都能看懂吧

procedure TForm1.FormCreate(Sender: TObject);
begin
image1.Picture.LoadFromFile('8.ico'); //IMAGE1 装载8.ico
Form1.FormStyle := fsStayOnTop;   //窗体在最定层
Timer1.Interval := 50;
Timer1.Enabled:=false;
end;

procedure TForm1.Image1MouseDown(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);
begin
Timer1.Enabled:=true;
SetSystemCursor(LoadCursorFromFile('10.cur'),ocr_normal); //设置鼠标形状
image1.Picture.LoadFromFile('9.ico');  //装载图标
end;

procedure TForm1.Image1MouseUp(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);
begin
SystemParametersinfo(SPI_SETCURSORS,0,nil,SPIF_SENDCHANGE);    //设置系统的鼠标形状为默认
Timer1.Enabled:=false;
image1.Picture.LoadFromFile('8.ico');
HookOn(HWND(hHWND),wh_keyboard);
btnCancel.Enabled :=true;
image1.Enabled :=false;
end;

procedure TForm1.Timer1Timer(Sender: TObject);
var
rPos: TPoint;
begin
if boolean(GetCursorPos(rPos)) then  //getcursorPos 该函数检取光标的位置,以屏幕坐标表示。
GetMousePosHwndAndClassName(rPos);  //调用自定义过程!
end;

procedure TForm1.btnCancelClick(Sender: TObject);
begin
  HookOff();
  btnCancel.Enabled :=false;
  image1.Enabled :=true;
end;

end.


http://yunpan.cn/QXEZVjMHg9uU4
附件: delphi注入.7z (653 K) 下载次数:2
善者 慈悲心常在 无怨无恨 以苦为乐
默认压缩密码www.hifyl.com
文件分享密码问题:http://www.hifyl.com/read-htm-tid-4444.html
离线nopara

只看该作者 沙发  发表于: 2016-12-13
谢谢分享!!!!
快速回复
限100 字节
批量上传需要先选择文件,再选择上传
 
上一个 下一个