1 year ago

#305904

test-img

hanan

Access class variables declared inside another class using frida

I was trying to print an instance value which is declared using another class by using Frida how can I print the value of this instance, for example I have this code::

public final class myclass {
    public anotherClass A00 = null;
}

anotherclass contains the following code:

public final class anotherclass{
    public List A00 = null;
}

so my question is how can I print using frida the value like myclass.A00 which obviously would output null.

so far I have tried this:


Java.perform(function () {
  try {
    let myclz = Java.use("myclass ")
    let anotherclassinstance = Java.use("anotherclass")

    var result = Java.cast(myclz, anotherclassinstance )

    console.log("A00 value ", result.value)

    }
  } catch (e) {
    console.log("failed!" + e)
  }
})

I have tried other several possibilities, Not able to get the result. the above frida script outputs an error failed!Error: expected a pointer

How can I print the value of instance A00?

reverse-engineering

malware

frida

0 Answers

Your Answer

Accepted video resources