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
918 stars 191 forks source link

How can I replace a function with a parameter that has an out flag? #477

Closed zglonfee closed 5 months ago

zglonfee commented 5 months ago

C# code

private void FindTargetItemOrFillingCell(Royal.Scenes.Game.Mechanics.Board.Cell.CellModel cell, [Out] Royal.Scenes.Game.Mechanics.Board.Cell.FillingCellModel fillingCell)

ts code

    cls.method("FindTargetItemOrFillingCell").implementation = function(cell : Il2Cpp.Object, fillingCell : Il2Cpp.Object){
        this.method("FindTargetItemOrFillingCell").invoke(cell, fillingCell)
        console.log("FindTargetItemOrFillingCell : " + cell)
    }

And i get an error msg when fillingCell is not null:

Error: access violation accessing 0xaf96a9027bf3
    at callback (/node_modules/frida-il2cpp-bridge/dist/index.js:1309

please help me, thanks