如何显示内存转储? [英] How can display memory dump?

查看:107
本文介绍了如何显示内存转储?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

显示内存转储如何从某个地址开始?

IE我输入地址并显示转储开始该地址。它可能吗?

How display memory dump starting from a certain address?
IE i enter the address and display dump starting that address. Its possible?

推荐答案

正如谢尔盖指出的那样,倾倒直接可由进程访问的内存非常简单,例如



As Sergey pointed out, dumping the memory directly accessible by the process is really simple, e.g.

#include <cstdio>
using namespace std;

int main()
{
  int a[] = {1,2,3,4,5,6,7,8,9,10};

  unsigned char *p;

  p = (unsigned char *)&a[3];

  printf("%p", p);

  for (int n=0; n<8; ++n)
  {
    printf(" %02X", *p);
    ++p;
  }
  printf("\n");
}


这篇关于如何显示内存转储?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆