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

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.lryc.cn/news/210860.html

相关文章:

  • MySQL数据库#6
  • YOLO v1(2016.5)
  • SQL比较两次的字段集合,找出并返回差异,主要用于更新记录事件
  • muduo源码剖析之Acceptor监听类
  • express session JWT JSON Web Token
  • 负载均衡策略 LVS
  • 驱动开发6 IO多路复用——epoll
  • 【python学习笔记——列表】
  • TensorRT量化实战课YOLOv7量化:YOLOv7-PTQ量化(一)
  • [微信小程序踩坑]微信小程序editor富文本组件渲染字符串时,内部图片超出大小导致无法正常渲染或回显(数据传输长度为 3458 KB,存在有性能问题!)
  • USACO12OPEN Balanced Cow Subsets G(meet in the middle)
  • GIT常用操作记录
  • 【ETL工具】Datax-ETL-SqlServerToHDFS
  • Kubernetes (K8S)概述
  • 11月14号|Move生态Meetup相约浪漫土耳其
  • mac vim没有颜色 问题
  • Servlet核心API
  • crs 维护模式 exclusive mode
  • 【OpenCV实现平滑图像形态学变化】
  • Ubuntu服务器中java -jar 后台运行Spring Boot项目
  • 微服务parent工程和子工程pom文件配置注意
  • STM32G030F6P6点灯闪烁
  • K8s开发人员也需要了解的相关知识
  • 创建并启动华为HarmonyOS本地与远程模拟器及远程真机
  • 责任链模式应用案例
  • 给你一个整数 num ,返回 num 中能整除 num 的数位的数目
  • Java后端开发——房贷计算器(Ajax版、Json版、等额本息+等额本金)
  • 2023.10.28 关于 synchronized 原理
  • 力扣 27. 移除元素
  • redis爆满导致数据丢失