title: Copy current executable to another path C++ (Windows only)
body: <p>I forgot how to program in C++, I want my exutable to copy itself to another path. I found a code that do what I want to do but there are conversion error that I don't know how to resolve :</p>
  <pre><code>void Victim::replicate()
  {
    char filename[ MAX_PATH ];
    char newLocation[]=&quot;C:\\Users\\myUsername\\Desktop\\&quot;;
    BOOL stats=0;
    DWORD size = GetModuleFileNameA( NULL, filename, MAX_PATH );
    CopyFile(filename, newLocation, stats);
        
  }
  </code></pre>
  <p>I got an error while using the <strong>CopyFile</strong> function, It expect LPCWSTR type for <strong>filename</strong> and <strong>newLocation</strong> But if I declare those variable as <strong>LPCWSTR</strong>, the <strong>GetModuleFileNameA</strong> function will not work anymore.</p>