title: Finding mapped memory from inside a process
body: <p>Setup: </p>
  
  <ul>
  <li>Ubuntu 18x64 </li>
  <li>x86_64 application </li>
  <li>Arbitrary code execution from inside
  the application</li>
  </ul>
  
  <p>I'm trying to write code which should be able to find structures in memory even with ASLR enabled. Sadly, I couldn't find any static references to those regions, so I'm guessing I have to use the bruteforce way and scan the process memory. What I tried to do was to scan the whole address space of the application, but that doesn't work as some memory areas are not allocated and therefore yield <code>SIGSEGV</code> when accessed. Now I'm thinking it would be a good idea to <code>getpid()</code>, then use the pid to access <code>/proc/$PID/maps</code> and try to parse the data from there. </p>
  
  <p>But I wonder, is there a better way to identify allocated regions? Maybe even a way that doesn't require me to access libc (=<code>getpid, open, close</code>) or fiddle around with strings?</p>