Closed Jnetops closed 2 years ago
If I did not misunderstand, you can modify the return value of a boolean function with this:
// Dll: DllName.dll
const DllName = Il2Cpp.Domain.assembly("DllName").image;
// Namespace: NamespaceName
// Class: ClassName
const ClassName = DllName.class("NamespaceName.ClassName");
// private static Boolean funcName(string str) { }
const funcName = ClassName.method<boolean>("funcName");
funcName.implementation = function(str: Il2cpp.String){
res = funcName.invoke(str);
// make no changes
return res;
// or return true
return true;
}
This works for me, and you can try referring to WIKI first if your problem is not solved :D
ya... that was a late night and could have benefitted from some rest before asking that question. As soon as I got up and my head was clear, I was immediately able to get it working by just returning true like you showed.. lmao. Dunno wth was going on last night. Thanks again.
Closing! Thanks @ChuJiani
Sorry to bother, but I have a general question. Upon overwriting a function, I am attempting to modify it's return value (which is a boolean).
I can't quite figure out how to achieve this. I can't return a simple true, or ptr(1) or 1 or a series of other things I have tried. How do you go about doing the equivalent of Il2cpp.String.from("true") but for a boolean?
Thanks in advance.