title: Which data type I need to use for [byte] In base memory address?
body: <p>I working on a program that "hacks" <strong>GTA: San Andreas</strong>.</p>
  
  <p>I'm using <code>WriteProcessMemory</code> function to write data into the base memory of the specific item, and <code>FindWindow</code> to find the <strong>GTA: San Andreas</strong> Window.</p>
  
  <p>My Problem is that the second and the third <code>WriteProcessMemory</code> does not working, It does not affect the game and does nothing.</p>
  
  <p>I saw <a href="https://gtamods.com/wiki/Memory_Addresses_(SA)" rel="nofollow noreferrer">here</a> the base memory addresses and the data type I need, you can scroll down to <strong>Cheats</strong> options and see that the base memory and the data type [byte] they need.</p>
  
  <p><strong>Example:</strong></p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;Windows.h&gt;
  
  using namespace std;
  
  void GameHack(LPCSTR winname)
  {
      int newValue = 125555;
      byte bytes = 1;
      HWND GameWindow = FindWindowA(NULL, winname);
      if (GameWindow == NULL) {
          auto errorcode = GetLastError();
          std::cout &lt;&lt; "Failed to FindWindow &amp; Error Code: " &lt;&lt; errorcode;
          Sleep(3000);
          exit(1);
      }
      else {
          DWORD procID;
          GetWindowThreadProcessId(GameWindow, &amp;procID);
          HANDLE handle = OpenProcess(PROCESS_ALL_ACCESS, FALSE, procID);
  
          if (handle == NULL) {    // compare handle to NULL, not procID to FALSE
              auto errorcode = GetLastError();  // 1st thing to do                 
              std::cout &lt;&lt; "procID Failed &amp; Error Code: " &lt;&lt; errorcode;
              Sleep(3000);
              exit(1);
          }
          else {
              int option;
              cout &lt;&lt; "\n 1. Money Booster!\n 2. Weapon Set 1\n 3. Max Muscle\n\n";
              cout &lt;&lt; " Choose One Option You Want To Do: "; cin &gt;&gt; option;
              if (option == 1) {
                  WriteProcessMemory(handle, (LPVOID)0x00C0F188, &amp;newValue, sizeof(newValue), NULL);
              }
              if (option == 2) {
                  WriteProcessMemory(handle, (LPVOID)0x969130, &amp;bytes, sizeof(bytes), NULL);
              }
              if (option == 3) {
                  WriteProcessMemory(handle, (LPVOID)0x969155, &amp;bytes, sizeof(bytes), NULL);
              }
              CloseHandle(handle);
          }
      }
  }
  
  int main()
  {
      GameHack("GTA: San Andreas");
      return 0;
  }
  </code></pre>
  
  <p>I want to add <strong>Weapon Set 1</strong> to my character and <strong>Max Muscle</strong>. </p>
  
  <p>Which data type and value should I need to use for this ?</p>