vfsfitvnm / frida-il2cpp-bridge

A Frida module to dump, trace or hijack any Il2Cpp application at runtime, without needing the global-metadata.dat file.
https://github.com/vfsfitvnm/frida-il2cpp-bridge/wiki
MIT License
946 stars 194 forks source link

How to work with enum ? #340

Closed m2k2v closed 1 year ago

m2k2v commented 1 year ago

Hi everyone. I want to work with an enum. The main source of the game is as follows:

namespace Clevers.Domain.Enums
public enum MultipleChoice
{
   // Token: 0x040000FA RID: 250
   A
   // Token: 0x040000FB RID: 251
   B
   // Token: 0x040000FC RID: 252
   C,
   // Token: 0x040000FD RID: 253
   d
}

And I want to call the value of A from this enum. Does anyone know a way?

vfsfitvnm commented 1 year ago
const MultipleChoice = Il2Cpp.domain.assembly("...").image.class("Clevers.Domain.Enums.MultipleChoice");
const A = MultipleChoice.field<Il2Cpp.ValueType>("A").value;