首页
社区
课程
招聘
[原创]全网唯一 基于Xposed 修改CPU型号以及相关信息
发表于: 2017-3-16 13:43 23458

[原创]全网唯一 基于Xposed 修改CPU型号以及相关信息

2017-3-16 13:43
23458


这个问题困扰了我半个月才解决 很冷门

目前只有008实现了修改CPU型号 但他是为了赚钱不能开源出来供大家学习   

看雪有几个帖子在讨论这个问题 但没人解决了  首先CPU 相关信息都存放在 cpuinfo文件里  频率 型号 等等 都放在里面 

但xpsoed本身不能hook文件 只能根据包名 函数名 进行HOOK 这下子直接卡死 无法实现修改CPU型号 怎么办 

而且cpuinfo是从内核映射上来的  就算改了也没用  

但逆向思维想一下 三方应用进行读取cpuinfo文件 是用流的形式进行读取

那么我们直接把流HOOK 掉 当检测到File 读取系统cpuinfo文件的时候 在SD卡创建一个自定义的cpuinfo文件 强制流读取自己定义的cpuinfo文件  有了思路就可以开始写代码了 但真的很麻烦     直接贴代码


// 核心代码 强制流读取自定义的文件

public class Cpuinfo {

    public Cpuinfo(LoadPackageParam sharePkgParam) {


        FakeCPUFile(sharePkgParam);


    }
    
    
     public static boolean CreatDataCpu(Context context) {

        String str = "/data/data/" + context.getPackageName() + "/cpuinfo";

        // String str2 = "/data/data/" + context.getPackageName() + "/version";

        try {

            AssetManager assets = context.getAssets();

            InputStream open = assets.open("cpuinfo");

            OutputStream fileOutputStream = new FileOutputStream(str);

            writeValue(open, fileOutputStream);

            open.close();

            fileOutputStream.flush();

            fileOutputStream.close();

            // InputStream open2 = assets.open("version");

            // OutputStream fileOutputStream2 = new FileOutputStream(str2);

            // writeValue(open2, fileOutputStream2);

            // open2.close();

            // fileOutputStream2.flush();

            // fileOutputStream2.close();

            Sendfile(str);

            return true;

        } catch (Exception e) {

            return false;

        }

    }
    
    
    private static void writeValue(InputStream inputStream,

            OutputStream outputStream) {

        try {

            byte[] bArr = new byte[AccessibilityNodeInfoCompat.ACTION_NEXT_HTML_ELEMENT];

            while (true) {

                int read = inputStream.read(bArr);

                if (read != -1) {

                    outputStream.write(bArr, 0, read);

                } else {

                    return;

                }

            }

        } catch (Exception e) {

        }

    }
    
     private static void Sendfile(String str) {

        IOException e;

        try {

            DataOutputStream dataOutputStream = new DataOutputStream(Runtime

                    .getRuntime().exec("su").getOutputStream());

            try {

                dataOutputStream.writeBytes("mkdir /sdcard/Test/\n");

                dataOutputStream.flush();

                dataOutputStream.writeBytes("chmod 777 /sdcard/Test/\n");

                dataOutputStream.flush();

                dataOutputStream.writeBytes("cp " + str + " /sdcard/Test/\n");

                dataOutputStream.flush();

                dataOutputStream

                        .writeBytes("chmod 444 /sdcard/Test/cpuinfo\n");

                dataOutputStream.flush();

                dataOutputStream.writeBytes("rm " + str + "\n");

                dataOutputStream.flush();

                // dataOutputStream.writeBytes("cp " + str2 +

                // " /data/misc/sys\n");

                // dataOutputStream.flush();

                // dataOutputStream.writeBytes("chmod 444 /data/misc/sys/version\n");

                // dataOutputStream.flush();

                // dataOutputStream.writeBytes("rm " + str2 + "\n");

                // dataOutputStream.flush();

                dataOutputStream.close();            

                if (new File("/sdcard/Test/cpuinfo").exists()) {

                    return;

                }

                throw new IOException();

            } catch (IOException e2) {

                e = e2;

                DataOutputStream dataOutputStream2 = dataOutputStream;

                e.printStackTrace();

            }

        } catch (IOException e3) {

            e = e3;

            e.printStackTrace();

        }

    }
    
    
     public void FakeCPUFile(LoadPackageParam loadPkgParam) { 
                    try {         
                       XposedBridge.hookAllConstructors(File.class, new XC_MethodHook() {      
                                 @Override             
                                    protected void beforeHookedMethod(MethodHookParam param)   
                                 throws Throwable {    
                            // TODO Auto-generated method stub    
                                  super.beforeHookedMethod(param);   
                       if (param.args.length == 1) {       
                                        if (param.args[0].equals("/proc/cpuinfo")) {
                                       
                               // 自定义文件的路径                       
                                    param.args[0] = "/sdcard/Test/cpuinfo";      
                                                      }  
                                                                   
                                       } else if (param.args.length == 2  && !File.class.isInstance(param.args[0])) {  
                                    String str = "";    
                                      while (i < 2) {  
                                    String stringBuilder;    
                                     if (param.args[i] != null) {  
                                    if (param.args[i].equals("/proc/cpuinfo")) {  
                         param.args[i] = "/sdcard/Test/cpuinfo";   
                                                        }              
                     stringBuilder = new StringBuilder(String .valueOf(str)).append(param.args[i])  .append(":").toString();   
                                } else {   
                             stringBuilder = str;          
                                                 }      
                             i++;                    
                       str = stringBuilder;        
                                         }          
                                                     }     
                                                }      
                                             });
            
            
                                                                            
  XposedHelpers.findAndHookMethod("java.lang.Runtime",
             loadPkgParam.classLoader, "exec", String[].class,
        String[].class, File.class, new XC_MethodHook() {

@Override
protected void beforeHookedMethod(MethodHookParam param)
        throws Throwable {
        // TODO Auto-generated method stub        super.beforeHookedMethod(param);
        if (param.args.length == 1) {
        if (param.args[0].equals("/proc/cpuinfo")) {
        // 自定义文件的路径        param.args[0] = "/sdcard/Test/cpuinfo";
        }

        } else if (param.args.length == 2        && !File.class.isInstance(param.args[0])) {
        int i = 0;
        String str = "";
        while (i < 2) {
        String stringBuilder;
        if (param.args[i] != null) {
        if (param.args[i]
        .equals("/proc/cpuinfo")) {
        param.args[i] = "/sdcard/Test/cpuinfo";
        }

        stringBuilder = new StringBuilder(
        String.valueOf(str))
        .append(param.args[i])
        .append(":").toString();
        } else {
        stringBuilder = str;
        }
        i++;
        str = stringBuilder;
        }
        }
        }

        });
        } catch (Exception e) {
        XposedBridge.log("Fake CPUFile - 1 ERROR: " + e.getMessage());
        }

        try {
        XposedBridge.hookMethod(XposedHelpers.findConstructorExact(
        ProcessBuilder.class, new Class[] { String[].class }),
        new XC_MethodHook() {

protected void beforeHookedMethod(MethodHookParam param)
        throws Throwable {
        // TODO Auto-generated method stub    
            super.beforeHookedMethod(param);
        if (param.args[0] != null) {
        String[] strArr = (String[]) param.args[0];
        String str = "";
        for (String str2 : strArr) {
        str = new StringBuilder(String.valueOf(str))
        .append(str2).append(":")
        .toString();
        if (str2 == "/proc/cpuinfo") {
        strArr[1] = "/sdcard/Test/cpuinfo";
        }

        }
        param.args[0] = strArr;
        }
        }

        });

        } catch (Exception e) {
        XposedBridge.log("Fake CPUFile - 2 ERROR: " + e.getMessage());
        }

        // Pattern.compile("").matcher("");     
           try {
        XposedHelpers.findAndHookMethod("java.util.regex.Pattern",
        loadPkgParam.classLoader, "matcher", CharSequence.class,
        new XC_MethodHook() {

@Override
protected void beforeHookedMethod(MethodHookParam param)
        throws Throwable {
        // TODO Auto-generated method stub     
           super.beforeHookedMethod(param);
        if (param.args.length == 1) {
        if (param.args[0].equals("/proc/cpuinfo")) {
        param.args[0] = "/sdcard/Test/cpuinfo";
        }

        }
        }

        });

        } catch (Exception e) {
        // TODO: handle exception        }


        }

        }
        -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
        接下来就是自定义文件了

        String filePath = "/sdcard/Test/";
        String fileName = "cpuinfo";





        //生成文件夹之后,再生成文件,不然会出错        Mnt.makeFilePath(filePath, fileName);

        String strFilePath = filePath+fileName;
        // 每次写入时,都换行写        String strContent = "Processor    : ARMv7 Processor rev 0 (v7l)" + "\r\n";
        String strContent2 = "processor    : 0" + "\r\n";
        String strContent3 = "BogoMIPS    : 38.40";
        String strContent4 = "" + "\r\n";
        String strContent5 = "" + "\r\n";
        String strContent6 = "processor    : 1"+ "\r\n";
        String strContent7 = "BogoMIPS    : 38.40"+ "\r\n";
        String strContent8 = ""+ "\r\n";
        String strContent9 = "Features    : swp half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt"+ "\r\n";
        String strContent10 = "CPU implementer    : 0x51"+ "\r\n";
        String strContent11 = "CPU architecture: 7"+ "\r\n";
        String strContent12 = "CPU variant    : 0x2"+ "\r\n";
        String strContent13 = "CPU part    : 0x06f"+ "\r\n";
        String strContent14 = "CPU revision    : 0"+ "\r\n";
        String strContent15 = ""+ "\r\n";
        String strContent16 = "Hardware   :MT123     \n";  // 这型号自己随便定义        String strContent17 = "Revision    : 000d"+ "\r\n";
        String strContent18 = "Serial        : 0000088900004e4b"+ "\r\n";
        try {
        File file = new File(strFilePath);
        if (!file.exists()) {
        file.getParentFile().mkdirs();
        file.createNewFile();
        }


        //要先将已有文件删除、避免干扰。        if(file.exists()){
        file.delete();
        }

        RandomAccessFile raf = new RandomAccessFile(file, "rwd");
        raf.seek(file.length());
        raf.write(strContent.getBytes());
        raf.write(strContent2.getBytes());
        raf.write(strContent3.getBytes());
        raf.write(strContent4.getBytes());
        raf.write(strContent5.getBytes());
        raf.write(strContent6.getBytes());
        raf.write(strContent7.getBytes());
        raf.write(strContent8.getBytes());
        raf.write(strContent9.getBytes());
        raf.write(strContent10.getBytes());
        raf.write(strContent11.getBytes());
        raf.write(strContent12.getBytes());
        raf.write(strContent13.getBytes());
        raf.write(strContent14.getBytes());
        raf.write(strContent15.getBytes());
        raf.write(strContent16.getBytes());
        raf.write(strContent17.getBytes());
        raf.write(strContent18.getBytes());
        raf.close();
        } catch (Exception e) {
        Log.e("TestFile", "Error on write File:" + e);
        }




// 生成文件public static File makeFilePath(String filePath, String fileName) {
        File file = null;
        makeRootDirectory(filePath);
        try {
        file = new File(filePath + fileName);
        if (!file.exists()) {
        file.createNewFile();
        }
        } catch (Exception e) {
        e.printStackTrace();
        }
        return file;
        }

// 生成文件夹public static void makeRootDirectory(String filePath) {
        File file = null;
        try {
        file = new File(filePath);
        if (!file.exists()) {
        file.mkdir();
        }
        } catch (Exception e) {
        Log.i("error:", e+"");
        }
        }



    

 就怕被人问怎么用  直接NEW 就行

public void handleLoadPackage(LoadPackageParam sharePkgParam) throws Throwable {
new Cpuinfo(sharePkgParam);
}






就是这样CPU相关信息随便改  所有的坑的都踩过了只要能帮助到需要的朋友就够了 这个真的太冷门了 都得自己想 如果说我有这个需求的时候 能看到这样一篇文件 那怕只有一些参考也是好的    




http://blog.csdn.net/qq_35834055/article/details/62420087  如果对你有帮助 请在CSDN给点个赞 或者评论



[课程]Android-CTF解题方法汇总!

收藏
免费 1
支持
分享
最新回复 (24)
雪    币: 44229
活跃值: (19960)
能力值: (RANK:350 )
在线值:
发帖
回帖
粉丝
2
转一份论坛本地来吧,不然没有评精华或优秀的资格
2017-3-16 16:20
0
雪    币: 9479
活跃值: (757)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
3
只是针对JAVA层的,NDK读取怎么办?
2017-3-16 16:37
0
雪    币: 2121
活跃值: (2509)
能力值: ( LV6,RANK:90 )
在线值:
发帖
回帖
粉丝
4
目前还没发现 过不了的三方应用 所有没考虑NDK 博客会转一份的
2017-3-16 17:57
0
雪    币: 2121
活跃值: (2509)
能力值: ( LV6,RANK:90 )
在线值:
发帖
回帖
粉丝
5
快下班了 明天导一份到看雪 CSDN 基本没人看这种博客
2017-3-16 17:59
0
雪    币: 76
活跃值: (13)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
6

这标题  。。。

2017-3-17 15:28
0
雪    币: 105
活跃值: (539)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
7
去年就做过了,不hook SO,只在Java层没用,,想好多刷量的都能检测到的,人家还有大数据的,,,
2017-3-18 10:11
0
雪    币: 1366
活跃值: (5584)
能力值: ( LV3,RANK:25 )
在线值:
发帖
回帖
粉丝
8
不知道,感觉应该可以,在app里面可以弄。
adb就不能了。
2017-5-9 18:04
0
雪    币: 0
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
9
安兔兔就hook不掉
2017-5-26 02:45
0
雪    币: 2121
活跃值: (2509)
能力值: ( LV6,RANK:90 )
在线值:
发帖
回帖
粉丝
10
HOOK的就是安兔兔  要配置环境的
2017-5-26 09:37
0
雪    币: 4
活跃值: (29)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
11

还全网唯一,看到你hook  file类我就醉了,你不知道还有个更底层的类叫  IoBridge  么,只要hook  open方法,把路径参数修改成我们指定的文件路径就ok了,hook  file类不能拦截所有文件操作

2017-5-30 01:23
0
雪    币: 9479
活跃值: (757)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
12

  更底层还有fopen和open,对应内核的do_filp_open。

2017-5-30 03:11
0
雪    币: 241
活跃值: (226)
能力值: ( LV3,RANK:30 )
在线值:
发帖
回帖
粉丝
13
很纳闷  文章有几处明显的错误  怎么会得精华?
2017-6-1 01:50
0
雪    币: 2121
活跃值: (2509)
能力值: ( LV6,RANK:90 )
在线值:
发帖
回帖
粉丝
14
无语  代码运行的很稳定  哪里有错误?  你们行  你们去写啊!  我之前找遍网上也没看到有改CPU的  现在分享出来  你们一个个来着乱叫
2017-6-1 09:24
0
雪    币: 9479
活跃值: (757)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
15
/proc/cpuinfo,这个真没人写,我估计不是hook  open,就是hook内核。
2017-6-1 11:08
0
雪    币: 241
活跃值: (226)
能力值: ( LV3,RANK:30 )
在线值:
发帖
回帖
粉丝
16

1:引用原文代码:

XposedBridge.hookAllConstructors(File.class, new XC_MethodHook() {      
 @Override             
protected void beforeHookedMethod(MethodHookParam param)   
 throws Throwable {    
// TODO Auto-generated method stub    
  super.beforeHookedMethod(param);   
   if (param.args.length == 1) {       
if (param.args[0].equals("/proc/cpuinfo")) {
   // 自定义文件的路径                       
param.args[0] = "/sdcard/Test/cpuinfo";      
  }  
   } else if (param.args.length == 2  && !File.class.isInstance(param.args[0])) {  
String str = "";    
  while (i < 2) {  
String stringBuilder;    
 if (param.args[i] != null) {  
if (param.args[i].equals("/proc/cpuinfo")) {  
 param.args[i] = "/sdcard/Test/cpuinfo";   
}              
 stringBuilder = new StringBuilder(String .valueOf(str)).append(param.args[i])  .append(":").toString();   
} else {   
 stringBuilder = str;          
 }      
 i++;                    
   str = stringBuilder;        
 }          
 }     
}      
 });

File类有4个构造函数 你只能正确HOOK了其中1个 也就是public File(String path)

虽然你拦截了2个参数的构造方法 但是如果使用 new File("/proc/","cpuinfo");这种方式 你的方法根本检测不到 就更不用说其他几种参数类型的构造方法了

附:

public File(File dir, String name)
public File(String path)
public File(String dirPath, String name)
public File(URI uri)

上面的4个构造函数 你原文中的代码能拦截到几个?

2:引用原文代码:

//生成文件夹之后,再生成文件,不然会出错        Mnt.makeFilePath(filePath, fileName);
String strFilePath = filePath+fileName;
// 每次写入时,都换行写        String strContent = "Processor    : ARMv7 Processor rev 0 (v7l)" + "\r\n";
String strContent2 = "processor    : 0" + "\r\n";
String strContent3 = "BogoMIPS    : 38.40";
String strContent4 = "" + "\r\n";
String strContent5 = "" + "\r\n";
String strContent6 = "processor    : 1"+ "\r\n";
String strContent7 = "BogoMIPS    : 38.40"+ "\r\n";
String strContent8 = ""+ "\r\n";
String strContent9 = "Features    : swp half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt"+ "\r\n";
String strContent10 = "CPU implementer    : 0x51"+ "\r\n";
String strContent11 = "CPU architecture: 7"+ "\r\n";
String strContent12 = "CPU variant    : 0x2"+ "\r\n";
String strContent13 = "CPU part    : 0x06f"+ "\r\n";
String strContent14 = "CPU revision    : 0"+ "\r\n";
String strContent15 = ""+ "\r\n";
String strContent16 = "Hardware   :MT123     \n";  // 这型号自己随便定义        String strContent17 = "Revision    : 000d"+ "\r\n";
String strContent18 = "Serial        : 0000088900004e4b"+ "\r\n";

这个功能模块的应用场景不用我再提醒 既然要过检测 你的CPU的各个参数就不可能是写死的 因为大部分厂商对每个机型对应的CPU细节也必然是掌握的

提供给你100个手机对应的CPU型号拿去玩 见附录

4 你改的还不全 至少我依然有很多办法从java层获得CPUINFO 当然 没有人能把所有的检测都堵死 这是事实。但你应该在更底层的角度去考虑 例如11楼说的IoBridge 虽然我也是第一次听说这个比File更底层的方法 但是我敢于承认自己学习上的不足。

5 并不是只有008解决了这个问题 而且你肯定也不是全网唯一 虽然网络上大环境造就了很多标题党 但我建议在一个技术论坛里 无论说什么做什么一定要严谨。

另外 代码运行没问题 不代表没错 Windows Linux MAC 看起来运行也都很流畅 但补丁是永远打不完的 把自己心态放端正 有错误要及时的修正 并引以为戒避免下次出现相同的问题

附 100个机型对应的CPU型号

model,manufacturer,cpu
SM-J3110,samsung,Qualcomm Technologies, Inc MSM8916
SM-N9109W,samsung,Qualcomm APQ8084
GT-I9508,samsung,SAMSUNG JF
SM-N9200,samsung,SAMSUNG Exynos7420
SM-G9250,samsung,SAMSUNG Exynos7420
SM-G9208,samsung,SAMSUNG Exynos7420
Mi-4c,Xiaomi,Qualcomm Technologies, Inc MSM8992
MI NOTE Pro,Xiaomi,Qualcomm Technologies, Inc MSM8994
SM-G9280,samsung,SAMSUNG Exynos7420
MI 2SC,Xiaomi,MI 2
SM-G9198,samsung,Qualcomm Technologies, Inc MSM8992
Redmi Note 2,Xiaomi,MT6795M
SM-G9300,samsung,Qualcomm Technologies, Inc MSM8996
GT-I9507V,samsung,SAMSUNG JF
SM-N9009,samsung,Qualcomm MSM 8974 (Flattened Device Tree)
SM-N9100,samsung,Qualcomm APQ8084
SM-W2015,samsung,Qualcomm MSM8974PRO-AC
GT-I9300,samsung,SMDK4x12
SM-G8508S,samsung,Qualcomm MSM 8974 (Flattened Device Tree)
HM NOTE 1S,Xiaomi,Qualcomm Technologies, Inc MSM8916
Redmi Note 3,Xiaomi,Qualcomm Technologies, Inc MSM8956
2014813,Xiaomi,Qualcomm Technologies, Inc MSM8916
GT-I9152P,samsung,Qualcomm MSM 8226 (Flattened Device Tree)
GT-I9308,samsung,SMDK4x12
SM-N900V,samsung,Qualcomm MSM8974
2014501,Xiaomi,MT6582
2014811,Xiaomi,Qualcomm Technologies, Inc MSM8916
SM-A5000,samsung,Qualcomm Technologies, Inc MSM8916
HM NOTE 1LTE,Xiaomi,Qualcomm MSM 8226 (Flattened Device Tree)
Redmi 3,Xiaomi,Qualcomm Technologies, Inc MSM8939
SM-G5108Q,samsung,Qualcomm Technologies, Inc MSM8916
SM-G3502I,samsung,Qualcomm MSM 8610 (Flattened Device Tree)
SM-A3000,samsung,Qualcomm Technologies, Inc MSM8916
SM-N9108V,samsung,Qualcomm APQ8084
KNT-AL10,HUAWEI,Hisilicon Kirin 950
HUAWEI TAG-TL00,HUAWEI,MT6753T
SM-C101,samsung,SMDK4x12
FRD-AL00,HUAWEI,Hisilicon Kirin 950
EVA-AL10,HUAWEI,Hisilicon Kirin 955
SCL-TL00,HUAWEI,Qualcomm Technologies, Inc MSM8909
HUAWEI RIO-TL00,HUAWEI,Qualcomm MSM 8939 HUAWEI RIO-TL00
HUAWEI TIT-AL00,HUAWEI,MT6735
PLK-TL01H,HUAWEI,Hisilicon Kirin 935
SCH-I959,samsung,UNIVERSAL5410
HUAWEI GRA-CL00,HUAWEI,Hisilicon Kirin 930
HUAWEI GRA-CL10,HUAWEI,Hisilicon Kirin 935
SM-N7508V,samsung,Qualcomm MSM 8226 (Flattened Device Tree)
SM-A9100,samsung,Qualcomm Technologies, Inc MSM8976
SCL-AL00,HUAWEI,Qualcomm Technologies, Inc MSM8909
ATH-AL00,HUAWEI,Qualcomm MSM 8939 HUAWEI ATH-AL00
SM-G7106,samsung,Qualcomm MSM 8226 (Flattened Device Tree)
SM-G5306W,samsung,Qualcomm Technologies, Inc MSM8916
KIW-AL10,HUAWEI,Qualcomm MSM 8939 HUAWEI KIW-AL10
ATH-CL00,HUAWEI,Qualcomm MSM 8939 HUAWEI Athena CL
GT-N7102,samsung,SMDK4x12
SM-G7508Q,samsung,Qualcomm Technologies, Inc MSM8916
PLK-UL00,HUAWEI,Hisilicon Kirin 935
HUAWEI GRA-UL10,HUAWEI,Hisilicon Kirin 935
SM-A9000,samsung,Qualcomm Technologies, Inc MSM8976
SM-G9092,samsung,Qualcomm MSM 8974 (Flattened Device Tree)
SCH-P729,samsung,SAMSUNG MELIUS
HUAWEI RIO-AL00,HUAWEI,Qualcomm MSM 8939 HUAWEI RIO-AL00_VB
SM-A7000,samsung,Qualcomm Technologies, Inc MSM8939
SM-G5308W,samsung,Qualcomm Technologies, Inc MSM8916
HUAWEI GRA-UL00,HUAWEI,Hisilicon Kirin 930
SM-C5000,samsung,Qualcomm Technologies, Inc MSM8952
SM-G6000,samsung,Qualcomm Technologies, Inc MSM8916
GEM-703L,HUAWEI,unknown
SM-C7000,samsung,Qualcomm Technologies, Inc MSM8953
SM-J3109,samsung,Qualcomm Technologies, Inc MSM8916
HUAWEI RIO-UL00,HUAWEI,Qualcomm MSM 8939 HUAWEI RIO-TL00
SM-A5009,samsung,Qualcomm Technologies, Inc MSM8916
SM-G9350,samsung,Qualcomm Technologies, Inc MSM8996
HUAWEI CRR-CL00,HUAWEI,Hisilicon Kirin 935
HUAWEI CRR-UL00,HUAWEI,Hisilicon Kirin 935
ALE-UL00,HUAWEI,hi6210sft
HUAWEI P8max,HUAWEI,Hisilicon Kirin 935
SCL-TL00H,HUAWEI,Qualcomm Technologies, Inc MSM8909
HUAWEI NXT-DL00,HUAWEI,Hisilicon Kirin 950
HUAWEI TIT-TL00,HUAWEI,MT6735
HUAWEI CRR-UL20,HUAWEI,Hisilicon Kirin 935
HUAWEI RIO-CL00,HUAWEI,Qualcomm MSM 8939 HUAWEI RIO-CL00_VB
ATH-UL00,HUAWEI,Qualcomm MSM 8939 HUAWEI ATH-TL00
CHM-TL00,HUAWEI,hi6210sft
H60-L12,HUAWEI,Kirin920
CHM-UL00,HUAWEI,hi6210sft
HUAWEI MT7-UL00,HUAWEI,Kirin925
CHM-CL00,HUAWEI,Qualcomm Technologies, Inc MSM8939
H30-C00,HUAWEI,Qualcomm MSM 8x1x (Flattened Device Tree)
HONOR H30-L02,HUAWEI,hi6620oem
HUAWEI C199s,HUAWEI,Qualcomm Technologies, Inc MSM8939
PE-TL20,HUAWEI,Kirin925
HUAWEI ALE-CL00,HUAWEI,Qualcomm Technologies, Inc MSM8939
HUAWEI MT7-CL00,HUAWEI,Hisilicon Kirin 925
PE-TL10,HUAWEI,Kirin925
CHE-TL00,HUAWEI,hi6210sft
Che1-CL10,HUAWEI,Qualcomm Technologies, Inc MSM8916
HUAWEI MT7-TL00,HUAWEI,Kirin925
PE-CL00,HUAWEI,Kirin925
HUAWEI Y535-C00,HUAWEI,Qualcomm MSM 8610 (Flattened Device Tree)


2017-6-5 13:07
0
雪    币: 2121
活跃值: (2509)
能力值: ( LV6,RANK:90 )
在线值:
发帖
回帖
粉丝
17

醉了  你可知道  我写完了代码  基本都没用上    没有上线实测过  老板有钱还是用008神器  几千台手机 每台一天5块钱的用着  冤大头 我也很委屈啊 不被人认可价值 这只是个雏形 并没有继续改进

2017-6-5 14:10
0
雪    币: 2121
活跃值: (2509)
能力值: ( LV6,RANK:90 )
在线值:
发帖
回帖
粉丝
18
至于我的标题全网唯一  是这么改CPU信息  HOOK形式  就我这一份 
2017-6-5 14:12
0
雪    币: 9479
活跃值: (757)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
19
//ndk读取示例
sprintf(filename,"/proc/cpuinfo");
int fp = open(filename, O_RDONLY );


2017-6-8 08:34
0
雪    币: 32
活跃值: (247)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
20
谢谢分享,学习了
2017-6-10 02:32
0
雪    币: 223
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
21
2017-6-13 11:05
0
雪    币: 1366
活跃值: (5584)
能力值: ( LV3,RANK:25 )
在线值:
发帖
回帖
粉丝
22
打酱油。感谢楼主分享。
2017-7-6 14:44
0
雪    币: 330
活跃值: (105)
能力值: ( LV3,RANK:20 )
在线值:
发帖
回帖
粉丝
23

这个是我自己用的,文件重新指向,顺便说一下本人应用变量的作者。

            // 拦截判断是否ROOT
            XposedBridges.getInstance().hookAllConstructors(File.class, new XC_MethodHook() {
                @Override
                protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
                    if (param.args.length > 0 && param.args[0] != null) {
                        JSONObject jsonObject1 = new JSONObject(jsonObject.getString("java.io.File.constructors"));
                        if (jsonObject1.has(param.args[0].toString())) {
                            Log.d(TAG, "File:Constructors:beforeHookedMethod:" + param.args[0].toString() + ":" + jsonObject1.getString(param.args[0].toString()));
                            param.args[0] = jsonObject1.getString(param.args[0].toString());
                        }
                        switch (param.args[0].toString()) {
                            case "/system/bin/su":
                            case "/system/xbin/su":
                            case "/system/sbin/su":
                            case "/system/bin/busybox":
                                Log.d(TAG,"File:Constructors:beforeHookedMethod:" + Arrays.toString(param.args));
                                param.args[0] = "/system/bin/null";
                        }
                    }
                }
            });

同样也放出一个怎么样拦截GPU信息的代码吧,之前一直在想GPU信息怎么样拦截

//            GPU拦截
//            XposedBridges.getInstance().hookAllMethods("android.opengl.GLSurfaceView.EglHelper", loadPackageParam.classLoader, "createGL", new XC_MethodHook() {
//                @Override
//                protected void afterHookedMethod(MethodHookParam param) throws Throwable {
//                    try {
//                        GL10 gl10 = (GL10) param.getResult();
//                        Log.d(TAG, "=========:" + gl10.glGetString(GL10.GL_RENDERER));
//                        XposedHelpers.findAndHookMethod(gl10.getClass(), "glGetString", int.class, new XC_MethodHook() {
//                            @Override
//                            protected void afterHookedMethod(MethodHookParam param) throws Throwable {
//                                if ((int)(param.args[0]) == GL10.GL_RENDERER ) {
//                                    param.setResult("111111111111111");
//                                }
//                            }
//                        });
//                    } catch (Throwable e) {
//                        Log.e(TAG, e.getLocalizedMessage(), e);
//                    }
//                }
//            });



2017-7-6 15:18
0
雪    币: 9
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
24
世界美景 醉了&nbsp; 你可知道&nbsp; 我写完了代码&nbsp; 基本都没用上&nbsp; &nbsp; 没有上线实 ...
用收费有用收费的道理,收费的数据够真实,都是从真实手机上获取到的数据,不像自己做的,“随便”改数据
2017-12-14 17:10
0
雪    币: 55
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
25
感谢分享,截至今天你这个还是全网唯一一份公开的修改CPUinfo的方案,百度搜了好久,应该不算挖坟吧
2018-8-25 09:14
0
游客
登录 | 注册 方可回帖
返回
//