Skip to content
Branch: master
Go to file

Latest commit


Failed to load latest commit information.
Latest commit message
Commit time


Python library for working with MSC (Smash 4 Moveset Code)

Requires a somewhat recent version of python 3. (>3.5 should be fine)

Using included assembler and disassembler


  • Have a Scripts file (look at a disassembled mscsb for example)
  • In the same folder run python or in whatever folder python [pathOfScriptFile]
  • output will be to


  • python [pathOfMscsb] and it will output in the output folder
  • The disassembler will set up everything needed to relink all the scripts by analyzing every script in order to locate script offsets as well as making if/else/jump/etc. use labels
  • Disassembly should leave everything setup for immediate reassembly
  • Any possible script offsets not found by the disassembler analysis will be printed out and may require manual renaming

Scripts file:

A Scripts file is a file that tells the assembler how to link the scripts. The format is rather simple:

  • Use # for comments
  • Each non-blank, non-comment line is a script
  • Add a > before a script name to indicate it is a global file, global files are where you define strings and global aliases
  • Add a ':' before the script you want to be the entrypoint, if none is picked it defaults to script_0
  • In your scripts you can reference the offsets of other scripts using script_# where # is the script number, script number is determined by the index of the scripts in the Scripts file not including globals, blank lines or comments however most of the printed offsets do not need updating so only do this if something breaks!
  • Add a '|' before any paths you want the mscsb to be saved to

Example Script file:

#comment (this is ignored)

setupVars.txt                  #this is script_0
>strings.txt                   #this is a globals file
wavedash.txt                   #this is script_1

:start.txt                     #this is script_2 and the entrypoint
|lucinaWithWaveDashing.mscsb   #this is where it will saved
|testFolder/archive/test.mscsb #it will also save here

Library Basics

Importing library:

from msc import *

Reading in an MSC File:

with open(filename, 'rb') as f:
  mscData = MscFile()

Including debug strings in string output of commands:


Iterating through file: (+ getting command name from command number)

for script in mscData:
  for line in script:
    print("Command Name = "+COMMAND_NAMES[line.command])

Looking at command parameters:

test_stack = []
if line.command == 0xA: #if the command is pushInt


Thanks to Sammi Husky and Dantarion for doing a huge amount of preliminary research for this.


Python library for working with MSC (Smash 4 Moveset Code)





No releases published

Contributors 4

You can’t perform that action at this time.