深圳全飞鸿

 找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 632|回复: 0
打印 上一主题 下一主题

terminal程序TCP的execute分析

[复制链接]

800

主题

1379

帖子

7704

积分

版主

Rank: 7Rank: 7Rank: 7

积分
7704
跳转到指定楼层
楼主
发表于 2019-6-6 21:40:49 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
  1. procedure TUDPMainForm.mytcpExecute(AThread: TIdPeerThread);
  2. var
  3.   content:string;
  4.   nLen: Integer;
  5.   gg:string;
  6. begin
  7.   //-----------------记录下SMO的线程-----------------
  8.   // SM O_thread.threadID:=Athread;
  9.   // SMO_thread.ip:='OK';
  10.   //-------------------------------------------------
  11.   try
  12.     if not AThread.Terminated and AThread.Connection.Connected then
  13.     begin
  14.           //WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW
  15.             if athread.Connection.Tag=8 then   // 8 is for remote control ...
  16.             begin
  17.                athread.Connection.readbuffer(FCmdBuf, SizeOf(TCtlCmd));
  18.                if true then
  19.                begin
  20.                   if true then
  21.                   begin
  22.                     FCmdRec := 0;
  23.                     try
  24.                       Move(FCmdBuf[0], FCmd, SizeOf(TCtlCmd));
  25.                       if FCmd.Cmd in [1..7] then
  26.                       begin
  27.                         FPoint := Point(FCmd.X, FCmd.Y);
  28.                         SetCursorPos(FCmd.X, FCmd.Y);
  29.                         SetCapture(WindowFromPoint(FPoint));
  30.                       end;
  31.                       case FCmd.Cmd of
  32.                         1: ;//mouse move
  33.                         2: mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0);
  34.                         3: mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0);
  35.                         4: mouse_event(MOUSEEVENTF_RIGHTDOWN, 0, 0, 0, 0);
  36.                         5: mouse_event(MOUSEEVENTF_RIGHTUP, 0, 0, 0, 0);
  37.                         6:
  38.                             begin
  39.                               mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0);
  40.                               mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0);
  41.                             end;
  42.                         7:
  43.                             begin
  44.                               mouse_event(MOUSEEVENTF_RIGHTDOWN, 0, 0, 0, 0);
  45.                               mouse_event(MOUSEEVENTF_RIGHTUP, 0, 0, 0, 0);
  46.                             end;
  47.                         8: keybd_event(Byte(FCmd.X), 0, 0, 0);
  48.                         9: keybd_event(Byte(FCmd.X), 0, KEYEVENTF_EXTENDEDKEY or KEYEVENTF_KEYUP, 0);
  49.                       end;
  50.                     except
  51.                     end;
  52.                    end;
  53.                  end;
  54.                  exit;
  55.             end;

  56.           //WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW
  57.            content:=athread.Connection.ReadLn(LF,10);
  58.            if trim(content)='$REMOTE then
  59.            begin
  60.              athread.Connection.Tag:=8;
  61.              syant:=TScreenSpy.Create(athread.Connection);
  62.              syant.Resume;
  63.              exit;
  64.            end;
  65.            IF (TRIM(CONTENT)='@SYANT@') OR (TRIM(CONTENT)='') THEN
  66.            BEGIN
  67.               application.ProcessMessages;
  68.               exit;
  69.            END;
  70.            UDPMainForm.Writelog('=='+content);
  71.            TCP_message:=content;
  72.            show_info('(TCP)有收到消息: '+content);
  73.            athread.Synchronize(TCP_get_core);
  74.     end;
  75.   except
  76.   end;
  77. end;
复制代码
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|Archiver|手机版|小黑屋|nagomes  

GMT+8, 2025-5-5 01:59 , Processed in 0.027625 second(s), 21 queries .

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表