alphc
求更新jsc的逆向,网上这块基本没资料
Java.perform(function () {
function awaitForCondition(func,soName) {
var delay = 10;
var intervalPointer = setInterval(function() {
if (Process.findModuleByName(soName)) {
clearInterval(intervalPointer);
func();
}
}, delay);
}
var dump = false;
function starthook() {
const xxtea_decryptaddr = Module.findExportByName("libcocos2djs.so","xxtea_decrypt");
console.log("xxtea_decryptaddr",xxtea_decryptaddr);
Interceptor.attach(xxtea_decryptaddr,{
onEnter:function (args) {
console.log("key:"+ args[2].readCString()) // 打印密钥
dump = true;
},
onLeave:function (retval) {
}
})
var addr = Module.findBaseAddress("libcocos2djs.so").add(0xED2BC8).add(1);
console.log("addr:" + addr)
Interceptor.attach(addr,{
onEnter:function (args) {
},
onLeave:function (retval) {
var len = retval.readCString().length;
var src = retval.readCString();
if (dump&& len>3000){
//console.log(src)
var file_path = "/sdcard/jsdump/" + len + ".js";
var file_handle = new File(file_path, "wb");
if (file_handle && file_handle != null) {
file_handle.write(src);
file_handle.flush();
file_handle.close();
console.log("[dump]:", file_path);
}
}
}
})
}
awaitForCondition(starthook,"libcocos2djs.so")
})