问题描述
所以我想将地址的值更改为其他值。 假设地址的值为42859105827,地址为0A2BC6FC,我将如何更改此地址的值?
示例:
Address | Type | Value
0A2BC6FC 4 Bytes 42859105827
解决方法
我认为您需要重新解释演员表。这可能不是一种超级安全的方法,但应该有效:
size_t address = 0x0A2BC6FC;
int new_value = ...;
reinterpret_cast<int&>(address) = new_value;