Update unity.js
This commit is contained in:
parent
bc3997d8e7
commit
c48e59313c
@ -25,11 +25,11 @@ function cb(funcName) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function hookMethod(dll, klass, method, extra) {
|
function hookMethod(dll, name_space, klass, method, num_params, extra) {
|
||||||
// var monoImage = mono_image_loaded(dll);
|
// var monoImage = mono_image_loaded(dll);
|
||||||
// monoImage will be the same as this.extra.image
|
// monoImage will be the same as this.extra.image
|
||||||
var monoClass = mono_class_from_name(extra.image, "", klass);
|
var monoClass = mono_class_from_name(extra.image, name_space, klass);
|
||||||
var monoMethod = mono_class_get_method_from_name(monoClass, method, -1);
|
var monoMethod = mono_class_get_method_from_name(monoClass, method, num_params);
|
||||||
// = mono_class_get_method_from_name(monoClass, "lastRecivedGameId", -1); // mono_class_get_field
|
// = mono_class_get_method_from_name(monoClass, "lastRecivedGameId", -1); // mono_class_get_field
|
||||||
var compiledMethod = mono_compile_method(monoMethod);
|
var compiledMethod = mono_compile_method(monoMethod);
|
||||||
|
|
||||||
@ -58,10 +58,25 @@ function hook() {
|
|||||||
onLeave: function(retval) {
|
onLeave: function(retval) {
|
||||||
if (this.extra.fname.endsWith("Assembly-CSharp.dll")) {
|
if (this.extra.fname.endsWith("Assembly-CSharp.dll")) {
|
||||||
this.extra.retval = retval;
|
this.extra.retval = retval;
|
||||||
hookMethod(this.extra.fname, "NetworkDriver", "AskForQuestion", this.extra);
|
hookMethod(this.extra.fname, "", "NetworkDriver", "AskForQuestion", -1, this.extra);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
/*
|
||||||
|
Interceptor.attach(Module.findExportByName(null, "mono_class_from_name"), {
|
||||||
|
onEnter: function(args) {
|
||||||
|
this.extra = {
|
||||||
|
name_space: Memory.readUtf8String(args[1]),
|
||||||
|
name: Memory.readUtf8String(args[2])
|
||||||
|
};
|
||||||
|
},
|
||||||
|
onLeave: function(retval) {
|
||||||
|
if (this.extra.name_space.indexOf("UnityEngine.UI") != -1) {
|
||||||
|
console.log(JSON.stringify(this.extra, null, 2));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -152,7 +167,6 @@ Java.perform(awaitForCondition(hook));
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Loading…
Reference in New Issue
Block a user