function hook_dlopen() {
const dlopen
=
Module.findExportByName(null,
"dlopen"
);
if
(dlopen !
=
null) {
Interceptor.attach(dlopen, {
onEnter: function (args) {
var l_soName
=
args[
0
].readCString();
console.log(l_soName);
if
(l_soName.indexOf(
"libil2cpp.so"
) !
=
-
1
) {
this.hook
=
true;
}
},
onLeave: function (retval) {
if
(this.hook) {
console.log(
"\nLoaded libil2cpp.so add break points"
);
var base_addr
=
Module.findBaseAddress(
"libil2cpp.so"
);
/
/
获取 so的基址
console.log(
"base_addr = "
+
base_addr);
var unlock_addr
=
base_addr.add(
0x2F40E50
);
console.log(
"unlock_addr : "
+
unlock_addr);
Interceptor.attach(unlock_addr, {
onEnter : function(args) {
},
onLeave:function(retval){
/
/
console.log(
'isUnlock = '
+
retval)
retval.replace(
1
);
}
});
}
}
});
}
}
setImmediate(hook_dlopen);