blizzless-diiis icon indicating copy to clipboard operation
blizzless-diiis copied to clipboard

01 template for CoreTOC.dat reading

Open advocaite opened this issue 2 years ago • 2 comments

This will help get us the MPQ Info Names SNOids ect ect very important when updating . Taged as Documentation

//------------------------------------------------
//--- 010 Editor v13.0.1 Binary Template
//
//      File: 
//   Authors: 
//   Version: 
//   Purpose: 
//  Category: 
// File Mask: 
//  ID Bytes: 
//   History: 
//------------------------------------------------
#define NUM_SNO_GROUPS 70

typedef struct {
   DWORD entryCounts[NUM_SNO_GROUPS];
   DWORD entryOffsets[NUM_SNO_GROUPS];
   DWORD entryUnkCounts[NUM_SNO_GROUPS];
   DWORD i0;
} TOCHeader;

int goto(int pos) {
    local int x = FTell();
    FSeek(pos);
    return x;
}

struct {
   local int i, oldPos;

   TOCHeader header;

   for(i = 0; i < NUM_SNO_GROUPS; i++) {
      if(header.entryCounts[i] > 0) {
         oldPos = goto(header.entryOffsets[i] + sizeof(TOCHeader));
         struct EntryData {
            struct {
               DWORD snoGroup;
               DWORD snoId;
               DWORD pName;
               local int p = goto(header.entryOffsets[i] + sizeof(TOCHeader) + 12 * header.entryCounts[i] + pName);
               string name;
               FSeek(p);
            } entries[header.entryCounts[i]]<bgcolor=0xffaabb,optimize=false>;
         } groupData<optimize=false>;
         FSeek(oldPos);
      }
   }

} CoreTOC;

advocaite avatar Jan 18 '23 06:01 advocaite

I'd vote to open a wiki for this.

iamdroppy avatar Jan 20 '23 01:01 iamdroppy

I think a Wiki Would actually be nice to have

advocaite avatar Jan 20 '23 08:01 advocaite