标签:
#include <iostream> #include <stdio.h> using namespace std; #define BUFF_SIZE 20 int main () { FILE *fp; fp = fopen("epp370p0190_0408.1399259732.exe", "rb"); int c; int buf[BUFF_SIZE]; char ch_buf[BUFF_SIZE]; int index = -1; while ((c = fgetc(fp)) != EOF) { index++; buf[index] = c; ch_buf[index] = c; if ((index+1) % BUFF_SIZE == 0) { for (int i = 0; i <= index; i++) { printf("%02X ", buf[i]); } printf("\n"); index = -1; } } for (int i = 0; i <= index; i++) { printf("%02X ", buf[i]); } printf("\n"); return 0; }
标签:
原文地址:http://my.oschina.net/ism/blog/360573