Advertisement
Bond697

ovl

Jun 28th, 2012
196
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.78 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <io.h>
  3. #include <fcntl.h>
  4. #include <sys\stat.h>
  5. #include <conio.h>
  6. #include <windows.h>
  7.  
  8.  
  9. int main() {
  10.  
  11.     //unsigned char target[64] = {};
  12.     unsigned char target[2] = {0x10, 0x58};
  13.  
  14.     int f;
  15.     char buf[MAX_PATH];
  16.     unsigned char *data = new unsigned char[1024 * 1024 * 4];
  17.     for (int a = 0;a < 344;++a) {
  18.         sprintf(buf,"C:\\Users\\mat.DONARUMO\\Desktop\\Research\\Game Files\\BW2\\Pokemon White 2(J)\\overlay\\overlay9_%04i.bin",a);
  19.         f = _open(buf,_O_BINARY | _O_RDONLY,_S_IREAD);
  20.         int size = _filelength(f);
  21.         _read(f,data,size);
  22.         _close(f);
  23.  
  24.         //size -= 63;
  25.         size -= 1;
  26.         for (int p = 0;p < size;++p) {
  27.             if (!memcmp(&data[p],target,2)) {
  28.                 puts(buf);
  29.                 //break;
  30.             }
  31.         }
  32.     }
  33.  
  34.     puts("\nDone");
  35.     //_getch();
  36.     while(1);
  37.  
  38.     return 0;
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement