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

📄 一起解剖灰鸽子vip1.2源码.txt

📁 一起解剖灰鸽子VIP1.2源码.txt 非原创
💻 TXT
📖 第 1 页 / 共 5 页
字号:
0 推荐   收藏   一起解剖灰鸽子VIP1.2源码2007-05-02 11:02:01来自:Xwind's Blog   新建目录...
【原创】一起解剖灰鸽子VIP1.2源码
重点是服务端,你怎么分析控制端。。

回复:我先从客户端分析起 一层一层剥开 到时再分析服务端 
By:小乐 

请原谅我把鸽子的标题改了 呵呵。。。。

最近在看鸽子的源码,我主要的目的不是要去做一个自己的远控,而是想从这一大堆的代码中学习到delphi的一些编程思路和技巧。


我建这个帖子有两个目的:

1。作为自己的学习笔记

2。把自己领悟到的东西和大家一起分享

3。也希望有高手和我一起解决我实际遇到的困惑

---------------------------------

我会不断在这帖上回复到我最新领悟到的要点、难点,也会提出我遇到的困惑给大家探讨。

有兴趣的朋友不放一起来探讨哦

---------------------------------

从工程文件开始分析:


program H_Client;

uses
  Forms,
  windows,
  messages,
  Classes,
  Main in 'Main.pas' {HgzVip},
  AboutUnit in 'AboutUnit.pas' {AboutForm},
  UpIp in 'UpIp.pas' {UpIpDate},
  SysInf in 'SysInf.pas' {SysShezhi},
  ShowPic in 'ShowPic.pas' {ShowPm},
  Scanover in 'Scanover.pas' {Sjiegou},
  Splash in 'Splash.pas' {启动时的logo窗口},
  RegEditUnit in 'RegEditUnit.pas' {RegEdit},
  RegHexEdit in 'RegHexEdit.pas' {RegHex},
  ConfigServerUnit in 'ConfigServerUnit.pas' {ConfigServer},
  NewxpSer in 'NewxpSer.pas' {NewxpServer},
  FtpUpUnit1 in 'FtpUpUnit1.pas' {FtpUp},
  FtpDownUnit in 'FtpDownUnit.pas' {FTPDown},
  ExeToolUnit in 'ExeToolUnit.pas' {ExeToolForm},
  IconLibrary in 'icotool\IconLibrary.pas',
  IconTools in 'icotool\IconTools.pas',
  IconTypes in 'icotool\Icontypes.pas',
  unitExIcon in 'icotool\unitExIcon.pas',
  unitPEFile in 'icotool\unitPEFile.pas',
  unitResourceDetails in 'icotool\unitResourceDetails.pas',
  unitResourceGraphics in 'icotool\unitResourceGraphics.pas',
  BmpToAviUnit in 'BmpToAviUnit.pas' {BmpToAviForm},
  FTPServerUnit in 'FTPServerUnit.pas' {FTPServerForm},
  DESCrypt in 'DESCrypt.pas',
  LangFrm in 'Langmgr\LangFrm.pas',
  LangMgr in 'Langmgr\LangMgr.pas',
  LangObj in 'Langmgr\LangObj.pas';

{$R *.RES}


var
I:integer;

begin


  Application.Initialize;

  SplashForm:=TSplashForm.Create(Application);
  SplashForm.Show;
  ShowWindow(Application.Handle, SW_HIDE);    //隐藏窗体
SplashForm.Update;

  Application.Title := '小乐修改版 Vip 1.2';
  SplashForm.Gauge1.Progress:=5;
  SplashForm.Update;

  Application.CreateForm(THgzVip, HgzVip);
  SplashForm.Gauge1.Progress:=25;
SplashForm.Update;
  Application.CreateForm(TConfigServer, ConfigServer);
SplashForm.Gauge1.Progress:=30;
  SplashForm.Update;
  Application.CreateForm(TNewxpServer, NewxpServer);
SplashForm.Gauge1.Progress:=40;
  SplashForm.Update;
  Application.CreateForm(TFtpUp, FtpUp);
  SplashForm.Gauge1.Progress:=50;
  SplashForm.Update;
  Application.CreateForm(TFTPDown, FTPDown);
  SplashForm.Gauge1.Progress:=60;
  SplashForm.Update;
  Application.CreateForm(TExeToolForm, ExeToolForm);
  SplashForm.Gauge1.Progress:=70;
  SplashForm.Update;
  Application.CreateForm(TBmpToAviForm, BmpToAviForm);
  Application.CreateForm(TFTPServerForm, FTPServerForm);
  SplashForm.Gauge1.Progress:=80;//'加载登陆窗口...';
  SplashForm.Update;


  Application.CreateForm(TShowPm, ShowPm);
  Application.CreateForm(TSjiegou, Sjiegou);
  Application.CreateForm(TUpIpDate, UpIpDate);
  Application.CreateForm(TSysShezhi, SysShezhi);
  SplashForm.Gauge1.Progress:=95;//'加载登陆窗口...';
  SplashForm.Update;
  Application.CreateForm(TRegEdit, RegEdit);
  Application.CreateForm(TRegHex, RegHex);
  SplashForm.Gauge1.Progress:=100;//'加载登陆窗口...';
  SplashForm.Update;

  Application.ProcessMessages;
  HgzVip.NoisReg:=True;
  SplashForm.Free;
  //Application.ShowMainForm :=true;
  Application.Run;
end.


一看就明白了,USES这一块,引用了很多源码(.pas)有的是窗体的有的没有窗体的,

然后beigin到end中间的内容
就创建logo窗口,就是运行鸽子的时候那个显示版本的界面,什么版权所有葛军之类的内容的那个界面。然后就是生成各个窗体,中间每完成一个都让LOGO窗口的进度条变化一下。

最后释放logo窗体,显示主窗体。
实际上主窗体就是 Application.CreateForm(THgzVip, HgzVip);生成的 窗体HgzVip
--------------------------------------
整个过程看起来非常清晰。中间有一句

ShowWindow(Application.Handle, SW_HIDE);  

使用这句 一定要在前面 USES WINDOWS才可以

从英文的意义上来看应该是隐藏这个工程的窗体,但实际上新建了一个工程加上这句测试过,似乎不能隐藏工程的主窗体,也许是工程总是要打开一个窗体的吧。

---------------------------------------
实际上我 删了这句ShowWindow(Application.Handle, SW_HIDE);  程序也能正常运行。
因为非主窗体生成的时候默认是关闭的。

但这句的作用什么呢?应该不会是多余的吧?
谁有更好的解释么?

接着看它的LOGO窗口 SplashForm的源码
应该思路也非常清晰,就是一个窗体上面有一个进度条 然后就是一个图片


--------------------------

unit Splash;

interface

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

type
  TSplashForm = class(TForm)
    Image1: TImage;
    Gauge1: TGauge;
    procedure FormKeyDown(Sender: TObject; var Key: Word;
      Shift: TShiftState);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  SplashForm: TSplashForm;

implementation

{$R *.dfm}

procedure TSplashForm.FormKeyDown(Sender: TObject; var Key: Word;
  Shift: TShiftState);
begin
if (Key = VK_F4) and (ssAlt in Shift) then Key := 0;
end;

end.


---------------------------


疑惑点:

if (Key = VK_F4) and (ssAlt in Shift) then Key := 0; 是干什么的呢?


FormKeyDown 是窗体事件,表示按下键盘触发的事件,估计这个是某个功能,触发按键盘的事件, 

搜索了一下 原来这句的作用是: 

if (Key=VK_F4)and(ssAlt in shift) then {使系统键Alt+F4失效}

呵呵 又学会了一点吧。。。。。




unit AboutUnit;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  StdCtrls, Main, DynamicSkinForm, Buttons, SkinCtrls, SkinBoxCtrls,
  SkinGrids, ExtCtrls,shellapi,DESCrypt, jpeg, IdGlobal, LangFrm;

type
  TAboutForm = class(TLangForm)
    Bevel1: TBevel;
    Image1: TImage;
    Label4: TspSkinStdLabel;
    Label1: TLabel;
    Label2: TLabel;
    Label3: TLabel;
    Button1: TspSkinButton;
    DSF: TspDynamicSkinForm;
  //皮肤控件
  //主要是 皮肤控件 DSF: TspDynamicSkinForm
  //属性DSF.SkinHint 是指向HgzVip.spSkinHint1
  //属性DSF.SkinData是指向HgzVip.spSkinData1

    Image2: TImage;
    procedure Button1Click(Sender: TObject);
    procedure Label2Click(Sender: TObject);
    procedure Label3Click(Sender: TObject);
    procedure Label2MouseMove(Sender: TObject; Shift: TShiftState; X,
      Y: Integer);
    procedure Label3MouseMove(Sender: TObject; Shift: TShiftState; X,
      Y: Integer);
    procedure FormMouseMove(Sender: TObject; Shift: TShiftState; X,
      Y: Integer);
    procedure FormKeyDown(Sender: TObject; var Key: Word;
      Shift: TShiftState);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  AboutForm: TAboutForm;
  keytp:string;
implementation


{$R *.DFM}

procedure TAboutForm.Button1Click(Sender: TObject);
begin
  Close;
end;

//这两句是点击两个连接会打开IE,字符串是用DeCryptStr 解密的,我测试过用百度直接也能打开
//解密函数 在前面的引用的 DESCrypt 里。
//一开始,我不太明白他为什么要做成加密字串然后再做成解密呢 ,不是很多余么?后来想想忽然恍然大悟,哦原来是为了过滤掉 他自己的网址,这样的话别人搜索字符串就替换不掉他的网址和邮箱信息咯。真是太聪明了


procedure TAboutForm.Label2Click(Sender: TObject);
begin
ShellExecute(0, 'open', pchar(DeCryptStr('487D6CB4BADFCCE3314D70B78C37E4A19967A11A0A8FAA17',Head)), nil, nil, SW_SHOWMAXIMIZED);
//ShellExecute(0, 'open', pchar('http://www.baidu.com'), nil, nil, SW_SHOWMAXIMIZED);
end;
procedure TAboutForm.Label3Click(Sender: TObject);
begin
ShellExecute(0, 'open', pchar(DeCryptStr('BB47B76BEF00F0D316AF0B736236860EC89101DF0482D0975C7F285763EE94F9F56C1B69A1956EE040232466768FCAB4',Head)), nil, nil, SW_SHOW);
end;

//这段是设置鼠标 放上去后字体颜色变换的


procedure TAboutForm.Label2MouseMove(Sender: TObject; Shift: TShiftState;
  X, Y: Integer);
begin
  Label2.Font.Color:=clRed;
end;
procedure TAboutForm.Label3MouseMove(Sender: TObject; Shift: TShiftState;
  X, Y: Integer);
begin
  Label3.Font.Color :=clRed;
end;

procedure TAboutForm.FormMouseMove(Sender: TObject; Shift: TShiftState; X,
  Y: Integer);
begin
  Label2.Font.Color :=clWindowText;
  Label3.Font.Color :=clWindowText;
end;

//这段是葛军用来做藏记号用的,只要 按住 ALT键 输入 “HUIGEZI” 或者 “LOVE” 就会出现葛军自己的图片和提示消息框 藏在Image2里,Image2属性是设置为隐藏的。


procedure TAboutForm.FormKeyDown(Sender: TObject; var Key: Word;
  Shift: TShiftState);
begin
//是否按下ALT键,只接收字符
if (shift=[ssALT]) and (key>=$41) and (key<=$5A) then
begin
  keytp:=keytp+chr(key);
  if keytp='HUIGEZI' then
    begin
      Image2.Visible:=True;
      //Close;
    end;
  if keytp='LOVE' then
    begin
      Showmessage(EOL+'慧到永远!'+EOL+
                  EOL+'          葛军');
    keytp:='';
    Close;
    end;
end;
end;
end.


-----------------------


小结:这个简单的 about 窗口隐藏的玄机也不少哦,呵呵 看了以后 真的是收获不少,特别是关于隐藏版权信息的这些,可见作者的用心良苦,有些东西是很值得借鉴的




unit UpIp;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, ComCtrls, SkinTabs, DynamicSkinForm, ImgList, StdCtrls,
  SkinBoxCtrls, SkinCtrls,mmsystem, Mask, Shellapi, DESCrypt ,  WinInet ,
  IdBaseComponent, IdComponent, IdTCPConnection, IdTCPClient, IdHTTP, LangFrm,
  Psock, NMFtp;

type  // 本地代理服务器设置信息。
  TProxyServerInf = record
    httpName: string;
    httpport: integer;
    SocksName: string;
    Socksport: integer;
  end;

type
  TUpIpDate = class(TLangForm)
    spDynamicSkinForm1: TspDynamicSkinForm;
    PageControl1: TspSkinPageControl;
    TabSheet1: TspSkinTabSheet;
    TabSheet2: TspSkinTabSheet;
    ImageList1: TImageList;
    Panel1: TspSkinPanel;
    Label2: TspSkinStdLabel;
    Label3: TspSkinStdLabel;
    Label4: TspSkinStdLabel;

⌨️ 快捷键说明

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