Update unity.js

This commit is contained in:
iddoeldor 2018-07-26 22:38:02 +03:00 committed by GitHub
parent 4f6118d70b
commit 10e2c537cf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,3 +1,45 @@
Java.perform(function() {
var awaitForCondition = function(callback) {
var int = setInterval(function() {
if (Module.findExportByName(null, "mono_get_root_domain")) {
clearInterval(int);
callback();
return;
}
}, 0);
}
function hookSet() {
Interceptor.attach(Module.findExportByName(null, "mono_assembly_load_from_full"), {
onEnter: function(args) {
var name = Memory.readUtf8String(ptr(args[1]));
console.log('[1]', name);
var parts = name.split('/');
if (parts.length < 2) {
parts = name.split(',');
}
var dllName = parts[parts.length - 1];
this.dllName = dllName;
},
onLeave: function(retval) {
if (this.dllName == 'Assembly-CSharp.dll') {
console.log('[2]', retval, this.dllName);
console.log('[3]', Module.enumerateSymbolsSync(this.dllName));
}
}
});
}
awaitForCondition(hookSet);
});
function binary2hex2ascii(array, readBytesNum) { function binary2hex2ascii(array, readBytesNum) {
var result = []; var result = [];
// performance wise to read 100 bytes // performance wise to read 100 bytes