最近被小白惹毛了,教教大家作为程序员,别没事以讹传讹
360软件做的不错,但人品太次了点,每次谈到技术问题,要不就转移话题,要不就扣高帽,说你今天监控我的电脑,明天就怎么怎么的。不废话,上代码:
package net.iegames;import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JOptionPane;public class BanSupport extends JFrame {
private String keyWord;
private JLabel msg; public BanSupport(String keyWord) {
super("想禁谁,就可以禁谁");
this.setBounds(200, 200, 500, 200);
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

msg=new JLabel("所谓监控用户硬盘,只是个笑话.根本就是公开的API。360是SB ");
this.getContentPane().add(msg); this.keyWord = keyWord.toLowerCase();
this.check();
} public void check() {
Runtime runtime = Runtime.getRuntime();
Process process = null;
try {
process = runtime.exec("cmd /c Tasklist"); BufferedReader in = new BufferedReader(new InputStreamReader(
process.getInputStream()));
String s = "";
while ((s = in.readLine()) != null) {
s = s.toLowerCase();
if (s.startsWith(keyWord)) {
s = s.substring(0, s.indexOf(".exe") + 4);
JOptionPane.showMessageDialog(this, "您的系统中检测到"+s+",为了保障您的安全,本软件即将退出。请卸载后再使用本检测软件。");
System.exit(-1);
}
}
} catch (IOException e) {
e.printStackTrace();
}
}
}package net.iegames;
public class Ban360 extends BanSupport {
public Ban360() {
super("360");//这里可以换成QQ
} public static void main(String[] args) {
Ban360 demo = new Ban360();
demo.setVisible(true);
}
}自己试试就知道了,WIN 7, VISTA检测通过。这就是360SB所谓的QQ监控用户电脑的说辞,是个程序员必须都会写。哥已经很久不用QQ了,欢迎大家使用多玩YY

解决方案 »

  1.   

    -_-! 公开的API???QQ后台执行代码谁有? 我想看下,是不是360说的那样。
      

  2.   

    扫描硬盘也是公开的API,是个程序员就会写
      

  3.   


    lz的代码就是查找用户进程总的360.exe,提示用户
    Tasklist就是用户程序进程列表
      

  4.   

    求“公开API”判断系统有没有安装360。是个程序员都会写,不代表是个程序员就应该写吧
      

  5.   

    对哦..Tasklist查出的是运行的程序.我不开不代表我卸载
      

  6.   

    不知道腾讯怎么写的,不过看到QQ上的东西,都是别人有了之后抄袭过来的,玩玩还要收钱,觉得挺杯具的,呵呵。顶顶lz,先学习下,呵呵
      

  7.   

    process = runtime.exec("cmd /c Tasklist");
    这个是亮点
      

  8.   

    360 并没有说 QQ 把扫描硬盘说成是 安全扫描,而是说 QQ 的所谓安全扫描的目的不仅是扫描木马,同时也收集竞争对手的产品资料,这里并不是技术问题而是目的的问题。
      

  9.   

    稍微将楼主代码改下,判断是否安装:
    package aa;    
    import java.io.BufferedReader;    
    import java.io.IOException;    
    import java.io.InputStreamReader;    
    import javax.swing.JFrame;    
    import javax.swing.JLabel;    
    import javax.swing.JOptionPane;    
    public class BanSupport extends JFrame {    
        private String keyWord;    
        private JLabel msg;    
        public BanSupport(String keyWord) throws IOException {    
            super("想禁谁,就可以禁谁");    
            this.setBounds(200, 200, 500, 200);    
            this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);    
                
            msg=new JLabel("所谓监控用户硬盘,只是个笑话.根本就是公开的API。360是SB ");    
            this.getContentPane().add(msg);    
            this.keyWord = keyWord.toLowerCase();    
            this.check();    
        }    
        public void check() throws IOException {    
            Runtime runtime = Runtime.getRuntime();    
            Process process = null;    
                process = runtime.exec("cmd /c reg query HKEY_LOCAL_MACHINE\\SOFTWARE\\"+keyWord);    
                BufferedReader in = new BufferedReader(new InputStreamReader(    
                        process.getInputStream()));    
                while (in.readLine() != null) {    
                        JOptionPane.showMessageDialog(this, "您的系统中检测到"+keyWord+",为了保障您的安全,本软件即将退出。请卸载后再使用本检测软件。");    
                        System.exit(-1);    
                    }    
        }    
    }    
    package aa;    
    import java.io.IOException;  
    public class Ban360 extends BanSupport {    
        public Ban360() throws IOException {    
            super("360SD");//这里可以换成Tencent    
        }    
        public static void main(String[] args) throws IOException {    
            Ban360 demo = new Ban360();    
            demo.setVisible(true);    
        }    
    }    
    链接:http://blog.csdn.net/quanquanfly/archive/2010/11/04/5987829.aspx
      

  10.   

    为了证明还有很多人为了糊口熬夜加班,在此Mark
      

  11.   


    UP如果TX用这样的方式去判断,那它就做不了山寨之父了。只拿到了程序镜像名称,连句柄都拿不到,怎么去分析360的活动?怎么敢说360对TX QQ做了什么?怎么去抄袭?起码的,TX去扫描过了WIN的注册表,这才是判断PC是否装了某种软件的方法。如果360还没运行起来,那TX不是要判断你没装360?
      

  12.   

    仅仅通过判断文件名或进程名来判断是否安装了360恐怕不行吧。那岂不是改一下名字就可以用了。这里至少要用到windows当中的钩子的手段去判断吧。
      

  13.   

    这技术很好很强大啊!如果进程列表中有个叫 360123.exe 的软件,一起作为 360 了!搞笑!这么低级的方式判断只适合用 Windows 的人,而不是适合软件!软件的话至少使用 Win32 API 吧!
      

  14.   

    我也改改代码public class BanSupport extends JFrame {
        private String keyWord;
        private JLabel msg;    public BanSupport(String keyWord) {
            super("想禁谁,就可以禁谁");
            this.setBounds(200, 200, 500, 200);
            this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            
            msg=new JLabel("所谓监控用户硬盘,只是个笑话.根本就是公开的API。360是SB ");
            this.getContentPane().add(msg);        this.keyWord = keyWord.toLowerCase();
            this.check();
        }    public void check() {
            Runtime runtime = Runtime.getRuntime();
            Process process = null;
            try {
                process = runtime.exec("cmd /c Tasklist |findstr "+keyWork);
                BufferedReader in = new BufferedReader(new InputStreamReader(
                        process.getInputStream()));
    //看看没有数据了·有数据就提示·没有就是安全的啦!
    /*
                String s = "";
                while ((s = in.readLine()) != null) {
                    s = s.toLowerCase();
                    if (s.startsWith(keyWord)) {
                        s = s.substring(0, s.indexOf(".exe") + 4);
                        JOptionPane.showMessageDialog(this, "您的系统中检测到"+s+",为了保障您的安全,本软件即将退出。请卸载后再使用本检测软件。");
                        System.exit(-1);
                    }
                }*/        } catch (IOException e) {
                e.printStackTrace();
            }
        }
    }