You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, I am trying to read the obj variable below, but I do not know how to work with it. I can see a value if obj is printed, but class is undefined. I cannot get field since I do not know the field name. I tried to cast as Il2Cpp.Array but it does not look the same.
I am trying to change [CHECK_STATUS,{"Current":0,"Max":2}], eg. to [CHECK_STATUS,{"Current":2,"Max":5}]
public void ParseRequest(object[] obj) {};
TraceMethod = TraceClass.method("ParseRequest");
TraceMethod.implementation = function(
this: Il2Cpp.Object | Il2Cpp.Class,
obj: Il2Cpp.Object
){
try {
console.log(obj); //[CHECK_STATUS,{"Current":0,"Max":2}]
console.log((typeof obj)); // object
console.log("obj get class ", Il2Cpp.api.objectGetClass(obj)) //0x74cea56ec0
console.log("obj class ", obj.class) // undefined
var res = new Il2Cpp.Array(obj);
console.log(res); //[CHECK_STATUS,{"Current":0,"Max":2}]
console.log(res.elementType); //System.Object
console.log(res.elementSize); //8
console.log(res.object); //System.Object[]
var result = this.method<Il2Cpp.Object>("ParseRequest").invoke(
obj
);
return result; //this is successful (did not break the program)
}
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello, I am trying to read the
obj
variable below, but I do not know how to work with it. I can see a value ifobj
is printed, but class is undefined. I cannot get field since I do not know the field name. I tried to cast as Il2Cpp.Array but it does not look the same.I am trying to change
[CHECK_STATUS,{"Current":0,"Max":2}]
, eg. to[CHECK_STATUS,{"Current":2,"Max":5}]
public void ParseRequest(object[] obj) {};
Beta Was this translation helpful? Give feedback.
All reactions