📄 fdump.c
字号:
#include <asm/types.h>#include <sys/types.h>#include <sys/stat.h>#include <fcntl.h>#include <unistd.h>#include <stdio.h>#include <stdlib.h>staticvoid fdump (char *name){ unsigned char buf [8]; int i, fd, count, bytes; if ((fd = open (name, O_RDONLY)) < 0) { perror ("open"); exit (-1); } printf ("\nu8 %s [] __initdata = {", name); while ((count = read (fd, buf, sizeof(buf))) > 0) { printf ("\n\t"); for (i=0;i<count;i++, bytes++) printf ("0x%02x, ", buf[i]); } printf ("\n};\n\n"); close (fd);}int main (void){ printf ("\n#include <asm/types.h>\n"); fdump ("Dpram"); fdump ("Root"); return 0;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -