GUI: Busy indicator lightbox dialog

This commit is contained in:
Katy Coe
2020-02-07 23:38:02 +01:00
parent 8a574664f0
commit 194707f3f5
5 changed files with 42 additions and 2 deletions

View File

@@ -11,8 +11,26 @@
<Product>Il2CppInspector Windows Edition</Product>
</PropertyGroup>
<ItemGroup>
<None Remove="Resources\baby-spinner.gif" />
<None Remove="Resources\chemical-loading-spinner.gif" />
<None Remove="Resources\childs-drawing.gif" />
<None Remove="Resources\ConventionalOblongFairybluebird-small.gif" />
<None Remove="Resources\green-google-material-spinner.gif" />
<None Remove="Resources\pizza.gif" />
<None Remove="Resources\preview.gif" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="XamlAnimatedGif" Version="1.2.2" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Il2CppInspector.Common\Il2CppInspector.csproj" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\pizza.gif" />
</ItemGroup>
</Project>

View File

@@ -3,10 +3,14 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:Il2CppInspectorGUI"
xmlns:gif="https://github.com/XamlAnimatedGif/XamlAnimatedGif"
mc:Ignorable="d"
Title="Il2CppInspector" Height="450" Width="800" Background="White">
<Window.Resources>
<!-- Our favourite colours -->
<SolidColorBrush x:Key="MicrosoftBlue" Color="#00A2ED"/>
<SolidColorBrush x:Key="WindowsBlue" Color="#357EC7"/>
<!-- Light box button -->
<Style x:Key="FocusVisual">
<Setter Property="Control.Template">
@@ -30,7 +34,7 @@
<Setter Property="FocusVisualStyle" Value="{StaticResource FocusVisual}"/>
<Setter Property="Background" Value="{StaticResource Button.Static.Background}"/>
<Setter Property="BorderBrush" Value="{StaticResource Button.Static.Border}"/>
<Setter Property="Foreground" Value="#00A2ED"/>
<Setter Property="Foreground" Value="{StaticResource MicrosoftBlue}"/>
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="HorizontalContentAlignment" Value="Center"/>
<Setter Property="VerticalContentAlignment" Value="Center"/>
@@ -93,5 +97,13 @@
<Button Name="btnSelectMetadataFile" Style="{StaticResource LightBoxButton}" Margin="100" Click="BtnSelectMetadataFile_OnClick">Select an IL2CPP metadata file</Button>
<Button Name="btnSelectBinaryFile" Style="{StaticResource LightBoxButton}" Margin="100" Click="BtnSelectBinaryFile_OnClick" Visibility="Hidden">Select an IL2CPP binary file</Button>
<Button Name="btnBack" VerticalAlignment="Bottom" DockPanel.Dock="Bottom" Style="{StaticResource LightBoxButton}" Margin="20,0,630,20" FontSize="18" Click="BtnBack_OnClick" Visibility="Hidden">&lt;&lt; Back</Button>
<!-- Busy indicator -->
<Border Name="areaBusyIndicator" BorderThickness="1" CornerRadius="2" BorderBrush="Gray" HorizontalAlignment="Center" VerticalAlignment="Center" Background="#F8F8F8" SnapsToDevicePixels="True" Visibility="Hidden">
<StackPanel Margin="60,40,60,40">
<TextBlock Foreground="{StaticResource WindowsBlue}" FontSize="24">Getting things ready...</TextBlock>
<Image gif:AnimationBehavior.SourceUri="Resources/pizza.gif" Width="100" Margin="0,20,0,0" RenderOptions.BitmapScalingMode="Fant" />
</StackPanel>
</Border>
</Grid>
</Window>

View File

@@ -42,13 +42,17 @@ namespace Il2CppInspectorGUI
btnSelectMetadataFile.Visibility = Visibility.Hidden;
if (openFileDialog.ShowDialog() == true) {
areaBusyIndicator.Visibility = Visibility.Visible;
// Load the metadata file
if (await app.LoadMetadataAsync(openFileDialog.FileName)) {
// Metadata loaded successfully
btnSelectBinaryFile.Visibility = Visibility.Visible;
btnBack.Visibility = Visibility.Visible;
areaBusyIndicator.Visibility = Visibility.Hidden;
}
else {
areaBusyIndicator.Visibility = Visibility.Hidden;
MessageBox.Show(this, app.LastException.Message, "Error", MessageBoxButton.OK, MessageBoxImage.Error);
btnSelectMetadataFile.Visibility = Visibility.Visible;
}
@@ -73,14 +77,18 @@ namespace Il2CppInspectorGUI
btnBack.IsEnabled = false;
if (openFileDialog.ShowDialog() == true) {
areaBusyIndicator.Visibility = Visibility.Visible;
// Load the binary file
if (await app.LoadBinaryAsync(openFileDialog.FileName)) {
// Binary loaded successfully
// TODO: Set DataContext
// TODO: Format, Endianness, Bits, Arch, GlobalOffset, symbol table size, relocations size, CodeReg, MetaReg
areaBusyIndicator.Visibility = Visibility.Hidden;
rectModalLightBoxBackground.Visibility = Visibility.Hidden;
}
else {
areaBusyIndicator.Visibility = Visibility.Hidden;
MessageBox.Show(this, app.LastException.Message, "Error", MessageBoxButton.OK, MessageBoxImage.Error);
btnSelectBinaryFile.Visibility = Visibility.Visible;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 647 KiB

View File

@@ -185,6 +185,8 @@ The following books were also very helpful:
- [The IDA Pro Book, 2nd Edition](https://www.amazon.com/IDA-Pro-Book-Unofficial-Disassembler/dp/1593272898/ref=sr_1_1?keywords=ida+pro+book&qid=1580952729&sr=8-1) by Chris Eagle
- [The Beginner's Guide to IDAPython](https://leanpub.com/IDAPython-Book) by Alexander Hanel
Pizza spinner animation in the GUI made by Chris Gannon - https://gannon.tv/
### License
All rights reserved. Unauthorized use, re-use or the creation of derivative works of this code for commercial purposes whether directly or indirectly is strictly prohibited. Use, re-use or the creation of derivative works for non-commercial purposes is expressly permitted.