/* * repoint_kn.c * ------------ * Por sl0wy * * - Coloque os endereços corretos */ #include #include #define TXT_INICIO 0x318C00 #define TXT_FIM 0x327250 #define PTR_INICIO 0x117DD4 #define FILEPATH "C:\\util\\emu\\gba\\bof\\bof.gba" int main (void) { FILE * rom; unsigned int x, textpos, textpointer, ptroffset = PTR_INICIO; if ((rom = fopen(FILEPATH, "r+b")) == NULL) { printf ("Erro ao abrir arquivo.\n"); exit(1); } for (x = TXT_INICIO; x <= TXT_FIM; ptroffset += 3) { fseek (rom, x, SEEK_SET); textpos = ftell(rom); fseek (rom, ptroffset, SEEK_SET); fwrite (&textpos, 3, 1, rom); fseek (rom, x, SEEK_SET); while (fgetc(rom) != 0x00) fseek (rom, +1, SEEK_CUR); x = ftell (rom); } printf ("Ponteiros alterados com sucesso!\n"); fclose(rom); return 0; }