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
1.03k stars 202 forks source link

translate enum int to string #266

Closed Chensem closed 1 year ago

Chensem commented 1 year ago

image example i get int 2 , i want to get Argument with string , how to write the code ?

ChaomengCFX commented 1 year ago
function getEnumName(value: number, klass: Il2Cpp.Class): string {
        const System_Enum = Il2Cpp.Image.corlib.class('System.Enum');
        const GetEnumObject = System_Enum.method<Il2Cpp.Object>('ToObject');
        return GetEnumObject.overload('System.Type', 'System.Int32').invoke(klass.type.object, value).method<Il2Cpp.String>('ToString').invoke().content as string;
    }
Chensem commented 1 year ago

thanks try it successfully