mirror of
https://github.com/ZuneDev/ZuneUIXTools.git
synced 2026-07-27 13:11:59 -07:00
[WIP] First pass at script decompilation
This commit is contained in:
@@ -11,7 +11,7 @@ using System.Xml.Linq;
|
||||
|
||||
namespace Microsoft.Iris.DecompXml;
|
||||
|
||||
public class Decompiler
|
||||
public partial class Decompiler
|
||||
{
|
||||
private static readonly XNamespace _nsUix = XNamespace.Get("http://schemas.microsoft.com/2007/uix");
|
||||
private readonly DecompileContext _context;
|
||||
@@ -51,6 +51,22 @@ public class Decompiler
|
||||
if (export.InitializePropertiesOffset is not uint.MaxValue)
|
||||
AnalyzeMethodForInit(export.InitializePropertiesOffset, xExport, export, name + "_prop");
|
||||
|
||||
if (export.InitialEvaluateOffsets is { Length: > 0 })
|
||||
{
|
||||
XElement xScripts = new(_nsUix + "Scripts");
|
||||
|
||||
foreach (var offset in export.InitialEvaluateOffsets)
|
||||
{
|
||||
var syntaxTree = DecompileScript(offset, export);
|
||||
var scriptText = FormatScript(syntaxTree);
|
||||
|
||||
XElement xScript = new(_nsUix + "Script", scriptText);
|
||||
xScripts.Add(xScript);
|
||||
}
|
||||
|
||||
xExport.Add(xScripts);
|
||||
}
|
||||
|
||||
if (export.InitializeContentOffset is not uint.MaxValue)
|
||||
AnalyzeMethodForInit(export.InitializeContentOffset, xExport, export, name + "_cont");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user