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

how to create bytebuffer #240

Closed 350030173 closed 1 year ago

350030173 commented 1 year ago
// Namespace: LuaInterface
public class LuaDLL // TypeDefIndex: 5749
public static int luaL_loadbuffer(IntPtr luaState, byte[] buff, int size, string name); // 0x127E5DC

In the above function, I want to replace the third argument

my code is :

var SystemByte = Il2Cpp.Image.corlib.class("System.Byte");
var buff= Il2Cpp.Array.from(SystemByte, [0x2d, 0x2d, 0x5b, 0x5b, 0x0a, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d]);

The game will pause and flash back, If the parameters are OK, is there something wrong with my code, and if so, how do I create the third argument