Android逆向题解1-app1

这个很简单,就是拿versionName和versionName进行异或操作就可以了,versionName和versionName在AM里面设置;

protected void onCreate(Bundle arg3) {
        super.onCreate(arg3);
        this.setContentView(0x7F04001B);
        this.btn = this.findViewById(0x7F0B0058);
        this.text = this.findViewById(0x7F0B0057);
        this.btn.setOnClickListener(new View$OnClickListener() {
            public void onClick(View arg10) {
                try {
                    String v1 = MainActivity.this.text.getText().toString();
                    PackageInfo v2 = MainActivity.this.getPackageManager().getPackageInfo("com.example.yaphetshan.tencentgreat", 0x4000);
                    String v3 = v2.versionName; //v3=versionName
                    int v4 = v2.versionCode;    //v4=versionName
                    int v0 = 0;
                    while(v0 < v1.length()) {
                        if(v0 >= v3.length()) {
                            break;
                        }
 
                        if(v1.charAt(v0) != (v3.charAt(v0) ^ v4)) { //v3和v4异或就ok了,简单
                            Toast.makeText(MainActivity.this, "再接再厉,加油~", 1).show();
                            return;
                        }
                        else {
                            ++v0;
                            continue;
                        }
                    }
 
                    if(v1.length() != v3.length()) {
                        goto label_39;
                    }
 
                    Toast.makeText(MainActivity.this, "恭喜开启闯关之门!", 1).show();
                    return;
                }
                catch(PackageManager$NameNotFoundException v5) {
                }
 
            label_39:
                Toast.makeText(MainActivity.this, "年轻人不要耍小聪明噢", 1).show();
            }
        });
    }
 
AM里面找到versionName和versionName
<manifest android:versionCode="15" android:versionName="X<cP[?PHNB<P?aj"

解密得到flag:

public static void main(String[] args) {
        String versionName="X<cP[?PHNB<P?aj";
        char[] flag=new char[versionName.length()];
        int versionCode =15;
        int i=0;
        while (i<versionName.length()){
            flag[i]= (char) (versionName.charAt(i)^versionCode);
            i++;
        }
        System.out.println(flag);
    }
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值