if this is useful to anyone, but this can extract the scene.bin files (I hope):
// Warning: rush work
#include <stdio.h>
#include <zlib.h>
char* buff = new char[7808];
char* buff2 = new char[8192];
int* FileOffsets = new int[16];
FILE* rf;
FILE* bd;
int fnum = 1;
int ProcFiles(int* i)
{
*i *= 4;
for(int j = 1; j<17; j++)
{
i++;
if (*i == 0xFFFFFFFF)
return j;
*i *= 4;
}
return 16;
}
void BlockProc(int& i, int dec)
{
while (i < dec)
i += 0x2000;
i -= dec;
}
void ExtractBlock()
{
char fname[64];
fread(FileOffsets, 4, 16, rf);
int fsize;
int nFiles = ProcFiles(FileOffsets);
fwrite(&nFiles, 1, 1, bd);
nFiles -= 1;
int BlockSize = 0x2000 - 0x40;
for (int i = 0; i<nFiles; i++)
{
fsize = FileOffsets[i+1] - FileOffsets;
BlockProc(BlockSize, fsize);
fread(buff2, fsize, 1, rf);
FILE* of = fopen("tmp.dat", "w+b");
fwrite(buff2, fsize, 1, of);
fclose(of);
gzFile gzip = gzopen("tmp.dat", "r+b");
gzread(gzip, buff, 7808);
sprintf(fname, "%d.txt", fnum);
of = fopen(fname, "w+b");
fwrite(buff, 7808, 1, of);
fclose(of);
fnum++;
gzclose(gzip);
}
fread(buff2, BlockSize, 1, rf);
FILE* of = fopen("tmp.dat", "w+b");
fwrite(buff2, BlockSize, 1, of);
fclose(of);
gzFile gzip = gzopen("tmp.dat", "r+b");
gzread(gzip, buff, 7808);
sprintf(fname, "%d.txt", fnum);
of = fopen(fname, "w+b");
fwrite(buff, 7808, 1, of);
fclose(of);
fnum++;
gzclose(gzip);
}
void main()
{
rf = fopen("scene.bin", "r+b");
bd = fopen("blockdat.dat", "w+b");
while (fnum < 254) //unsure here
ExtractBlock();
fclose(rf);
fclose(bd);
delete[] buff;
delete[] buff2;
delete[] FileOffsets;
}
The blockdat.bin will be used when reconstructing the file