Replies: 11 comments
-
@zbx911 If so, the signature of that method is: System.Void ProcessBlock(System.Byte[] inputBuffer, System.Int32 inputOffset); You can manipulate it as follows: async function main() {
await Il2Cpp.initialize();
const mscorlib = Il2Cpp.Domain.reference.assemblies.mscorlib.image;
const MD5CryptoServiceProvider = mscorlib.classes["System.Security.Cryptography.MD5CryptoServiceProvider"];
MD5CryptoServiceProvider.methods.ProcessBlock.intercept({
onEnter(instance, parameters) {
const inputBuffer = parameters.inputBuffer.value as Il2Cpp.Array<number>;
console.log(`inputBuffer length: ${inputBuffer.length}`);
// you can manipulate it with inputBuffer.set(x, y); ...
// ... or
const jsBuffer: number[] = Array.from(inputBuffer);
// ...
}
});
} Btw, the translator didn't really help! |
Beta Was this translation helpful? Give feedback.
-
我的意思是根据hook对象的参数类型,进行分类处理, |
Beta Was this translation helpful? Give feedback.
-
你的例子太少了,可以多增加些。 |
Beta Was this translation helpful? Give feedback.
-
I'll suggest ignoring him before he following your words to use English, or he will keep asking in other languages next time. |
Beta Was this translation helpful? Give feedback.
-
@zbx911 You can gather a I suggest you to read the source code, it's quite simple imho (but yes, it deserves a better documentation...). However, like @UlyssesWu suggested, I will ignore/close this issue if you keep answering in your language! Non ti darebbe fastidio se rispondessi nella mia lingua? |
Beta Was this translation helpful? Give feedback.
-
my english can read,not write! |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
const v = parameter as Il2Cpp.Parameter; [C] call func: System.Security.Cryptography.MD5CryptoServiceProvider.ProcessBlock() |
Beta Was this translation helpful? Give feedback.
-
var v = parameter.value as Il2Cpp.ValueType; traceback |
Beta Was this translation helpful? Give feedback.
-
@zbx911 You have to do something like this: const mscorlib = Il2Cpp.Domain.reference.assemblies.mscorlib.image;
const MD5CryptoServiceProvider = mscorlib.classes["System.Security.Cryptography.MD5CryptoServiceProvider"];
const ProcessBlock = MD5CryptoServiceProvider.methods.ProcessBlock;
ProcessBlock.intercept({
onEnter(instance, parameters) {
for (const parameterName in parameters) {
const typeName = ProcessBlock.parameters[parameterName].type.name;
const value = parameters[parameterName].value;
}
}
}); |
Beta Was this translation helpful? Give feedback.
-
ok,thanks for this!!!! You can add this to readme. |
Beta Was this translation helpful? Give feedback.
-
const mscorlib = Il2Cpp.Domain.reference.assemblies.mscorlib.image;
const SystemString = mscorlib.classes["System.String"];
SystemString.methods.IsNullOrEmpty.intercept({
onEnter(instance, parameters) {
parameters.value = Il2Cpp.String.from("Replaced!");
assert((parameters.value.value as Il2Cpp.String).content == "Replaced!");
},
onLeave(returnValue) {
returnValue.value = true;
}
});
how to judge parameter‘type?
Beta Was this translation helpful? Give feedback.
All reactions