What's new

Tools BO3 GSC Disassembler

  • Thread starter CraftyCritter
  • Start date
  • Views 2,533
C

CraftyCritter

Newbie
Messages
15
Reaction score
8
This is a disassembler (not decompiler) that converts Xbox 360 (and possibly PlayStation 3) BO3 GSC Opcodes into their named form. This is not very useful for people who want to just load custom GSCs, but for small edits of already loaded GSCs it can be useful.

First of all, a list of opcodes. They go from 0x00 - 0xFF and have repeats of the same function for some reason, different from the other cods that only used 1 of each. A lot of functions that were in bo2 have been taken out and replaced by internal functions, for example anglestoforward, abs, and every dvar opcode have been taken out and replaced with xex functions and there are new functions that are in the PC version of bo3. VM_Execute has also changed from bo2, using individual functions instead of one massive function. I haven't named 3 functions, and they were never called during my testing so they aren't really needed. If you find even one use of them, please PM me.

The GSCs also hash literally everything they can now, so all function names, gsc file names, variable names, objects, etc are hashed so bo2 GSCs are your best bet for finding the name apart from hashing possible names and seeing if they match up.

Code:
OP_VoidCodePos = 0x00,
OP_VoidCodePos = 0x01,
OP_ClearParams = 0x02,
OP_End = 0x03,
OP_CallBuiltin = 0x04,
OP_EvalLocalVariableRef = 0x05,
OP_VoidCodePos = 0x06,
OP_PreScriptCall = 0x07,
OP_VoidCodePos = 0x08,
OP_CheckClearParams = 0x09,
OP_EvalLocalVariable = 0x0A,
OP_VoidCodePos = 0x0B,
OP_VoidCodePos = 0x0C,
OP_VoidCodePos = 0x0D,
OP_VoidCodePos = 0x0E,
OP_VoidCodePos = 0x0F,
OP_VoidCodePos = 0x10,
OP_GetUIntPointer = 0x11,
OP_BoolNot = 0x12,
OP_CreateLocalVariable = 0x13,
OP_JumpOnTrue = 0x14,
OP_GetSelfObject = 0x15,
OP_Inc = 0x16,
OP_GetByte = 0x17,
OP_Bit_And = 0x18,
OP_RealWait = 0x19,
OP_ScriptThreadCallPointer = 0x1A,
OP_GetString = 0x1B,
OP_GetIString = 0x1C,
sub_822C9818 = 0x1D,
OP_GetZero = 0x1E,
OP_ShiftLeft = 0x1F,
OP_GetGame = 0x20,
OP_SuperNotEqual = 0x21,
OP_JumpOnFalseExpr = 0x22,
OP_ScriptFunctionCallPointer = 0x23,
OP_VoidCodePos = 0x24,
OP_ShiftRight = 0x25,
OP_GetGameRef = 0x26,
OP_ClassFunctionCall = 0x27,
OP_GetFunction = 0x28,
OP_GetIString = 0x29,
OP_EndSwitch = 0x2A,
OP_ClassFunctionThreadCall = 0x2B,
OP_GetClassesObject = 0x2C,
OP_FirstArrayKey = 0x2D,
OP_Return = 0x2E,
OP_Plus = 0x2F,
OP_ScriptFunctionCall = 0x30,
OP_IsDefined = 0x31,
OP_ScriptMethodCall = 0x32,
OP_VoidCodePos = 0x33,
OP_ScriptMethodCall = 0x34,
OP_SuperNotEqual = 0x35,
OP_GetLevel = 0x36,
OP_GetNegUnsignedShort = 0x37,
OP_GetNegByte = 0x38,
OP_GetLongUndefined = 0x39,
OP_ScriptMethodCall = 0x3A,
OP_GetFunction = 0x3B,
OP_VoidCodePos = 0x3C,
OP_GetFunction = 0x3D,
OP_ClassFunctionCall = 0x3E,
OP_Notify = 0x3F,
OP_JumpOnTrue = 0x40,
OP_EndOn = 0x41,
OP_NextArrayKey = 0x42,
OP_GetAnimation = 0x43,
OP_LessThan = 0x44,
OP_EvalSelfFieldVariableRef = 0x45,
OP_GetString = 0x46,
OP_DecTop = 0x47,
OP_GetUndefined = 0x48,
OP_SetVariableField = 0x49,
OP_EvalLevelFieldVariable = 0x4A,
OP_GetEmptyArray = 0x4B,
OP_ClearArray = 0x4C,
OP_VoidCodePos = 0x4D,
OP_WaitTill = 0x4E,
OP_GetApiFunction = 0x4F,
OP_WaitTillFrameEnd = 0x50,
OP_EndSwitch = 0x51,
OP_GetSelf = 0x52,
OP_GetFloat = 0x53,
OP_ClearArray = 0x54,
OP_Wait = 0x55,
OP_GetHash = 0x56,
OP_GetClassesObject = 0x57,
OP_VoidCodePos = 0x58,
sub_822C9728 = 0x59,
OP_GetFloat = 0x5A,
OP_WaitTill = 0x5B,
OP_SizeOf = 0x5C,
OP_EvalArrayRef = 0x5D,
OP_ScriptMethodCallPointer = 0x5E,
OP_EvalLevelFieldVariable = 0x5F,
OP_BoolComplement = 0x60,
OP_Bit_And = 0x61,
OP_Bit_Xor = 0x62,
OP_Modulus = 0x63,
OP_EvalArray = 0x64,
OP_EvalFieldVariable = 0x65,
OP_SuperEqual = 0x66,
sub_822C9888 = 0x67,
OP_Bit_Or = 0x68,
OP_LessThanOrEqualTo = 0x69,
OP_DecTop = 0x6A,
OP_GetObjectType = 0x6B,
OP_Multiply = 0x6C,
OP_Vector = 0x6D,
OP_GetTime = 0x6E,
OP_SizeOf = 0x6F,
OP_GetFloat = 0x70,
sub_822C9728 = 0x71,
OP_EvalLocalVariableRefCached = 0x72,
OP_ScriptFunctionCallPointer = 0x73,
OP_Switch = 0x74,
OP_VoidCodePos = 0x75,
OP_VoidCodePos = 0x76,
OP_GetTime = 0x77,
OP_Vector = 0x78,
OP_VoidCodePos = 0x79,
OP_GetHash = 0x7A,
OP_CastBool = 0x7B,
OP_GetAnimation = 0x7C,
OP_VoidCodePos = 0x7D,
OP_ShiftRight = 0x7E,
OP_Inc = 0x7F,
OP_NotEqual = 0x80,
OP_JumpOnTrue = 0x81,
OP_VoidCodePos = 0x82,
OP_GetAnimation = 0x83,
OP_GreaterThan = 0x84,
OP_EvalSelfFieldVariable = 0x85,
OP_VoidCodePos = 0x86,
OP_GetAnim = 0x87,
OP_CreateLocalVariable = 0x88,
OP_Jump = 0x89,
OP_EvalArrayRef = 0x8A,
OP_EvalLocalVariableCached = 0x8B,
OP_ScriptMethodThreadCall = 0x8C,
OP_VoidCodePos = 0x8D,
OP_Dec = 0x8E,
OP_Equal = 0x8F,
OP_Notify = 0x90,
OP_ClassFunctionThreadCall = 0x91,
OP_SetWaittillVariableFieldCached = 0x92,
OP_BoolComplement = 0x93,
OP_BoolNot = 0x94,
sub_822C9818 = 0x95,
OP_Minus = 0x96,
OP_VoidCodePos = 0x97,
OP_CastFieldObject = 0x98,
OP_GetVector = 0x99,
OP_Divide = 0x9A,
OP_ScriptThreadCallPointer = 0x9B,
OP_Jump = 0x9C,
OP_GetUndefined = 0x9D,
OP_GetByte = 0x9E,
OP_JumpOnFalse = 0x9F,
OP_CallBuiltinMethod = 0xA0,
OP_EvalFieldVariableRef = 0xA1,
OP_ScriptThreadCall = 0xA2,
OP_VoidCodePos = 0xA3,
OP_VoidCodePos = 0xA4,
OP_WaitTillMatch = 0xA5,
OP_GetSelf = 0xA6,
OP_VoidCodePos = 0xA7,
OP_SetWaittillVariableFieldCached = 0xA8,
OP_SuperEqual = 0xA9,
OP_EndOn = 0xAA,
OP_GetString = 0xAB,
OP_Jump = 0xAC,
OP_GetNegByte = 0xAD,
OP_GreaterThanOrEqualTo = 0xAE,
OP_ClearFieldVariable = 0xAF,
OP_IsDefined = 0xB0,
OP_GetUndefined = 0xB1,
OP_VectorConstant = 0xB2,
OP_VoidCodePos = 0xB3,
OP_EvalFieldVariableRef = 0xB4,
OP_GetAnim = 0xB5,
OP_GetApiFunction = 0xB6,
OP_GetGameRef = 0xB7,
OP_JumpOnTrueExpr = 0xB8,
OP_GetLongUndefined = 0xB9,
OP_Modulus = 0xBA,
OP_GetInteger = 0xBB,
OP_Jump = 0xBC,
OP_GetZero = 0xBD,
OP_BoolComplement = 0xBE,
OP_SetVariableField = 0xBF,
OP_Multiply = 0xC0,
OP_CastBool = 0xC1,
OP_JumpOnFalse = 0xC2,
OP_Bit_Or = 0xC3,
OP_VoidCodePos = 0xC4,
OP_VoidCodePos = 0xC5,
OP_SafeSetVariableFieldCached = 0xC6,
OP_SetVariableField = 0xC7,
sub_822C9818 = 0xC8,
OP_CallBuiltinMethod = 0xC9,
OP_GetLevel = 0xCA,
OP_GetUndefined = 0xCB,
OP_VoidCodePos = 0xCC,
OP_Equal = 0xCD,
OP_GetEmptyArray = 0xCE,
OP_WaitTillMatch = 0xCF,
OP_FirstArrayKey = 0xD0,
OP_EndOn = 0xD1,
OP_EvalSelfFieldVariableRef = 0xD2,
OP_Wait = 0xD3,
OP_ScriptThreadCall = 0xD4,
OP_VectorScale = 0xD5,
OP_EvalLevelFieldVariableRef = 0xD6,
OP_VectorConstant = 0xD7,
OP_VoidCodePos = 0xD8,
OP_EvalFieldVariable = 0xD9,
OP_Switch = 0xDA,
OP_Jump = 0xDB,
OP_GetApiFunction = 0xDC,
OP_VoidCodePos = 0xDD,
OP_WaitTillFrameEnd = 0xDE,
OP_EvalArray = 0xDF,
OP_Plus = 0xE0,
OP_GetLevelObject = 0xE1,
OP_ScriptMethodCallPointer = 0xE2,
OP_GetAnimObject = 0xE3,
OP_EndSwitch = 0xE4,
OP_GetUIntPointer = 0xE5,
OP_JumpOnFalse = 0xE6,
OP_VoidCodePos = 0xE7,
OP_SafeDecTop = 0xE8,
OP_GetUnsignedShort = 0xE9,
OP_RealWait = 0xEA,
OP_SafeDecTop = 0xEB,
OP_RealWait = 0xEC,
OP_GetUndefined = 0xED,
OP_VoidCodePos = 0xEE,
OP_EvalLevelFieldVariableRef = 0xEF,
OP_GetLevel = 0xF0,
OP_NextArrayKey = 0xF1,
OP_VoidCodePos = 0xF2,
OP_GetClassesObject = 0xF3,
OP_EvalLocalVariableCached = 0xF4,
OP_GreaterThanOrEqualTo = 0xF5,
OP_Multiply = 0xF6,
OP_VectorScale = 0xF7,
OP_VoidCodePos = 0xF8,
OP_ClearFieldVariable = 0xF9,
OP_ScriptMethodThreadCallPointer = 0xFA,
OP_Plus = 0xFB,
OP_NotEqual = 0xFC,
OP_Return = 0xFD,
OP_WaitTill = 0xFE,
OP_NextArrayKey = 0xFF

I have also neglected to reverse animtrees as I can't find any scripts that use them apart from a few that declare #using_animtree( "generic" ) but don't use them, so if anybody finds a script with a lot of them I'll do it.

Download:
[Click here to view this link]

Virus Scan:
https://www.virustotal.com/gui/url/...4666d28cffebca4cb0450408d8717457d34/detection


Source code:
[Click here to view this link]

Source Virus Scan:
https://www.virustotal.com/gui/url/...c94356cfdc35ec5ee5f39dd3bef21177d04/detection


Also I recommend my previous thread about GSC function naming as it is very useful for internal function calls.
If you need any help feel free to PM or reply.
 
Last edited:
C

CraftyCritter

Newbie
Messages
15
Reaction score
8
New update:
- It is now near instant when disassembling scripts as it is now using the StringBuilder class for every text box.
- Wordwrap has been disabled and horizontal scroll bars are now on the includes and output box.

I would recommend looking at my loader + compiler post, it has everything all in one download (including the updated disassembler):
https://www.se7ensins.com/forums/threads/custom-gsc-loader-compiler-release.1826438/

Download: [Click here to view this link]
Virus scan: https://www.virustotal.com/gui/url-...f2ce3141580c8b2c5202359ec559986e07-1621263056
 
Top Bottom