The main purpose of this thread is to see who out there is working on solving the MSC mystery and what progress they've made, and to sum up what I know of it so far to help drive interest.
So far I have found a solitary source of information on MSC in the form of a python script
It's found in dantarion's sm4shtools: https://github.com/dantarion/sm4shtools
If anyone has any other information, please share it.
What I know of the MSCSB file format:
All sections are aligned to 16 bytes
There is a 0x30 byte header:
The size of the rest of the file depends on the header contents, but follows this format:
The entry table is just 4 byte pointers into the data block.
The strings appear to have c style formatting.
What I have figured out about commands beyond what's available in sm4shtools:
I know this isn't a lot of information to go on yet. There are over 2000 function entries in captain falcon's msc, significantly less in something like the hadoken msc. Projectiles and other things with their own msc may be a better starting place than an entire fighter just because they're smaller, but they may or may not be useful toward reprogramming a fighter. I did notice that Ryu's msc is larger than falcon's, but not by too much. It's in all likelihood due to handling Ryu's special inputs. All of bayonetta's extra bits (gamorrah, the bats, her hair, her smashes) all have their own msc and *may* prove a useful starting point.
So far I have found a solitary source of information on MSC in the form of a python script
It's found in dantarion's sm4shtools: https://github.com/dantarion/sm4shtools
If anyone has any other information, please share it.
What I know of the MSCSB file format:
All sections are aligned to 16 bytes
There is a 0x30 byte header:
Code:
offset size description
-------------------------
0x00 16 unknown, but is constant
0x10 4 size of the data block
0x14 4 entry point? (don't know enough to confirm yet)
0x18 4 number of table entries
0x1C 4 unknown
0x20 4 string size
0x24 4 number of strings
0x28 4 unknown (possibly padding)
0x2C 4 unknown (possibly padding)
The size of the rest of the file depends on the header contents, but follows this format:
Code:
Header
Data Block
Entry Table
String Table
The entry table is just 4 byte pointers into the data block.
The strings appear to have c style formatting.
What I have figured out about commands beyond what's available in sm4shtools:
Commands appear to only use the lower 7 bits to identify, that is 0x0A and 0x8A are the same command, at least going by dantarion's command labeling. I don't know what the purpose, if any, of the highest bit is.
The following information may not be 100% accurate. Take it with a grain of salt.
Commands 0x2X/0xAX and commands 0x34-0x36 help to form if statements.
0x2X/0xAX set some kind of condition flag.
0x34 and 0x36 are conditional branches based on this flag.
0x35 is a conditional branch based on the contents of the stack.
So far, I've seen if statements of the form:
The following information may not be 100% accurate. Take it with a grain of salt.
Commands 0x2X/0xAX and commands 0x34-0x36 help to form if statements.
0x2X/0xAX set some kind of condition flag.
0x34 and 0x36 are conditional branches based on this flag.
0x35 is a conditional branch based on the contents of the stack.
So far, I've seen if statements of the form:
Code:
if_statement:
8B variable ; push a variable onto the stack
8A number ; push a number onto the stack
AX ; compare the two and set/clear the condition flag
34 no_cond ; branch to decision if !condition
8A 1 ; push 1 onto the stack
36 decision ; branch to decision if condition
no_cond:
8A 0 ; push 0 onto the stack
decision:
35 no_action ; branch if top of stack is 1?
; some code goes here
no_action:
; continue code here
I know this isn't a lot of information to go on yet. There are over 2000 function entries in captain falcon's msc, significantly less in something like the hadoken msc. Projectiles and other things with their own msc may be a better starting place than an entire fighter just because they're smaller, but they may or may not be useful toward reprogramming a fighter. I did notice that Ryu's msc is larger than falcon's, but not by too much. It's in all likelihood due to handling Ryu's special inputs. All of bayonetta's extra bits (gamorrah, the bats, her hair, her smashes) all have their own msc and *may* prove a useful starting point.






