From a4f5b5ac5ccedccf1dac36b30e0161d4a4911e0f Mon Sep 17 00:00:00 2001 From: Katy Coe Date: Mon, 24 Feb 2020 10:06:18 +0100 Subject: [PATCH] GUI: Add "Not a decompiler" dialog on startup --- .../Il2CppInspector.GUI.csproj | 17 +++++++++ Il2CppInspector.GUI/MainWindow.xaml | 3 +- Il2CppInspector.GUI/MainWindow.xaml.cs | 22 +++++++++++ Il2CppInspector.GUI/User.Designer.cs | 38 +++++++++++++++++++ Il2CppInspector.GUI/User.settings | 9 +++++ Il2CppInspector.GUI/app.manifest | 23 +++++++++++ 6 files changed, 111 insertions(+), 1 deletion(-) create mode 100644 Il2CppInspector.GUI/User.Designer.cs create mode 100644 Il2CppInspector.GUI/User.settings create mode 100644 Il2CppInspector.GUI/app.manifest diff --git a/Il2CppInspector.GUI/Il2CppInspector.GUI.csproj b/Il2CppInspector.GUI/Il2CppInspector.GUI.csproj index a7d219b..75e53de 100644 --- a/Il2CppInspector.GUI/Il2CppInspector.GUI.csproj +++ b/Il2CppInspector.GUI/Il2CppInspector.GUI.csproj @@ -12,6 +12,7 @@ Katy Coe Noisy Cow Studios Il2CppInspector Windows Edition + app.manifest @@ -25,6 +26,7 @@ + NU1701 @@ -38,4 +40,19 @@ + + + True + True + User.settings + + + + + + SettingsSingleFileGenerator + User.Designer.cs + + + \ No newline at end of file diff --git a/Il2CppInspector.GUI/MainWindow.xaml b/Il2CppInspector.GUI/MainWindow.xaml index bfde9a2..3db21e8 100644 --- a/Il2CppInspector.GUI/MainWindow.xaml +++ b/Il2CppInspector.GUI/MainWindow.xaml @@ -7,7 +7,8 @@ xmlns:gif="https://github.com/XamlAnimatedGif/XamlAnimatedGif" mc:Ignorable="d" Title="Il2CppInspector" Height="630" Width="990" Background="White" - WindowStartupLocation="CenterScreen"> + WindowStartupLocation="CenterScreen" + ContentRendered="MainWindow_OnContentRendered"> diff --git a/Il2CppInspector.GUI/MainWindow.xaml.cs b/Il2CppInspector.GUI/MainWindow.xaml.cs index d7018bc..ad4e5cc 100644 --- a/Il2CppInspector.GUI/MainWindow.xaml.cs +++ b/Il2CppInspector.GUI/MainWindow.xaml.cs @@ -23,6 +23,7 @@ using System.Windows.Navigation; using System.Windows.Shapes; using Microsoft.Win32; using Il2CppInspector; +using Il2CppInspector.GUI; using Il2CppInspector.Outputs; using Il2CppInspector.Reflection; using Ookii.Dialogs.Wpf; @@ -380,6 +381,27 @@ namespace Il2CppInspectorGUI } return ns; } + + /// + /// Display startup information dialog + /// + private void MainWindow_OnContentRendered(object sender, EventArgs e) { + if (User.Default.ShowDecompilerWarning) { + var taskDialog = new TaskDialog { + WindowTitle = "Information", + MainInstruction = "Welcome to Il2CppInspector", + Content = "NOTE: Il2CppInspector is not a decompiler. It can provide you with the structure of an application and function addresses for every method so that you can easily jump straight to methods of interest in your disassembler. It does not attempt to recover the entire source code of the application.", + VerificationText = "Don't show this message again" + }; + taskDialog.Buttons.Add(new TaskDialogButton(ButtonType.Close)); + taskDialog.ShowDialog(this); + + if (taskDialog.IsVerificationChecked) { + User.Default.ShowDecompilerWarning = false; + User.Default.Save(); + } + } + } } // Replacement for TreeViewItem that includes checkbox state diff --git a/Il2CppInspector.GUI/User.Designer.cs b/Il2CppInspector.GUI/User.Designer.cs new file mode 100644 index 0000000..94003e9 --- /dev/null +++ b/Il2CppInspector.GUI/User.Designer.cs @@ -0,0 +1,38 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Il2CppInspector.GUI { + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.4.0.0")] + internal sealed partial class User : global::System.Configuration.ApplicationSettingsBase { + + private static User defaultInstance = ((User)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new User()))); + + public static User Default { + get { + return defaultInstance; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("True")] + public bool ShowDecompilerWarning { + get { + return ((bool)(this["ShowDecompilerWarning"])); + } + set { + this["ShowDecompilerWarning"] = value; + } + } + } +} diff --git a/Il2CppInspector.GUI/User.settings b/Il2CppInspector.GUI/User.settings new file mode 100644 index 0000000..1475bc4 --- /dev/null +++ b/Il2CppInspector.GUI/User.settings @@ -0,0 +1,9 @@ + + + + + + True + + + \ No newline at end of file diff --git a/Il2CppInspector.GUI/app.manifest b/Il2CppInspector.GUI/app.manifest new file mode 100644 index 0000000..d88c99c --- /dev/null +++ b/Il2CppInspector.GUI/app.manifest @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + +