编写c代码通过内存修改工具修改内存地址的感受

编写c代码通过内存修改工具修改内存地址的感受_第1张图片
image.png

编写死循环代码

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 linux 如何sleep自行百度
下载工具
Cheat Engine.exe

编写c代码通过内存修改工具修改内存地址的感受_第2张图片
image.png

编写c代码通过内存修改工具修改内存地址的感受_第3张图片
image.png
编写c代码通过内存修改工具修改内存地址的感受_第4张图片
image.png

这个负数的值不用管,如果要转换为负数的话,就需要计算了。

编写c代码通过内存修改工具修改内存地址的感受_第5张图片
image.png

从qword切换dword

编写c代码通过内存修改工具修改内存地址的感受_第6张图片
image.png

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

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

你可能感兴趣的:(编写c代码通过内存修改工具修改内存地址的感受)