/// <summary> /// Disassemble all functions in any classes that have matching names. /// </summary> /// <param name="output">The StringBuilder to emit disassembled bytecode to.</param> /// <param name="classnameSubstring">A class must contain this substring to be disassembled.</param> public static void DisassembleAllFunctionsInClasses(StringBuilder output, string classnameSubstring) { ScriptDisassembler disasm = new ScriptDisassembler(output); foreach (UClass unrealClass in new TObjectIterator <UClass>()) { string className = unrealClass.GetName(); if (classnameSubstring.IndexOf(classnameSubstring, StringComparison.OrdinalIgnoreCase) >= 0) { output.AppendLine("Processing class " + className); foreach (UFunction function in unrealClass.GetFields <UFunction>(false)) { string functionName = function.GetName(); byte[] buffer = function.Script; int len = buffer == null ? 0 : buffer.Length; output.AppendLine(" Processing function " + functionName + " (" + len + " bytes)"); disasm.DisassembleStructure(function); output.AppendLine(); } } output.AppendLine(); output.AppendLine("-----------"); output.AppendLine(); } }
public static void DisassembleAllFunctionsInClass(StringBuilder output, UClass unrealClass) { if (unrealClass != null) { ScriptDisassembler disasm = new ScriptDisassembler(output); output.AppendLine("Processing class " + unrealClass.GetName()); foreach (UFunction function in unrealClass.GetFields <UFunction>(false)) { string functionName = function.GetName(); byte[] buffer = function.Script; int len = buffer == null ? 0 : buffer.Length; output.AppendLine(" Processing function " + functionName + " (" + len + " bytes)"); disasm.DisassembleStructure(function); output.AppendLine(); } } }