title: How to read memory on the heap with Frida?
body: <p>I try to read a memory on the heap using Frida with a server located on Android Virtual Device (emulated) but all the time I got a memory <code>access violation</code> error.</p>
  
  <p>First I'm looking for an instance of interesting class:</p>
  
  <pre><code>Java.performNow(function() {
      Java.choose("com.example.model.interestingObject", {
          onMatch: function(instance) {
              console.log(instance.toString());                   
          }, onComplete: function() {
          }
      });
  });
  </code></pre>
  
  <p>As an output I get (I suppose) address in memory:
  <code>com.example.model.interestingObject@d735e35</code></p>
  
  <p>But when I try to read from that address:
  <code>Memory.readByteArray(ptr("0xd735e35"), 64);</code> then I get a following error:</p>
  
  <pre><code>Error: access violation accessing 0xd735e35
      at frida/runtime/core.js:282
      at /repl18.js:26
  </code></pre>
  
  <p>The question is, how can I read bytes from that address? I'm very fresh to Frida so probably do something wrong. Would be glad for any help!</p>