firda基础API及语法
# 语法
# api
# Java.perform
# Java.choose
Java.perform(function () {
Java.choose("com.bytedance.mobsec.metasec.ml.MSManager", {
onMatch: function (instance) {
instance_ = instance;
Java.registerInstance(instance_)
return "stop"
},
onComplete: function () {
console.log("Done")
}
})
})
1
2
3
4
5
6
7
8
9
10
11
12
2
3
4
5
6
7
8
9
10
11
12
# Java.registerInstance
# 开源库
# fridaUiTools
https://github.com/dqzg12300/fridaUiTools
1
# hooker
https://github.com/CreditTone/hooker
1
# r0capture
https://github.com/r0ysue/r0capture
1
# r0tracer
https://github.com/r0ysue/r0tracer
1
# AndroidSecurityStudy
# 精选文章
https://github.com/r0ysue/AndroidSecurityStudy
1
2
2
# 常用函数
# map2str
var Map = Java.use('java.util.HashMap');
var args_x = Java.cast(result, Map);
console.log("result", args_x)
1
2
3
4
2
3
4
# mapToString
function mapToString(hash_map) {
var result = "";
var keyset = hash_map.keySet();
var it = keyset.iterator();
while (it.hasNext()) {
var keystr = it.next().toString();
var valuestr = hash_map.get(keystr).toString();
result += keystr + "=" + valuestr + "&";
}
return result.substring(0, result.length - 1);
}
1
2
3
4
5
6
7
8
9
10
11
2
3
4
5
6
7
8
9
10
11
# bin2str
function bytesToString(bytes) {
var javaString = Java.use('java.lang.String');
return javaString.$new(bytes);
}
function stringToBytes(str) {
var javaString = Java.use('java.lang.String');
var bytes = [];
bytes = javaString.$new(str).getBytes();
return bytes;
}
1
2
3
4
5
6
7
8
9
10
11
2
3
4
5
6
7
8
9
10
11
# 参考
上次更新: 2023-06-27 16:49:11