How do i get field value from class that are not initialized at the game start #573
Unanswered
RaidenRespawnStaff
asked this question in
Q&A
Replies: 1 comment 1 reply
-
are you sure that are you doing it inside Il2Cpp.perform, which quarantees that your code executed only when whole il2cpp api is loaded by game? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
` const csharpAssembly = Il2Cpp.domain.assembly("Assembly-CSharp");
const VerifyClass = csharpAssembly.image.class("Game.invManager.Data");
const VerifyInstance = VerifyClass.field<Il2Cpp.Object>("Instance").value;
const Field = VerifyInstance.field<Il2Cpp.Object>("Items").value;
console.log(JSON.stringify({ VerifyClass, VerifyInstance, Field}));
console.log(Field.field.toString);
console.log(Field.toString);
console.log(Field.field.name);`
I tried this but i always get this :
Error: access violation accessing 0x0
I think the class instance doesnt exist when i launch the game so i need to "wait" for it to initialize before reading the value but i cant find how to do it
I kinda want to do this
`
const csharpAssembly = Il2Cpp.domain.assembly("Assembly-CSharp");
const VerifyClass = csharpAssembly.image.class("Game.invManager.Data");
IF CLASS IS CALLED THEN
const VerifyInstance = VerifyClass.field<Il2Cpp.Object>("Instance").value;
const Field = VerifyInstance.field<Il2Cpp.Object>("Items").value;
console.log(JSON.stringify({ VerifyClass, VerifyInstance, Field}));
console.log(Field.field.toString);
console.log(Field.toString);
console.log(Field.field.name);
IF END
`
Beta Was this translation helpful? Give feedback.
All reactions