title: Unable to read memory on kernel32.dll base address
body: <p>I am making some research and currently i need to get base address of the KERNEL32.dll.</p>
  <p>What i already done:</p>
  <pre><code>// get PEB structure
  PPEB peb = (PPEB)__readfsdword(0x30);
  
  // get ldr linked list and go to kernel32 module
  PLDR_DATA_TABLE_ENTRY ldrDataTableEntry = (PLDR_DATA_TABLE_ENTRY)peb-&gt;Ldr-&gt;InMemoryOrderModuleList.Flink-&gt;Flink-&gt;Flink;
  
  // get DllBase address from LDR_DATA_TABLE_ENTRY
  HMODULE kernel32 = (HMODULE)ldrDataTableEntry-&gt;DllBase;
  
  </code></pre>
  <p>Unfortunately I can't read memory on this address. Here is my screenshot from VS while debugging:
  <a href="https://i.stack.imgur.com/483rf.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/483rf.png" alt="enter image description here" /></a></p>
  <p>Can someone explain me how it works? Am I doing something wrong? Maybe some references.</p>