// agcc dump.c -o dump // adb push dump /data/local/tmp/dump // adb shell su -c '/data/local/tmp/dump' > dump.bin #include #include #include #include #define SRAM_BASE 0x40000000 #define SRAM_SIZE 0x00100000 int main(int argc, char *argv) { int fd = open("/dev/mem", O_RDONLY); if (fd < 0) { perror("/dev/mem"); exit(-1); } unsigned char *map_base; map_base = mmap(0, SRAM_SIZE, PROT_READ, MAP_SHARED, fd, (off_t)SRAM_BASE); if (map_base == MAP_FAILED) { perror("mmap failed"); exit(-1); } write(1, map_base + 0x14000, 0x7000); munmap(map_base, SRAM_SIZE); close(fd); return 0; }