-5

我猜它无处可寻,空指针或其他东西,但是我正在事先检查

这两个片段都崩溃了:

//Snippet 1
DWORD *address = (DWORD*)(base + 0x54);

if (address)
    address = (DWORD*)(*address + 0xC);

if (address)
    address = (DWORD*)(*address + 0x8);   //crashes here


//Snippet 2
DWORD address = *(DWORD*)(base + 0x54);

if (address)
    address = *(DWORD*)(address + 0xC);

if (address)
    address = *(DWORD*)(address + 0x8);   //crashes here

难道我做错了什么?提前致谢

4

1 回答 1

1

访问冲突!

您正在触摸您的程序可能禁止的某些内存部分。取消引用指向未知位置的指针是未定义的行为。

于 2013-05-19T16:41:43.590 回答