C++ Unable to Read Memory Address
<p>I'm creating a simple HACK for educational purpose only. A simple Triggerbot that reads from memory the value of player aiming to enemy YES = 1 or NO = 0. I have made some other similar HACKS however I never found  this problem .. in Rainbow Six Siege I have the memory address both static or dynamic however cheat engine read it well but when I try to read it from my C++ Program it does't work. Not sure why if it had work with other games. I'm new to this and maybe I did something wrong.</p>

<pre><code>#include "stdafx.h"
#include &lt;iostream&gt;
#include &lt;windows.h&gt;
#define F6Key 0x75
using namespace std ;
int value ;
int main()
{
    cout &lt;&lt; "Open Game .." &lt;&lt; endl ;
    system("Pause") ;
    LPCWSTR gameone = L"Rainbow Six";
    HWND hwnd = FindWindow(0, gameone);
    if (gameone == 0)
    {
        cout &lt;&lt; "Not Found." &lt;&lt; endl ;
        system("Pause") ;
    }
    else
    {
        cout &lt;&lt; "Success finding game." &lt;&lt; endl;
        DWORD processid ;
        GetWindowThreadProcessId(hwnd, &amp;processid) ;
        HANDLE process = OpenProcess(PROCESS_ALL_ACCESS, FALSE, processid) ;
        cout &lt;&lt; processid ;

        if (!ReadProcessMemory(process, (void *)0x25421AD9D6C, (void *)&amp;value, sizeof(value), NULL)) {
            cout &lt;&lt; "Unable to read memory proccess";
        }
        else {
            cout &lt;&lt; "\n Read: " &lt;&lt; value;
        }
        system("Pause");
    }
    return 0 ;
}
</code></pre>

<p>Here is the code simple Find the Window by name, gets its PID fine no problem. OpenProcess then when I call the method ReadProcessMemory with the process, address pointer value by parameter is unable to read it print the if condition and never the else of value read.</p>

<p>If I remove the function from the If condition just for testing if at least points to something it gives some random values... is weird that I'm unable to read memory It always work ::( 
Can someone help me out? It is some king of security software or something?</p>