Square CTF 2023-There Is A bug

唉,主动调用往往只需要最朴素的方法:

1702305271114

context是上下文啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊

frida:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
Java.perform(function () {
var MainActivity = Java.use('com.example.authenticator.MainActivity');

MainActivity.onCreate.implementation = function () {
// 调用原始的onCreate方法
this.onCreate.apply(this, arguments);

// 获取ActivityMainBinding实例
var binding = this.binding.value;
var tvInstance = binding.sampleText.value;
var etInstance = binding.editTextTextPassword.value;
var sharedPreferences = this.getSharedPreferences.overload('java.lang.String', 'int').call(this, 'file.txt', 0);

var result = this.getFlag(tvInstance, etInstance, this, sharedPreferences);

console.log('getFlag result:', result);
};
});