title: execute exe in memory
body: <p>I was trying out this code.</p>
  
  <p><a href="http://www.coderprofile.com/networks/source-codes/138/execute-resource-directly-in-memory" rel="nofollow">execute EXE from memory</a></p>
  
  <p>I am hitting on error "Types of actual and formal var parameters must be identical"   . Any help in this regard is highly appreciated.</p>
  
  <pre><code>......
     ReadProcessMemory(ProcInfo.hProcess, pointer(Context.Ebx + 8), @BaseAddress, 4, Bytes);    &lt;-- error is here
  .......
  
  and
  
  .....
     WriteProcessMemory(ProcInfo.hProcess, pointer(ImageNtHeaders.OptionalHeader.ImageBase), InjectMemory, InjectSize, Bytes);   &lt;---- error here
  ......
  </code></pre>
  
  <p>I am using Delphi XE2 and windows 7 64 bit. Some of my friends are able to compile it under D7 environment. Any help is appreciated.</p>