I am using Frida il2cppbridge and having the problem that I'm getting always access violation error when trying to add values to generic list. What I'm doing wrong?
let list = Il2Cpp.corlib.class("System.Collections.Generic.List`1")
let int = Il2Cpp.corlib.class("System.Int32")
let listInt = list.inflate(int).new()
listInt.method(".ctor").invoke()
listInt.method("Add").invoke(1)
or also if I get the list from internal like:
// return type is List<int>
let list = anyClass.method<Il2Cpp.Object>("getList").invoke()
list.method("Add").invoke(1)
Getting always the same error, doesn't matter if I try method Add, Insert or set_Item
Error:
access violation accessing 0x3e8
at invokeRaw (il2cpp/structs/method.ts:233)
at (src/index.ts:18)
at call (native)
at (il2cpp/structs/method.ts:354)
Methods like get_Count works fine.
1as argument and not anSystem.Int32. Normally wrapping of primitive types is often performed automatically by the compiler - but on Frida/il2cppbridge there is no compiler, so you have to do these operations on your own.System.Int32variable and then useTryParsefor example to set it, inside theAddmethod I get the message that I'm using wrong type and that I need typenumberor any other il2cpp type.