Skip to content
DorfDork edited this page Apr 29, 2020 · 8 revisions
//------------------------------------------------
//--- 010 Editor v10.0 Binary Template
//
//      File: 
//   Authors: DorfDork & dtlnor
//   Version: 
//   Purpose: 
//  Category: 
// File Mask: *.fsm
//  ID Bytes: 
//   History: We managed to get the files mapped out, now to label and figure stuff out
//------------------------------------------------

local int i;
local int j;
local int Bytes;

local int StringCount;
local string CompareString;

typedef struct {
	for(i=0;i<NumOfOffsets;i++){
        for(j=0;j<mInfo.Array[i].Counts;j++){
		    FSeek(mInfo.Array[i].sub[j].mParamStringOffset + 24);
            struct {
                string mName;
            } Names;
	    }
    }
} ParamString;

typedef struct {
    uint64 mParamStringOffset;
    ushort unk2;
    ushort unk3;
    uint unk3;
    uint64 unk4;
    uint64 unk5;
    uint64 unk6;
    uint64 unk7;
    uint64 unk8;
    uint64 unk9;
    uint64 unk10;
    uint64 unk11;
} Unksubarr;

typedef struct {
    for(i=0;i<NumOfOffsets;i++){
        FSeek(mInfoOffsets[i] + 24);
        struct {
            uint64 Header;
            uint64 Counts;
            Unksubarr sub[Counts];
        } Array;
    }
} Unkarr;

typedef struct {
    ushort Unk9;
    ushort IDUnk;
    ushort Unk11;
    ushort Unk12;
    ushort Unk13;
    ushort Unk14;
    uint SubActivityHeader;  //section start???
    string SubActivityData <optimize=false>; //t000x
    uint Unk1;
    uint SubActivityID;
    uint Unk2;
    ubyte Unk3;
    uint Unk4;
    uint Unk2;
} SubActivity;

typedef struct {
    string ActivityName <optimize=false>;
    uint Unk1;
    uint ActivityID;
    uint Unk2;
    uint Unk3; //?
    uint Unk4;
    uint Unk5;
    uint Unk6;
    ushort Unk7;
    ushort Unk8;
    uint SubActivityCount;
    SubActivity SubActivityData[SubActivityCount]<optimize=false>; //t000x
    ushort Unk6;
    ushort Unk7;
    ushort Unk8;
    ushort Unk9;
    ushort Unk10;
    ushort Unk11;
    ushort Unk15;
    ushort Unk16;
} Activity;

typedef struct {
    uint FSMHeader;
	string FSM;
	uint unk9;
	uint unk10;
	uint unk11;
	uint unk12;
	uint unk13;
	uint unk14;
	uint unk15;
	uint unk16;
	uint unk17;
	uint unk18;
} FSMP;

typedef struct {
	for(i=0;i<NumOfContainers;i++){
		struct {
            uint LengthOfBytes;
	        uint unk22;
			uint ActivityHeader; //section start???
			if (ActivityHeader != 0) Activity ActData<bgcolor=0x802080, optimize=false>;
			uint TypeOfActionHeader;
            string Action;
            uint ContainerHeader;
            string ContainerName; //containerName
            Bytes = sizeof(ActData) + sizeof(Action) + sizeof(ContainerName);
            Bytes = LengthOfBytes - Bytes - 16;
            ubyte arr[Bytes];
		} ContainFiller;
	}
} Container;

typedef struct {
    for(i=0;i<NumOfFSM;i++){
        struct {
            uint ByteLength;
            ubyte arr[ByteLength];
        } Filler;
    }
} FSMStruct;

string XFS <optimize=false>;
short Version;
short unk0;
uint64 unk1;
uint NumOfOffsets;
uint OffsetOfUnks1;
uint64 mInfoOffsets[NumOfOffsets];
Unkarr mInfo<bgcolor=0x00ff00>;
ParamString mParamString<bgcolor=0xff0000>;
FSeek(OffsetOfUnks1 + 24);
ushort unk1;
ushort unk2;
uint ByteLengthOfFSMP1<comment ="Length of bytes from this point to the end of file">;
uint unk5;
uint unk6;
uint unk7;
FSMP fsmp;
uint NumOfContainers;
uint unk20;
Container container;
uint unk21;
uint ByteLengthOfFSMP2<comment ="Length of bytes from this point to the end of file">;
uint unk23;
uint unk24;
uint unk25;
uint NumOfFSM;
uint unk27;
FSMStruct fsm;

Clone this wiki locally