From 00fbf5113e629b1ce5129fbe0d743b9ca3f35b8e Mon Sep 17 00:00:00 2001
From: ds5678 <49847914+ds5678@users.noreply.github.com>
Date: Tue, 18 Jun 2024 07:52:39 -0700
Subject: [PATCH 1/2] Remove GUI Code
---
Cpp2IL.Gui/.gitignore | 454 -----------
Cpp2IL.Gui/App.axaml | 14 -
Cpp2IL.Gui/App.axaml.cs | 36 -
Cpp2IL.Gui/Assets/avalonia-logo.ico | Bin 34473 -> 0 bytes
Cpp2IL.Gui/ClassFileBuilder.cs | 280 -------
Cpp2IL.Gui/ConsoleAvaloniaSink.cs | 161 ----
Cpp2IL.Gui/Cpp2IL.Gui.csproj | 46 --
Cpp2IL.Gui/GuiUtils.cs | 160 ----
Cpp2IL.Gui/Images/Assembly.png | Bin 381 -> 0 bytes
Cpp2IL.Gui/Images/Class.png | Bin 518 -> 0 bytes
Cpp2IL.Gui/Images/ImageResources.cs | 13 -
Cpp2IL.Gui/Images/Method.png | Bin 398 -> 0 bytes
Cpp2IL.Gui/Images/NameSpace.png | Bin 242 -> 0 bytes
Cpp2IL.Gui/MethodBodyMode.cs | 9 -
Cpp2IL.Gui/MethodBodyModes.cs | 14 -
Cpp2IL.Gui/Models/DroppedGame.cs | 30 -
Cpp2IL.Gui/Models/DroppedSingleApkGame.cs | 69 --
Cpp2IL.Gui/Models/DroppedWindowsGame.cs | 68 --
Cpp2IL.Gui/Models/FileTreeEntry.cs | 141 ----
Cpp2IL.Gui/Models/LooseFilesDroppedGame.cs | 61 --
Cpp2IL.Gui/Program.cs | 36 -
Cpp2IL.Gui/ViewLocator.cs | 33 -
.../ViewModels/InputUnityVersionViewModel.cs | 15 -
Cpp2IL.Gui/ViewModels/MainWindowViewModel.cs | 160 ----
Cpp2IL.Gui/ViewModels/ViewModelBase.cs | 11 -
.../Views/InputUnityVersionDialog.axaml | 27 -
.../Views/InputUnityVersionDialog.axaml.cs | 28 -
Cpp2IL.Gui/Views/MainWindow.axaml | 76 --
Cpp2IL.Gui/Views/MainWindow.axaml.cs | 80 --
Cpp2IL.sln | 16 +-
SharpTreeView/Consts.cs | 77 --
SharpTreeView/Converters.cs | 12 -
SharpTreeView/EditTextBox.cs | 78 --
SharpTreeView/ExtensionMethods.cs | 34 -
SharpTreeView/FlatListTreeNode.cs | 395 ---------
SharpTreeView/GeneralAdorner.cs | 29 -
SharpTreeView/InsertMarker.cs | 11 -
SharpTreeView/LinesRenderer.cs | 58 --
SharpTreeView/Properties/AssemblyInfo.cs | 38 -
.../Properties/GlobalAssemblyInfo.cs | 38 -
SharpTreeView/SharpGridView.cs | 20 -
SharpTreeView/SharpTreeNode.cs | 635 ---------------
SharpTreeView/SharpTreeNodeCollection.cs | 201 -----
SharpTreeView/SharpTreeNodeView.cs | 191 -----
SharpTreeView/SharpTreeView.cs | 766 ------------------
SharpTreeView/SharpTreeView.csproj | 46 --
SharpTreeView/SharpTreeViewItem.cs | 129 ---
SharpTreeView/SharpTreeViewTextSearch.cs | 145 ----
SharpTreeView/Themes/TreeView.xaml | 269 ------
SharpTreeView/TreeFlattener.cs | 134 ---
SharpTreeView/TreeTraversal.cs | 54 --
SharpTreeView/copyright.txt | 10 -
SharpTreeView/license.txt | 458 -----------
53 files changed, 2 insertions(+), 5864 deletions(-)
delete mode 100644 Cpp2IL.Gui/.gitignore
delete mode 100644 Cpp2IL.Gui/App.axaml
delete mode 100644 Cpp2IL.Gui/App.axaml.cs
delete mode 100644 Cpp2IL.Gui/Assets/avalonia-logo.ico
delete mode 100644 Cpp2IL.Gui/ClassFileBuilder.cs
delete mode 100644 Cpp2IL.Gui/ConsoleAvaloniaSink.cs
delete mode 100644 Cpp2IL.Gui/Cpp2IL.Gui.csproj
delete mode 100644 Cpp2IL.Gui/GuiUtils.cs
delete mode 100644 Cpp2IL.Gui/Images/Assembly.png
delete mode 100644 Cpp2IL.Gui/Images/Class.png
delete mode 100644 Cpp2IL.Gui/Images/ImageResources.cs
delete mode 100644 Cpp2IL.Gui/Images/Method.png
delete mode 100644 Cpp2IL.Gui/Images/NameSpace.png
delete mode 100644 Cpp2IL.Gui/MethodBodyMode.cs
delete mode 100644 Cpp2IL.Gui/MethodBodyModes.cs
delete mode 100644 Cpp2IL.Gui/Models/DroppedGame.cs
delete mode 100644 Cpp2IL.Gui/Models/DroppedSingleApkGame.cs
delete mode 100644 Cpp2IL.Gui/Models/DroppedWindowsGame.cs
delete mode 100644 Cpp2IL.Gui/Models/FileTreeEntry.cs
delete mode 100644 Cpp2IL.Gui/Models/LooseFilesDroppedGame.cs
delete mode 100644 Cpp2IL.Gui/Program.cs
delete mode 100644 Cpp2IL.Gui/ViewLocator.cs
delete mode 100644 Cpp2IL.Gui/ViewModels/InputUnityVersionViewModel.cs
delete mode 100644 Cpp2IL.Gui/ViewModels/MainWindowViewModel.cs
delete mode 100644 Cpp2IL.Gui/ViewModels/ViewModelBase.cs
delete mode 100644 Cpp2IL.Gui/Views/InputUnityVersionDialog.axaml
delete mode 100644 Cpp2IL.Gui/Views/InputUnityVersionDialog.axaml.cs
delete mode 100644 Cpp2IL.Gui/Views/MainWindow.axaml
delete mode 100644 Cpp2IL.Gui/Views/MainWindow.axaml.cs
delete mode 100644 SharpTreeView/Consts.cs
delete mode 100644 SharpTreeView/Converters.cs
delete mode 100644 SharpTreeView/EditTextBox.cs
delete mode 100644 SharpTreeView/ExtensionMethods.cs
delete mode 100644 SharpTreeView/FlatListTreeNode.cs
delete mode 100644 SharpTreeView/GeneralAdorner.cs
delete mode 100644 SharpTreeView/InsertMarker.cs
delete mode 100644 SharpTreeView/LinesRenderer.cs
delete mode 100644 SharpTreeView/Properties/AssemblyInfo.cs
delete mode 100644 SharpTreeView/Properties/GlobalAssemblyInfo.cs
delete mode 100644 SharpTreeView/SharpGridView.cs
delete mode 100644 SharpTreeView/SharpTreeNode.cs
delete mode 100644 SharpTreeView/SharpTreeNodeCollection.cs
delete mode 100644 SharpTreeView/SharpTreeNodeView.cs
delete mode 100644 SharpTreeView/SharpTreeView.cs
delete mode 100644 SharpTreeView/SharpTreeView.csproj
delete mode 100644 SharpTreeView/SharpTreeViewItem.cs
delete mode 100644 SharpTreeView/SharpTreeViewTextSearch.cs
delete mode 100644 SharpTreeView/Themes/TreeView.xaml
delete mode 100644 SharpTreeView/TreeFlattener.cs
delete mode 100644 SharpTreeView/TreeTraversal.cs
delete mode 100644 SharpTreeView/copyright.txt
delete mode 100644 SharpTreeView/license.txt
diff --git a/Cpp2IL.Gui/.gitignore b/Cpp2IL.Gui/.gitignore
deleted file mode 100644
index 8afdcb63..00000000
--- a/Cpp2IL.Gui/.gitignore
+++ /dev/null
@@ -1,454 +0,0 @@
-## Ignore Visual Studio temporary files, build results, and
-## files generated by popular Visual Studio add-ons.
-##
-## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
-
-# User-specific files
-*.rsuser
-*.suo
-*.user
-*.userosscache
-*.sln.docstates
-
-# User-specific files (MonoDevelop/Xamarin Studio)
-*.userprefs
-
-# Mono auto generated files
-mono_crash.*
-
-# Build results
-[Dd]ebug/
-[Dd]ebugPublic/
-[Rr]elease/
-[Rr]eleases/
-x64/
-x86/
-[Ww][Ii][Nn]32/
-[Aa][Rr][Mm]/
-[Aa][Rr][Mm]64/
-bld/
-[Bb]in/
-[Oo]bj/
-[Ll]og/
-[Ll]ogs/
-
-# Visual Studio 2015/2017 cache/options directory
-.vs/
-# Uncomment if you have tasks that create the project's static files in wwwroot
-#wwwroot/
-
-# Visual Studio 2017 auto generated files
-Generated\ Files/
-
-# MSTest test Results
-[Tt]est[Rr]esult*/
-[Bb]uild[Ll]og.*
-
-# NUnit
-*.VisualState.xml
-TestResult.xml
-nunit-*.xml
-
-# Build Results of an ATL Project
-[Dd]ebugPS/
-[Rr]eleasePS/
-dlldata.c
-
-# Benchmark Results
-BenchmarkDotNet.Artifacts/
-
-# .NET Core
-project.lock.json
-project.fragment.lock.json
-artifacts/
-
-# Tye
-.tye/
-
-# ASP.NET Scaffolding
-ScaffoldingReadMe.txt
-
-# StyleCop
-StyleCopReport.xml
-
-# Files built by Visual Studio
-*_i.c
-*_p.c
-*_h.h
-*.ilk
-*.meta
-*.obj
-*.iobj
-*.pch
-*.pdb
-*.ipdb
-*.pgc
-*.pgd
-*.rsp
-*.sbr
-*.tlb
-*.tli
-*.tlh
-*.tmp
-*.tmp_proj
-*_wpftmp.csproj
-*.log
-*.vspscc
-*.vssscc
-.builds
-*.pidb
-*.svclog
-*.scc
-
-# Chutzpah Test files
-_Chutzpah*
-
-# Visual C++ cache files
-ipch/
-*.aps
-*.ncb
-*.opendb
-*.opensdf
-*.sdf
-*.cachefile
-*.VC.db
-*.VC.VC.opendb
-
-# Visual Studio profiler
-*.psess
-*.vsp
-*.vspx
-*.sap
-
-# Visual Studio Trace Files
-*.e2e
-
-# TFS 2012 Local Workspace
-$tf/
-
-# Guidance Automation Toolkit
-*.gpState
-
-# ReSharper is a .NET coding add-in
-_ReSharper*/
-*.[Rr]e[Ss]harper
-*.DotSettings.user
-
-# TeamCity is a build add-in
-_TeamCity*
-
-# DotCover is a Code Coverage Tool
-*.dotCover
-
-# AxoCover is a Code Coverage Tool
-.axoCover/*
-!.axoCover/settings.json
-
-# Coverlet is a free, cross platform Code Coverage Tool
-coverage*.json
-coverage*.xml
-coverage*.info
-
-# Visual Studio code coverage results
-*.coverage
-*.coveragexml
-
-# NCrunch
-_NCrunch_*
-.*crunch*.local.xml
-nCrunchTemp_*
-
-# MightyMoose
-*.mm.*
-AutoTest.Net/
-
-# Web workbench (sass)
-.sass-cache/
-
-# Installshield output folder
-[Ee]xpress/
-
-# DocProject is a documentation generator add-in
-DocProject/buildhelp/
-DocProject/Help/*.HxT
-DocProject/Help/*.HxC
-DocProject/Help/*.hhc
-DocProject/Help/*.hhk
-DocProject/Help/*.hhp
-DocProject/Help/Html2
-DocProject/Help/html
-
-# Click-Once directory
-publish/
-
-# Publish Web Output
-*.[Pp]ublish.xml
-*.azurePubxml
-# Note: Comment the next line if you want to checkin your web deploy settings,
-# but database connection strings (with potential passwords) will be unencrypted
-*.pubxml
-*.publishproj
-
-# Microsoft Azure Web App publish settings. Comment the next line if you want to
-# checkin your Azure Web App publish settings, but sensitive information contained
-# in these scripts will be unencrypted
-PublishScripts/
-
-# NuGet Packages
-*.nupkg
-# NuGet Symbol Packages
-*.snupkg
-# The packages folder can be ignored because of Package Restore
-**/[Pp]ackages/*
-# except build/, which is used as an MSBuild target.
-!**/[Pp]ackages/build/
-# Uncomment if necessary however generally it will be regenerated when needed
-#!**/[Pp]ackages/repositories.config
-# NuGet v3's project.json files produces more ignorable files
-*.nuget.props
-*.nuget.targets
-
-# Microsoft Azure Build Output
-csx/
-*.build.csdef
-
-# Microsoft Azure Emulator
-ecf/
-rcf/
-
-# Windows Store app package directories and files
-AppPackages/
-BundleArtifacts/
-Package.StoreAssociation.xml
-_pkginfo.txt
-*.appx
-*.appxbundle
-*.appxupload
-
-# Visual Studio cache files
-# files ending in .cache can be ignored
-*.[Cc]ache
-# but keep track of directories ending in .cache
-!?*.[Cc]ache/
-
-# Others
-ClientBin/
-~$*
-*~
-*.dbmdl
-*.dbproj.schemaview
-*.jfm
-*.pfx
-*.publishsettings
-orleans.codegen.cs
-
-# Including strong name files can present a security risk
-# (https://github.com/github/gitignore/pull/2483#issue-259490424)
-#*.snk
-
-# Since there are multiple workflows, uncomment next line to ignore bower_components
-# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
-#bower_components/
-
-# RIA/Silverlight projects
-Generated_Code/
-
-# Backup & report files from converting an old project file
-# to a newer Visual Studio version. Backup files are not needed,
-# because we have git ;-)
-_UpgradeReport_Files/
-Backup*/
-UpgradeLog*.XML
-UpgradeLog*.htm
-ServiceFabricBackup/
-*.rptproj.bak
-
-# SQL Server files
-*.mdf
-*.ldf
-*.ndf
-
-# Business Intelligence projects
-*.rdl.data
-*.bim.layout
-*.bim_*.settings
-*.rptproj.rsuser
-*- [Bb]ackup.rdl
-*- [Bb]ackup ([0-9]).rdl
-*- [Bb]ackup ([0-9][0-9]).rdl
-
-# Microsoft Fakes
-FakesAssemblies/
-
-# GhostDoc plugin setting file
-*.GhostDoc.xml
-
-# Node.js Tools for Visual Studio
-.ntvs_analysis.dat
-node_modules/
-
-# Visual Studio 6 build log
-*.plg
-
-# Visual Studio 6 workspace options file
-*.opt
-
-# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
-*.vbw
-
-# Visual Studio LightSwitch build output
-**/*.HTMLClient/GeneratedArtifacts
-**/*.DesktopClient/GeneratedArtifacts
-**/*.DesktopClient/ModelManifest.xml
-**/*.Server/GeneratedArtifacts
-**/*.Server/ModelManifest.xml
-_Pvt_Extensions
-
-# Paket dependency manager
-.paket/paket.exe
-paket-files/
-
-# FAKE - F# Make
-.fake/
-
-# CodeRush personal settings
-.cr/personal
-
-# Python Tools for Visual Studio (PTVS)
-__pycache__/
-*.pyc
-
-# Cake - Uncomment if you are using it
-# tools/**
-# !tools/packages.config
-
-# Tabs Studio
-*.tss
-
-# Telerik's JustMock configuration file
-*.jmconfig
-
-# BizTalk build output
-*.btp.cs
-*.btm.cs
-*.odx.cs
-*.xsd.cs
-
-# OpenCover UI analysis results
-OpenCover/
-
-# Azure Stream Analytics local run output
-ASALocalRun/
-
-# MSBuild Binary and Structured Log
-*.binlog
-
-# NVidia Nsight GPU debugger configuration file
-*.nvuser
-
-# MFractors (Xamarin productivity tool) working folder
-.mfractor/
-
-# Local History for Visual Studio
-.localhistory/
-
-# BeatPulse healthcheck temp database
-healthchecksdb
-
-# Backup folder for Package Reference Convert tool in Visual Studio 2017
-MigrationBackup/
-
-# Ionide (cross platform F# VS Code tools) working folder
-.ionide/
-
-# Fody - auto-generated XML schema
-FodyWeavers.xsd
-
-##
-## Visual studio for Mac
-##
-
-
-# globs
-Makefile.in
-*.userprefs
-*.usertasks
-config.make
-config.status
-aclocal.m4
-install-sh
-autom4te.cache/
-*.tar.gz
-tarballs/
-test-results/
-
-# Mac bundle stuff
-*.dmg
-*.app
-
-# content below from: https://github.com/github/gitignore/blob/master/Global/macOS.gitignore
-# General
-.DS_Store
-.AppleDouble
-.LSOverride
-
-# Icon must end with two \r
-Icon
-
-
-# Thumbnails
-._*
-
-# Files that might appear in the root of a volume
-.DocumentRevisions-V100
-.fseventsd
-.Spotlight-V100
-.TemporaryItems
-.Trashes
-.VolumeIcon.icns
-.com.apple.timemachine.donotpresent
-
-# Directories potentially created on remote AFP share
-.AppleDB
-.AppleDesktop
-Network Trash Folder
-Temporary Items
-.apdisk
-
-# content below from: https://github.com/github/gitignore/blob/master/Global/Windows.gitignore
-# Windows thumbnail cache files
-Thumbs.db
-ehthumbs.db
-ehthumbs_vista.db
-
-# Dump file
-*.stackdump
-
-# Folder config file
-[Dd]esktop.ini
-
-# Recycle Bin used on file shares
-$RECYCLE.BIN/
-
-# Windows Installer files
-*.cab
-*.msi
-*.msix
-*.msm
-*.msp
-
-# Windows shortcuts
-*.lnk
-
-# JetBrains Rider
-.idea/
-*.sln.iml
-
-##
-## Visual Studio Code
-##
-.vscode/*
-!.vscode/settings.json
-!.vscode/tasks.json
-!.vscode/launch.json
-!.vscode/extensions.json
diff --git a/Cpp2IL.Gui/App.axaml b/Cpp2IL.Gui/App.axaml
deleted file mode 100644
index 9132490c..00000000
--- a/Cpp2IL.Gui/App.axaml
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
diff --git a/Cpp2IL.Gui/App.axaml.cs b/Cpp2IL.Gui/App.axaml.cs
deleted file mode 100644
index 1b6230f1..00000000
--- a/Cpp2IL.Gui/App.axaml.cs
+++ /dev/null
@@ -1,36 +0,0 @@
-using Avalonia;
-using Avalonia.Controls.ApplicationLifetimes;
-using Avalonia.Markup.Xaml;
-using Cpp2IL.Core.Logging;
-using Cpp2IL.Gui.ViewModels;
-using Cpp2IL.Gui.Views;
-
-namespace Cpp2IL.Gui
-{
- public class App : Application
- {
- public override void Initialize()
- {
- Logger.InfoNewline("Loading XAML...", "GUI");
- AvaloniaXamlLoader.Load(this);
- Logger.InfoNewline("Loaded XAML.", "GUI");
- }
-
- public override void OnFrameworkInitializationCompleted()
- {
- Logger.InfoNewline("Framework init complete, configuring logging sink and window", "GUI");
- Avalonia.Logging.Logger.Sink = new ConsoleAvaloniaSink();
-
- if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop)
- {
- desktop.MainWindow = new MainWindow
- {
- DataContext = new MainWindowViewModel(),
- };
- ((MainWindow) desktop.MainWindow).OnCreated();
- }
-
- base.OnFrameworkInitializationCompleted();
- }
- }
-}
diff --git a/Cpp2IL.Gui/Assets/avalonia-logo.ico b/Cpp2IL.Gui/Assets/avalonia-logo.ico
deleted file mode 100644
index 8cbdd1ec2795d4aa11c47e715f50ef04e7a1fb29..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001
literal 34473
zcmeHQ2Ygl4{eJ;1wzXBORcl+t(Q37|DmVdyfO~+WXsIYzv8b)90*WJ%sq8?QvQ)wd
zAR{bgBw-|s5Xd4s?`6Hc_ey^M@9!q}@pf*O)&Iu>C+FUC&-ne${H=4IOqL+)CA;uK
z8N%MOvFFHS<7F~g@7^u%>k(grxLa;%egA_@Htp9k*}#D>7vR$!_i^lO-p&zMq#M
z8~zarfaCJ6epV*?cxpo6eOQr9wyG*Yb^~HiG*YyrL(rxpqFxq@<&PexXGBv|)AS~v
zFAZS^{0{gn)YP;Y{%iI=pD)$ray=jxYBrlM@_0PYHu?SAkXDPbeDF>1%`v>c$=|e{
z^PA+R3%y?NYsgoOw21eUu~A3zymG2KQcS8db!1X#Np-B6RL5(`Ww0Ze;EF3MDtfsc
z?qSGVfS6{7*+xgw_R{jvGic5O6DVcyd$fG$6x#gaLfZE90@^)t88zlq3Yn3o&}npD
z)#Phhg9yLd?xb%QY^JIG-=N8TU!yq#$J646KBh$jCeq4#lWF7N8MJNKe5yZKF60Mx
z1unbmL6lPg-&~nfOtT-JKvVj@PHSIXKt&nHNO82BPOR8Ro1UK6l7A@jXO)Td7kgc<
zv1kWlMQ#!8oV|{gkNlJtKKe0L9xS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$
zLL?IsBy!l|__9Q#KpOtvo1cDkKeoV+E%0Lt{MZ6Nw!r_l7D!;emFeiEOP8LzYyPfY
zIq5k+%}mcc|LCrxzbrg-=%Vt>yi1CX7F||$IRA>G?4sWnd~@vTlY4TmE8Tbcj|B$`
zt}i=WaDBmn6W5=~KJ|x^%#+tu94fq~EW6<9(%jPCrMahi*W{nMiv5`*-R<*H2mJp0
zt4?L+_GUN>_no*VZ`YA)3$l-0U2-_@O2(n!n 0)
- sb.AppendLine();
-
- //Constructors
- foreach (var method in type.Methods)
- {
- if (method.Definition!.Name is not ".ctor" and not ".cctor")
- continue;
-
- if (method.Definition.MethodPointer > 0)
- sb.Append('\t').Append("// Method at address 0x").Append(method.Definition.MethodPointer.ToString("X")).AppendLine();
-
- sb.Append(CsFileUtils.GetCustomAttributeStrings(method, 1));
- sb.Append('\t').Append(CsFileUtils.GetKeyWordsForMethod(method)).Append(' ').Append(type.Definition.Name).Append('(');
- sb.Append(CsFileUtils.GetMethodParameterString(method));
- sb.Append(')');
-
- sb.Append(GetMethodBodyIfPresent(method, methodBodyMode));
- }
-
- //Properties
- foreach (var prop in type.Properties)
- {
- prop.AnalyzeCustomAttributeData();
-
- //TODO
- // sb.Append(GetCustomAttributeStrings(prop, 1));
- //
- // sb.Append('\t').Append(GetKeyWordsForProperty(prop));
- // sb.Append(GetTypeName(prop.Definition.PropertyType!.ToString())).Append(' ');
- // sb.Append(prop.Definition.Name!);
- //
- // sb.Append(' ').Append(GetMethodParameterString(prop));
- //
- // sb.Append(GetMethodBodyIfPresent(prop, methodBodyMode));
- }
-
- //Methods
- foreach (var method in type.Methods)
- {
- if (method.Definition!.Name is ".ctor" or ".cctor")
- continue;
-
- if (method.Definition.MethodPointer > 0)
- sb.Append('\t').Append("// Method at address 0x").Append(method.Definition.MethodPointer.ToString("X")).AppendLine();
-
- sb.Append(CsFileUtils.GetCustomAttributeStrings(method, 1));
- sb.Append('\t').Append(CsFileUtils.GetKeyWordsForMethod(method));
- sb.Append(' ');
- sb.Append(CsFileUtils.GetTypeName(method.Definition.ReturnType!.ToString())).Append(' ');
- sb.Append(method.Definition!.Name).Append('(');
- sb.Append(CsFileUtils.GetMethodParameterString(method));
- sb.Append(')');
-
- sb.Append(GetMethodBodyIfPresent(method, methodBodyMode));
- }
-
- //Attribute generators, if enabled and available
- if (includeAttributeGenerators && type.AppContext.MetadataVersion < 29f)
- {
- var membersWithGenerators = type.Methods.Cast().Concat(type.Fields).Concat(type.Properties).Append(type).ToList();
-
- foreach (var memberWithGenerator in membersWithGenerators)
- {
- if (memberWithGenerator.RawIl2CppCustomAttributeData.Length == 0)
- continue;
-
- sb.Append("\t// Custom attribute generator at address 0x").Append(memberWithGenerator.CaCacheGeneratorAnalysis!.UnderlyingPointer.ToString("X")).AppendLine();
- sb.AppendLine("\t// Expected custom attribute types (parameter+ptr contains an array of these): ");
-
- foreach (var il2CppType in memberWithGenerator.AttributeTypes!)
- {
- sb.Append("\t//\t");
-
- if (il2CppType.Type is Il2CppTypeEnum.IL2CPP_TYPE_CLASS or Il2CppTypeEnum.IL2CPP_TYPE_VALUETYPE)
- sb.Append(CsFileUtils.GetTypeName(il2CppType.AsClass().FullName!));
- else
- sb.Append(CsFileUtils.GetTypeName(LibCpp2ILUtils.GetTypeReflectionData(il2CppType).ToString()));
-
- sb.AppendLine();
- }
-
- sb.Append("\tpublic static void GenerateCustomAttributesFor_");
- sb.Append(memberWithGenerator switch
- {
- MethodAnalysisContext => "Method",
- FieldAnalysisContext => "Field",
- PropertyAnalysisContext => "Property",
- TypeAnalysisContext => "Type",
- _ => throw new ArgumentOutOfRangeException()
- });
- sb.Append('_').Append(memberWithGenerator.CustomAttributeOwnerName).Append("(Il2CppCustomAttributeCache customAttributes)");
-
- sb.Append(GetMethodBodyIfPresent(memberWithGenerator.CaCacheGeneratorAnalysis, methodBodyMode));
- }
- }
- }
-
- sb.AppendLine("}"); //Close class
-
- return sb.ToString();
- }
-
- private static string GetMethodBodyIfPresent(MethodAnalysisContext method, MethodBodyMode mode)
- {
- var sb = new StringBuilder();
-
- if (method.Definition?.Attributes.HasFlag(MethodAttributes.Abstract) ?? false)
- return ";\n\n";
-
- sb.AppendLine();
- sb.AppendLine("\t{");
-
- if (mode != MethodBodyMode.Stubs)
- {
- try
- {
- if (mode != MethodBodyMode.RawAsm)
- method.Analyze();
-
- switch (mode)
- {
- case MethodBodyMode.Isil:
- {
- sb.AppendLine("\t\t// Method body (Instruction-Set-Independent Machine Code Representation)");
-
- if (method.ConvertedIsil == null)
- {
- sb.AppendLine();
- sb.AppendLine($"\t\t// ERROR: No ISIL was generated, which probably means the {method.AppContext.InstructionSet.GetType().Name}\n\t\t// is not fully implemented and so does not generate control flow graphs.");
- }
- else
- sb.Append(GetMethodBodyISIL(method.ConvertedIsil));
-
- break;
- }
- case MethodBodyMode.RawAsm:
- {
- var rawBytes = method.AppContext.InstructionSet.GetRawBytesForMethod(method, false);
-
- sb.AppendLine($"\t\t// Method body (Raw Machine Code, {rawBytes.Length} bytes)").AppendLine();
-
- sb.Append("\t\t// ");
- sb.Append(method.AppContext.InstructionSet.PrintAssembly(method).Replace("\n", "\n\t\t// ")).AppendLine();
-
- break;
- }
- case MethodBodyMode.Pseudocode:
- {
- sb.AppendLine("\t\t// Method body (Generated C#-Like Decompilation)").AppendLine();
-
- sb.AppendLine("\t\t// TODO: Implement C#-like decompilation");
-
- break;
- }
- }
- }
- catch (Exception e)
- {
- sb.AppendLine("\t\t// Error Analysing method: " + e.ToString().Replace("\n", "\n\t\t//"));
- }
- }
-
- sb.AppendLine("\t}\n");
-
- return sb.ToString();
- }
-
- // ReSharper disable once InconsistentNaming
- private static string GetMethodBodyISIL(List method)
- {
- var sb = new StringBuilder();
-
- foreach (var instruction in method)
- {
- // foreach (var nodeStatement in node.Statements)
- // {
- // if (nodeStatement is IsilIfStatement ifStatement)
- // {
- // sb.AppendLine().Append('\t', 2).Append(ifStatement.Condition).AppendLine(";\n");
- //
- // sb.Append('\t', 2).AppendLine("// True branch");
- // var tempBlock = new InstructionSetIndependentNode() {Statements = ifStatement.IfBlock};
- // sb.Append(GetMethodBodyISIL(new() {tempBlock}));
- //
- // if ((ifStatement.ElseBlock?.Count ?? 0) > 0)
- // {
- // sb.Append('\n').Append('\t', 2).AppendLine("// False branch");
- // tempBlock = new() {Statements = ifStatement.ElseBlock!};
- // sb.Append(GetMethodBodyISIL(new() {tempBlock}));
- // }
- //
- // sb.Append('\t', 2).AppendLine("// End of if\n");
- // }
- // else
- sb.Append('\t', 2).Append("//").Append(instruction).AppendLine(";");
- // }
- }
-
- return sb.ToString();
- }
-}
diff --git a/Cpp2IL.Gui/ConsoleAvaloniaSink.cs b/Cpp2IL.Gui/ConsoleAvaloniaSink.cs
deleted file mode 100644
index 704c4d95..00000000
--- a/Cpp2IL.Gui/ConsoleAvaloniaSink.cs
+++ /dev/null
@@ -1,161 +0,0 @@
-using System;
-using System.Text;
-using Avalonia.Logging;
-using Avalonia.Utilities;
-
-namespace Cpp2IL.Gui
-{
- public class ConsoleAvaloniaSink : ILogSink
- {
- public bool IsEnabled(LogEventLevel level, string area) => level switch
- {
- LogEventLevel.Information => area is not "Layout",
- LogEventLevel.Warning => true,
- LogEventLevel.Error => true,
- LogEventLevel.Fatal => true,
- _ => false,
- };
-
- public void Log(LogEventLevel level, string area, object? source, string messageTemplate)
- {
- if (IsEnabled(level, area))
- Console.WriteLine(Format