title: Accessing the code section of a C++ program
body: <p>Based upon my understanding, a C/C++ program looks something like this in the memory:</p>
  
  <p><img src="https://i.stack.imgur.com/mCB2Y.gif" alt="Memory Layout of C programs. Source : Internet"></p>
  
  <p>I wanted to know the following :</p>
  
  <ol>
  <li>Can I access the "text section" of the running program? By accessing I mean printing
  the start and end addresses and examining the contents.</li>
  <li>Can I relocate the "text section" to some other address in the memory at runtime?</li>
  </ol>
  
  <p>Thanks,</p>