title: How can I get the base address of the target process after DLL injection?
body: <p>After I've successfully injected my dll into my target process, say "target.exe", how can I get the base address of "target.exe"?</p>
  
  <p>I've tried GetModuleHandle(0) and GetModuleHandle("target.exe") but it doesn't seem to be right and I'm not sure how to debug. I've tried to print it like this:</p>
  
  <pre><code>//retrive target's base address
  DWORD EXEBaseAddr = (DWORD) GetModuleHandle((LPCWSTR)"target.exe");
  std::stringstream sstr;
  sstr &lt;&lt; EXEBaseAddr;
  std::string str = sstr.str();
  String^ str3 = gcnew String(str.c_str());
  baseAddressLBL-&gt;Text = str3;
  </code></pre>
  
  <p>I had to cast it at the end again because I'm using a Windows Form (not sure if that's what it's called) to print the address in my interface.</p>