This program (almost) converts the english dungeon.dat to the modified Japanese one. Just need to set up the footer and the number of iterations now.
Code:
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
void ficopy(int amount, FILE* a, FILE* b){
char buffer[83];
fread(buffer,1,amount,a);
fwrite(buffer,1,amount,b);
}
int main(int argc, char** argv[]) {
FILE * eng, * jap; // File handlers
unsigned long int i; // Iterator.
char zeroes[] = { 0x0, 0x0 };
// Opening/Creating Files
eng = fopen(argv[1],"rb");
jap = fopen("jap.dat","wb");
if (eng!=NULL && jap!=NULL){
ficopy(83,eng,jap); // Copies header.
for(i=0;i<50;i++) {
ficopy(33,eng,jap); // Copies a dungeon name.
fseek(eng,26,SEEK_CUR); // Skip unnecessary zeroes.
ficopy(2,eng,jap);
fwrite(zeroes,1,2,jap);// Pads the missing 0s from this section.
ficopy(79,eng,jap); // Copies the pointers.
}
fclose(eng);
fclose(jap);
}
return 0;
} If the other dats all follow a similar pattern, it will be over in a couple days. But i assume the really big ones do not.