title: How to hide strings in a exe or a dll?
body: <p>I discovered that it is possible to extract the hard-coded strings from a binary.<br>
  For example the properties view of <a href="http://technet.microsoft.com/en-us/sysinternals/bb896653.aspx" rel="noreferrer">Process Explorer</a> displays all the string with more than 3 characters.</p>
  
  <p>Here is the code of a simple executable that I wrote to simply test it:</p>
  
  <pre><code>#ifndef _WIN32_WINNT
  #define _WIN32_WINNT 0x0501
  #endif
  #include &lt;stdio.h&gt;
  #include &lt;tchar.h&gt;
  #include &lt;Windows.h&gt;
  
  int _tmain(int argc, _TCHAR* argv[])
  {
      _TCHAR* hiddenString1 =_T("4537774B-CC80-4eda-B3E4-7A9EE77991F5");
      _TCHAR* hiddenString2 =_T("hidden_password_or_whatever");
      for (int i= 0; i&lt;argc; i++) {
          if (0 == _tcscmp(argv[i],hiddenString1)) {
              _tprintf (_T("The guid argument is correct.\n")); }
          else if (0 == _tcscmp(argv[i],hiddenString2)) {
              _tprintf (_T("Do something here.\n")); }
      }
  
      _tprintf (_T("This is a visible string.\n"));
      //Keep Running
      Sleep(60000);
      return 0;
  }
  </code></pre>
  
  <p>The strings can clearly be extracted from the corresponding executable:<br>
  <img src="https://i.stack.imgur.com/3k8mN.png" alt="alt text"></p>
  
  <p>I think that it is a little too easy to find the strings.</p>
  
  <p>My questions are:</p>
  
  <ol>
  <li>How to <strong>simply</strong> hide <em>hiddenString1</em> or <em>hiddenString2</em> in the
  executable?</li>
  <li>Is there a more secure
  way to use "cheat code" than with
  some obscure hidden input?</li>
  </ol>