Skip to content

Instantly share code, notes, and snippets.

@masazdream
Created July 2, 2013 15:08
Show Gist options
  • Save masazdream/5910099 to your computer and use it in GitHub Desktop.
Save masazdream/5910099 to your computer and use it in GitHub Desktop.
exe dump 用のコード
#include <stdio.h>
int main(int argc, char *argv[]){
FILE *fp;
int c, n;
if ((fp = fopen(argv[1], "rb")) == NULL) {
printf("file open error!\n");
return -1;
}
n = 0;
while((c=fgetc(fp)) != EOF){
if (n % 16 == 0) printf("\n%08X :" , n);
printf("%02X ", c);
n++;
}
printf("\nfile size = %d\n", n);
fclose(fp);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment