更改内存地址值和十六进制数据

问题描述

所以我想将地址的值更改为其他值。 假设地址的值为42859105827,地址为0A2BC6FC,我将如何更改此地址的值?

示例:

Address    |    Type    |   Value
0A2BC6FC      4 Bytes      42859105827

解决方法

我认为您需要重新解释演员表。这可能不是一种超级安全的方法,但应该有效:

size_t address = 0x0A2BC6FC;
int new_value = ...;
reinterpret_cast<int&>(address) = new_value;

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...