当前位置: 首页 > article >正文

vm_flutter

附件地址

https://buuoj.cn/match/matches/195/challenges#vm_flutter
可以在buu下载到。
flutter我也不会,只是这个题目加密算法全部在java层,其实就是一个异或和相加。

反编译

package k;

import java.util.Stack;

/* loaded from: classes.dex */
public class b {

    /* renamed from: a  reason: collision with root package name */
    public final Stack<Integer> f740a = new Stack<>();

    /* renamed from: b  reason: collision with root package name */
    public final int[] f741b = new int[50];

    public void a() {
        if (this.f740a.size() >= 2) {
            i(h() << h());
            return;
        }
        throw new RuntimeException("Not enough operands on the stack");
    }

    public void b() {
        if (this.f740a.size() >= 2) {
            i(h() >> h());
            return;
        }
        throw new RuntimeException("Not enough operands on the stack");
    }

    public void c() {
        if (this.f740a.size() >= 2) {
            i(h() + h());
            return;
        }
        throw new RuntimeException("Not enough operands on the stack");
    }

    public void d() {
        if (this.f740a.size() >= 2) {
            i(h() & h());
            return;
        }
        throw new RuntimeException("Not enough operands on the stack");
    }

    public void e(int i2) {
        if (i2 >= 0) {
            int[] iArr = this.f741b;
            if (i2 < iArr.length) {
                i(iArr[i2]);
                return;
            }
        }
        throw new RuntimeException("Invalid memory address");
    }

    public void f() {
        if (this.f740a.size() >= 2) {
            i(h() * h());
            return;
        }
        throw new RuntimeException("Not enough operands on the stack");
    }

    public void g() {
        if (this.f740a.size() >= 2) {
            i(h() | h());
            return;
        }
        throw new RuntimeException("Not enough operands on the stack");
    }

    public int h() {
        if (!this.f740a.isEmpty()) {
            return this.f740a.pop().intValue();
        }
        throw new RuntimeException("Stack underflow");
    }

    public void i(int i2) {
        this.f740a.push(Integer.valueOf(i2));
    }

    public void j(int i2) {
        if (i2 >= 0) {
            int[] iArr = this.f741b;
            if (i2 < iArr.length) {
                iArr[i2] = h();
                return;
            }
        }
        throw new RuntimeException("Invalid memory address");
    }

    public void k() {
        if (this.f740a.size() >= 2) {
            i(h() - h());
            return;
        }
        throw new RuntimeException("Not enough operands on the stack");
    }

    public void l() {
        if (this.f740a.size() >= 2) {
            i(h() ^ h());
            return;
        }
        throw new RuntimeException("Not enough operands on the stack");
    }
}

vm部分在这里
在这里插入图片描述
没有好的方法,直接hook b类的函数,打印日记

frida-hook

function hook(){
    Java.perform(function(){
        const activity = Java.use("k.b");
        activity.a.implementation = function(){
            console.log("Lshift");
        }
        activity.b.implementation = function(){
            console.log("Rshift");
        }
        activity.c.implementation = function(){
            console.log("add");
        }
        activity.d.implementation = function(){
            console.log("and");
        }
        activity.e.implementation = function(x){
            console.log("load "+x);
        }
        activity.f.implementation = function(){
            console.log("mul");
        }
        activity.g.implementation = function(){
            console.log("or");
        }
        activity.h.implementation = function(){
            console.log("pop");
        }
        activity.i.implementation = function(x){
            console.log("push "+x);
        }
        activity.j.implementation = function(x){
            console.log("store "+x);
        }
        activity.k.implementation = function(){
            console.log("sub");
        }
        activity.l.implementation = function(){
            console.log("xor");
        }
    })
}

setImmediate(hook);

这里输入了33个a

push 97
store 0
push 176
push 11
load 0
add
xor
store 0
push 97
store 1
push 198
push 18
load 1
add
xor
store 1
push 97
store 2
push 66
push 5
load 2
add
xor
store 2
push 97
store 3
push 199
push 18
load 3
add
xor
store 3
push 97
store 4
push 170
push 14
load 4
add
xor
store 4
push 97
store 5
push 32
push 13
load 5
add
xor
store 5
push 97
store 6
push 31
push 14
load 6
add
xor
store 6
push 97
store 7
push 60
push 18
load 7
add
xor
store 7
push 97
store 8
push 26
push 13
load 8
add
xor
store 8
push 97
store 9
push 89
push 18
load 9
add
xor
store 9
push 97
store 10
push 60
push 17
load 10
add
xor
store 10
push 97
store 11
push 119
push 19
load 11
add
xor
store 11
push 97
store 12
push 60
push 17
load 12
add
xor
store 12
push 97
store 13
push 90
push 5
load 13
add
xor
store 13
push 97
store 14
push 104
push 13
load 14
add
xor
store 14
push 97
store 15
push 174
push 19
load 15
add
xor
store 15
push 97
store 16
push 146
push 11
load 16
add
xor
store 16
push 97
store 17
push 179
push 5
load 17
add
xor
store 17
push 97
store 18
push 67
push 15
load 18
add
xor
store 18
push 97
store 19
push 73
push 11
load 19
add
xor
store 19
push 97
store 20
push 50
push 12
load 20
add
xor
store 20
push 97
store 21
push 92
push 19
load 21
add
xor
store 21
push 97
store 22
push 170
push 19
load 22
add
xor
store 22
push 97
store 23
push 160
push 9
load 23
add
xor
store 23
push 97
store 24
push 166
push 15
load 24
add
xor
store 24
push 97
store 25
push 47
push 8
load 25
add
xor
store 25
push 97
store 26
push 155
push 19
load 26
add
xor
store 26
push 97
store 27
push 115
push 9
load 27
add
xor
store 27
push 97
store 28
push 60
push 13
load 28
add
xor
store 28
push 97
store 29
push 52
push 12
load 29
add
xor
store 29
push 97
store 30
push 42
push 5
load 30
add
xor
store 30
push 97
store 31
push 96
push 19
load 31
add
xor
store 31
push 97
store 32
push 72
push 7
load 32
add
xor
store 32

所以根据密文异或相应的值,再减去相应的值就行了


http://www.kler.cn/a/104587.html

相关文章:

  • 2016年亚太杯APMCM数学建模大赛A题基于光学信息数据的温度及关键元素含量预测求解全过程文档及程序
  • 利用jupyter进行分类
  • ts json的中boolean布尔值或者int数字都是字符串,转成对象对应类型
  • 数据结构与算法之排序: 侏儒排序 (Typescript版)
  • python版opencv人脸训练与人脸识别
  • 压缩包已知密码却跳过密码界面直接弹出解压
  • k8s快速部署nacos2.2.0集群
  • 深入理解NLP
  • 一文说尽零售数据分析指标体系
  • python+requests+unittest执行自动化接口测试!
  • 在 Python 中使用 Pillow 进行图像处理【2/4】
  • 阿里云服务结构--长期更新
  • 【JavaSE语法】数据类型与变量
  • 微信小程序设计之主体文件app-wxss/less
  • MATLAB R2023b安装包下载链接
  • 华为昇腾NPU卡 大模型LLM ChatGLM2模型推理使用
  • 递归神经网络 (RNN)
  • springboot移除nacos yml无法加载
  • (免费领源码)java#Springboot#mysql装修选购网站99192-计算机毕业设计项目选题推荐
  • FPGA驱动步进电机-Sin曲线加速