You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
class Person
{
private string name; // field
public string Name // property
{
get { return name; } // get method
set { name = value; } // set method
}
}
And I found that in compilation, the set method is called as "set_Name(string)"; however, when I try the below code to fetch and modify the data, the console logs an empty argument -no error is returned that shows that the method does not exist- . Can someone tell me what I am doing wrong?
import { MonoApiHelper, MonoApi } from '../vendors/frida-mono-api'
import ClassHelper from '../libraries/class_helper'
var settingClassName = "Person";
var settingMethodName = "set_Name";
var settingMethodArgCount = 1;
// The root AppDomain is the initial domain created by the runtime when it is initialized. Programs execute on this AppDomain.
const domain = MonoApi.mono_get_root_domain()
// Get a reference to a certain class within the Xamarin application.
var classInformation = ClassHelper.getClassByName(settingClassName);
// Attach interceptor and fish out the first method argument
MonoApiHelper.Intercept(classInformation, settingMethodName, {
onEnter: function(args) {
console.log("Entered " + settingMethodName + " with " + settingMethodArgCount + " argument(s).");
console.log("Value of `string id`: " + MonoApiHelper.StringToUtf8(args[0]));
},
onLeave: function onLeave(log, retval, state) {
console.log("Left " + settingMethodName + ".");
}
})
console.log(`'jit_modify_class_function_argument.js' attached and ready.`)
The text was updated successfully, but these errors were encountered:
Hello,
I have the below sample code
And I found that in compilation, the set method is called as "set_Name(string)"; however, when I try the below code to fetch and modify the data, the console logs an empty argument -no error is returned that shows that the method does not exist- . Can someone tell me what I am doing wrong?
The text was updated successfully, but these errors were encountered: