为什么我看不到绳子?

时间:2018-08-25 22:57:09

标签: c++ visual-c++

我知道这段代码很草率,但是我想知道为什么当我使用ReadProcessMemory()函数时,看不到存储在相​​关地址中的字符串。

    //If the game window is open then this function grabs the process ID.
if(FinderCheck)
{
    DWORD procID;

    GetWindowThreadProcessId(hwnd, &procID);

    //All so access you can read and write to process memory.
    HANDLE handle = OpenProcess(PROCESS_ALL_ACCESS,FALSE,procID);

    if(procID = NULL)
    {
        cout << "Error: Failed to Obtain Process ID" << endl;
    }
    else
    {
        while(true)
        {


        //To read the process memory this line writes the memory data to buffer
        //Remember to change the address every time you boot the process or it will not work.
        ReadProcessMemory(handle, (PBYTE*)0xDC8F1AA904,&Cursor,sizeof(Cursor),0);
        cout << Cursor << endl;
        cout << "Test" << endl;

        Sleep(500);
        }
    }

1 个答案:

答案 0 :(得分:3)

$ make clean
$ perl Makefile.PL
$ make
$ make test: *** No rule to
make target `clean:'.  Stop. Manifying 2 pod documents
PERL_DL_NONLAZY=1 "/opt/local/bin/perl5.26" "-Iblib/lib" "-Iblib/arch"
test.pl
1..42
# Running under perl version 5.026002 for darwin
# Current time local: Sun Aug 26 06:48:26 2018
# Current time GMT:   Sat Aug 25 22:48:26 2018
# Using Test.pm version 1.26 not ok 1
# Failed test 1 in test.pl at line 9
#  test.pl line 9 is:   ok(!$@) ; Can't locate object method "new" via package "Foo" at test.pl line 11. make: *** [test_dynamic] Error 2

可悲的是,此if语句将始终计算为false,您缺少第二个“ =”。这也意味着从这一点来看 if(procID = NULL) procID

其余的代码呢?您能否向我们展示NULL的定义,以及如何实现Cursor