简书链接:编写c代码通过内存修改工具修改内存地址的感受
文章字数:437,阅读全文大约需要1分钟

image.png

编写死循环代码

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
void changeAddress() {
int count = 0;
int value = -50;
while (value<0)
{
printf("value %d,address %p,count%d:\n",value, &value,count);
count++; Sleep(2000);
} printf("game over"); getchar();
}
void main() {
changeAddress();
//arrMemory();
//malloc1G();

}


我这里引入了include <windows.c> linux 如何sleep自行百度
下载工具
Cheat Engine.exe
image.png

image.png

image.png

这个负数的值不用管,直接填写负数就可以实现内存修改,如果想知道这个这么大的数字的负数是多少,就需要计算了。

image.png

从qword切换dword

image.png

参考
https://www.cnblogs.com/silva/archive/2009/12/08/1619393.html
一个字节占用8个byte位, int占用 4个字节,32个byte位
而ce开发工具作为64位显示

1
2
3
4
5
6
7
32位系统中 long 是4个字节;64位系统中long 是8个字节

C语言常用数据类型字节数(32位系统环境下)

1、void *: 4 bytes

2、 char: 1 bytes3、short: 2 bytes4、int: 4 bytes5、long: 4 bytes6、long long: 8 bytes7、float: 4 bytes8、double: 8 bytes9、long double: 12 bytes