Skip to content

Instantly share code, notes, and snippets.

@Warpten

Warpten/BMSSD.bt Secret

Last active October 29, 2021 16:25
Show Gist options
  • Save Warpten/cafe5fd6d6dec3c17596707871781dbb to your computer and use it in GitHub Desktop.
Save Warpten/cafe5fd6d6dec3c17596707871781dbb to your computer and use it in GitHub Desktop.
//------------------------------------------------
//--- 010 Editor v9.0.2 Binary Template
//
// File: BMSSD.bt
// Authors: Warpten
// Version: 0.1
// Purpose: Parsing Metroid Dread BMSSD files
// Category: Metroid Dread
// File Mask:
// ID Bytes:
// History: 0.1 - Initial Version
//------------------------------------------------
// sub_7100200044 in 1.0.0
struct cstr_t {
while (ReadByte() != '\0')
char c;
FSeek(FTell() + 1);
};
struct mssd_t {
char magic[4]; // MSSD
int unk0;
int count1 <hidden=true>;
struct part_info_t {
cstr_t model_name <comment="bcmdl">;
char byte0;
char byte1;
char byte2;
int int3;
char byte4;
float farr4[3];
float farr5[3];
float farr6[3];
} parts[count1] <optimize=false>;
int count2 <hidden=true>;
struct {
cstr_t str1;
int int2;
local int i;
for (i = 0; i < int2; ++i) {
struct {
float float1[3];
float float2[3];
float float3[3];
} elem;
}
} model_infos[count2] <optimize=false>;
int count3 <hidden=true>;
cstr_t strs4[count3];
int count4 <hidden=true>;
struct {
cstr_t str1;
char char2;
char char3;
char char4;
int int5;
int int6;
int int7;
char char8;
char char9;
int int10;
char char11[16];
int int12; // This is important, causes floats to be intrpreted differently
float float13[3];
float float14[3];
float float15[3];
int int_16; // 010 thinks this is a type without _
float float17;
float float18;
float float19;
} idk_at_this_point[count4] <optimize=false>;
int count5 <hidden=true>;
cstr_t strs6[count5];
int count7;
struct {
cstr_t str1;
int int2;
int int3;
local int i;
for (i = 0; i < int3; ++i) {
struct {
int int1;
int int2;
int64 long3[int2];
} struct4;
}
} struct8[count7] <optimize=false>;
} mssd;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment