FF7's .BIN Format Spec

  • Thread starter Thread starter _Ombra_
  • Start date Start date
Status
Not open for further replies.
M4v3R : I only understand now that M4v3R = Maver  :lol:
I see you made a very great piece of work. Thank you to put online those informations. I see we have found the same things about monsters (although you find them before me), but I don't understand your lines about "Elements". Maybe is it something I didn't find, but for me elements are small values. For example, "3" means "Earth", "7" means "Wind" and "6" means "Water" (the data containing elements informations follow "Magic Defence" value in each file).

So I want to ask you what are the elements you often call "E3 - R3", "E4 - R5" ? Has it something to do with elements ?

Again, thank you all for your nice help, _Ombra_ for your mail and M4v3R for your support.
 
E3 means Element three (from table that you've created), and R2 is Rate (200%, -100%, 0% etc) again from your table :). I created new version of doc with all elements in human readable format. It's here. But there are some elements that I don't now what they mean, like 0x20. Do you have an idea what they are?
 
Ok thanks for Element and Rate, I wasn't hard to understand, but I prefer human readable format ;)

In fact, I found special values too, I've put them in my nutshell (see bellow) but, like you, I don't now what they mean.

Element 20h | Absorb (06h) : Ghost, Ghost Ship, Dragon Zombie, Zenene, Cripshay, Vargid Police
Element 26h | Weakness (02h) : 3rd Soldier, Corvette
Element 22h | Weakness (02h) : Palmer

Those are the only exceptions I found in my version, and they seem to be the same in your version. Maybe did I forget one or two.
I tried to add elements 20h, 22h, 26h with 06h/02h for test purposes, but I didn't find changes during battle. Element 20h/06h seems to concern Undead, but I don't know what those values can change.
 
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
 
Status
Not open for further replies.
Back
Top