分析-王者荣耀皮肤

解锁

image.png
image.png
image.png
image.png
image.png
这个apk中的关键信息是,需要激活设备管理器,然后当激活完成后,apk会黑屏,可以发现系统被上锁,值系统屏幕锁密码被改.关键的函数有两个,都是激活管理器的函数.
1.LockNow();
2.resetPassword();

卸载

image.png
image.png

去掉锁屏

卸载之后依然有锁屏密码
image.png
image.png
删除系统文件中密码文件:/data/system/password.key
image.png

分析-秒抢红包

image.png
image.png
image.png

第一层密码分析

image.png
image.png
image.png
hbCode.zip

DU.java(用的是jadx的Java代码)

  1. package com.company;
  2. import javax.crypto.Cipher;
  3. import javax.crypto.spec.SecretKeySpec;
  4. import java.security.Key;
  5. public class DU {
  6. private static String strDefaultKey = "national";
  7. private Cipher decryptCipher = (Cipher)null;
  8. private Cipher encryptCipher = (Cipher)null;
  9. public DU()
  10. throws Exception
  11. {
  12. this(strDefaultKey);
  13. }
  14. public DU(String paramString)
  15. {
  16. try
  17. {
  18. Key key = getKey(paramString.getBytes());
  19. this.encryptCipher = Cipher.getInstance("DES");
  20. this.encryptCipher.init(1, key);
  21. this.decryptCipher = Cipher.getInstance("DES");
  22. this.decryptCipher.init(2, key);
  23. return;
  24. }
  25. catch (Exception e)
  26. {
  27. e.printStackTrace();
  28. }
  29. }
  30. public static String byteArr2HexStr(byte[] paramArrayOfByte)
  31. throws Exception
  32. {
  33. int k = paramArrayOfByte.length;
  34. StringBuffer localStringBuffer = new StringBuffer(k * 2);
  35. int i = 0;
  36. if (i >= k) {
  37. return localStringBuffer.toString();
  38. }
  39. int j = paramArrayOfByte[i];
  40. for (;;)
  41. {
  42. if (j >= 0)
  43. {
  44. if (j < 16) {
  45. localStringBuffer.append('0');
  46. }
  47. localStringBuffer.append(Integer.toString(j, 16));
  48. i += 1;
  49. break;
  50. }
  51. j += 256;
  52. }
  53. return null;
  54. }
  55. private Key getKey(byte[] paramArrayOfByte)
  56. throws Exception
  57. {
  58. byte[] arrayOfByte = new byte[8];
  59. int i = 0;
  60. for (;;)
  61. {
  62. if ((i >= paramArrayOfByte.length) || (i >= arrayOfByte.length)) {
  63. return new SecretKeySpec(arrayOfByte, "DES");
  64. }
  65. arrayOfByte[i] = paramArrayOfByte[i];
  66. i += 1;
  67. }
  68. }
  69. public static byte[] hexStr2ByteArr(String paramString)
  70. throws Exception
  71. {
  72. byte[] bytes = paramString.getBytes();
  73. int j = bytes.length;
  74. byte[] arrayOfByte = new byte[j / 2];
  75. int i = 0;
  76. for (;;)
  77. {
  78. if (i >= j) {
  79. return arrayOfByte;
  80. }
  81. String str = new String(bytes, i, 2);
  82. arrayOfByte[(i / 2)] = ((byte)Integer.parseInt(str, 16));
  83. i += 2;
  84. }
  85. }
  86. public String decrypt(String paramString)
  87. throws Exception
  88. {
  89. return new String(decrypt(hexStr2ByteArr(paramString)));
  90. }
  91. public byte[] decrypt(byte[] paramArrayOfByte)
  92. throws Exception
  93. {
  94. return this.decryptCipher.doFinal(paramArrayOfByte);
  95. }
  96. public String encrypt(String paramString)
  97. throws Exception
  98. {
  99. return byteArr2HexStr(encrypt(paramString.getBytes()));
  100. }
  101. public byte[] encrypt(byte[] paramArrayOfByte)
  102. throws Exception
  103. {
  104. return this.encryptCipher.doFinal(paramArrayOfByte);
  105. }
  106. }

Main.java(用的是java compiler里边的代码)

  1. package com.company;
  2. public class Main {
  3. public static void main(String[] args) {
  4. // write your code here
  5. DU des = new DU("flower");
  6. try {
  7. des = new DU(des.decrypt("c29fe56fa59ab0db"));
  8. System.out.println(des.decrypt("df24aefb99a46b13700ecb6bb7b627a9"));
  9. } catch (Exception e) {
  10. e.printStackTrace();
  11. }
  12. }
  13. }

image.png

Smali 注入

image.png
image.png
image.png
image.png
image.png

日志里边得到密码
image.png
image.png

在Android Killer里边自带的日志查看
image.png
image.png