frida-il2cpp-bridge: Struct methods may be invoked incorrectly

Take the following:

const double = Il2Cpp.corlib.class("System.Double").new();
double.field("m_value").value = 51.51100833075058;
console.log(double);

const int32 = Il2Cpp.corlib.class("System.Int32").new();
int32.field("m_value").value = 0;
console.log(int32);

Console:

2,65922814801271E-312
1362888960

Logging, for example int32.field(“m_value”).value, works as expected.

Replicating this issue: #17

const Vector2Class = Il2Cpp.domain.assembly("UnityEngine.CoreModule").image.class("UnityEngine.Vector2");
const vec = Vector2Class.new();
vec.method(".ctor").invoke(36, 4);

console.log("X: " + vec.field("x").value);
console.log("Y: " + vec.field("y").value);

Console:

X: 0
Y: 0

It’s important to note that logging just the struct gives me the right values but accessing the fields does not. It also seems that the value applied is the incorrect one being shown and not the one in m_value.

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Comments: 16 (16 by maintainers)

Commits related to this issue

Most upvoted comments

Yeah, thanks, it looks like so. We really need tests…