Advertisement
Guest User

Untitled

a guest
May 20th, 2022
731
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.61 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <string.h>
  3. #include <stdlib.h>
  4.  
  5. void hexDump(const void *data, size_t size) {
  6.   size_t i;
  7.   for (i = 0; i < size; i++) {
  8.     printf("%02hhX%c", ((char *)data)[i], (i + 1) % 16 ? ' ' : '\n');
  9.   }
  10.   printf("\n");
  11. }
  12.  
  13. int main (int argc, char** argv){
  14.     FILE * fp = fopen (argv[1],"rb");
  15.     unsigned short  offset;
  16.     unsigned char hash [0x20];
  17.    
  18.     fseek(fp, 0x0C, SEEK_SET);
  19.     fread(&offset,2,1,fp);
  20.     //printf("%04X\n", offset);
  21.    
  22.     fseek(fp, offset - 0x20, SEEK_SET);
  23.     fread(hash,0x20,1,fp);
  24.    
  25.     printf("%s\n" , argv[1]);
  26.    
  27.     hexDump(hash,0x20);
  28.    
  29.     fclose(fp);
  30.    
  31.     return 0;
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement