title: Going through the stack
body: <p>I made a simple function to iterate through the whole stack and print out contents of each entry in there.<br></p>
  
  <pre><code>void ListStack()
  {
      NT_TIB* tib = (NT_TIB*)NtCurrentTeb();
  
      for (void* address = tib-&gt;StackBase; address &gt; tib-&gt;StackLimit; address = (char*)address - sizeof(void*))
      {
          void* pointsTo = *((void**)address);
  
          printf("address=%p, points to=%p\n", address, pointsTo);
      }
  }
  </code></pre>
  
  <p>On x86, this works fine. However, on x64, it gives me read access violation.<br><br>
  What's wrong with this?</p>