小菜鸟吹牛的一天,标题不知道叫啥,app1

5032 0
小菜鸟一枚 2022-4-15 20:17:41 | 显示全部楼层 |阅读模式
## 0x1 app1
  1.jadx工具打开反编译目标apk文件,找到onclick事件,看到关键代码
  1. public void onClick(View v) {
  2.                 try {
  3.                     String inputString = MainActivity.this.text.getText().toString();
  4.                     PackageInfo pinfo = MainActivity.this.getPackageManager().getPackageInfo(BuildConfig.APPLICATION_ID, 16384);
  5.                     String versionCode = pinfo.versionName;
  6.                     int versionName = pinfo.versionCode;
  7.                     for (int i = 0; i < inputString.length() && i < versionCode.length(); i++) {
  8.                         if (inputString.charAt(i) != (versionCode.charAt(i) ^ versionName)) {
  9.                             Toast.makeText(MainActivity.this, "再接再厉,加油~", 1).show();
  10.                             return;
  11.                         }
  12.                     }
  13.                     if (inputString.length() == versionCode.length()) {
  14.                         Toast.makeText(MainActivity.this, "恭喜开启闯关之门!", 1).show();
  15.                         return;
  16.                     }
  17.                 } catch (PackageManager.NameNotFoundException e) {
  18.                 }
  19.                 Toast.makeText(MainActivity.this, "年轻人不要耍小聪明噢", 1).show();
  20.             }
复制代码


&#8195;&#8195;2.看到关键的比较是这一句:
  1. inputString.charAt(i) != (versionCode.charAt(i) ^ versionName
复制代码


&#8195;&#8195;3.再找到BuildConfig这个类,看到了VERSION_CODE和VERSION_NAME的值。
  1. package com.example.yaphetshan.tencentgreat;

  2. /* loaded from: classes.dex */
  3. public final class BuildConfig {
  4.     public static final String APPLICATION_ID = "com.example.yaphetshan.tencentgreat";
  5.     public static final String BUILD_TYPE = "debug";
  6.     public static final boolean DEBUG = Boolean.parseBoolean("true");
  7.     public static final String FLAVOR = "";
  8.     public static final int VERSION_CODE = 15;
  9.     public static final String VERSION_NAME = "X<cp[?phnb<;p?aj";
  10. }
复制代码


&#8195;&#8195;4.转换成代码一跑,得到flag:W3l_T0_GAM3_0ne。

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

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

本版积分规则

中国红客联盟公众号

联系站长QQ:5520533

admin@chnhonker.com
Copyright © 2001-2026 Discuz Team. Powered by Discuz! X3.5 ( 粤ICP备13060014号 )|天天打卡 本站已运行