飞鸽传书 是用什么样方法遍历获取局域网内登录用户相关信息得?

解决方案 »

  1.   

    WinPcap将网卡设置为混杂模式, 然后截取数据通信,  能够在 以太网帧头 获取到物理地址typedef   struct   ethhdr  
      {  
      uchar     ether_dhost[6]; //目标MAC地址  
      uchar     ether_shost[6]; //原始MAC地址  
      ushort   ether_type; //以太帧类型  
      }ethhdr;   
    IP头可以获取到 typedef   struct   iphdr  
      {  
      unsigned   char   version:4; //version  
      unsigned   char   ihl:4; //ip   header   length  
      uchar     tos; //type   of   service  
      ushort   tot_len; //total   length  
      ushort   id; //identification  
      ushort   frag_off; //fragment   offset  
      uchar     ttl; //time   to   live  
      uchar     protocol; //protocol   type  
      ushort   check; //check   sum  
      uint       saddr; //source   address  
      uint       daddr; //destination   address  
      }iphdr;   
      

  2.   

    没有研究过源代码,但是估计用UDP可以实现。
      

  3.   

    飞鸽传书源码看过,使用广播,至于用户信息,是自己调用getusername()之类的API得到然后封包发给其它host的