Skip to content

Commit a11dd4d

Browse files
author
RandomCrocodile
committed
feature: add Input Symbol Map field to GUI advanced settings (#26)
Completes the #26 GUI follow-up. The project's Advanced Settings dialog now has an 'Input Symbol Map' field (text box with file drag-drop + a browse button) bound to ProjectVM.InputSymbolMap, so users can select a previous symbols.map from the GUI for consistent re-obfuscation. Round-trips through the existing project save/load.
1 parent b4ce2fd commit a11dd4d

3 files changed

Lines changed: 37 additions & 6 deletions

File tree

ConfuserEx/ViewModel/Project/ProjectVM.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,11 @@ public bool Debug {
5757
set { SetProperty(proj.Debug != value, val => proj.Debug = val, value, "Debug"); }
5858
}
5959

60+
public string InputSymbolMap {
61+
get { return proj.InputSymbolMap; }
62+
set { SetProperty(proj.InputSymbolMap != value, val => proj.InputSymbolMap = val, value, "InputSymbolMap"); }
63+
}
64+
6065
public string BaseDirectory {
6166
get { return proj.BaseDirectory; }
6267
set { SetProperty(proj.BaseDirectory != value, val => proj.BaseDirectory = val, value, "BaseDirectory"); }

ConfuserEx/Views/ProjectTabAdvancedView.xaml

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,34 @@
1212
<ColumnDefinition Width="36px" />
1313
</Grid.ColumnDefinitions>
1414
<Grid.RowDefinitions>
15+
<RowDefinition Height="36px" />
1516
<RowDefinition Height="36px" />
1617
<RowDefinition Height="*" />
1718
</Grid.RowDefinitions>
1819

19-
<Label Grid.Row="0" Grid.Column="0" Content="Probe Paths :" Margin="5" VerticalAlignment="Center" />
20-
<ListBox Grid.Row="1" Grid.Column="0" Margin="5" x:Name="ProbePaths" ItemsSource="{Binding ProbePaths}"
20+
<Grid Grid.Row="0" Grid.ColumnSpan="4">
21+
<Grid.ColumnDefinitions>
22+
<ColumnDefinition Width="120px" />
23+
<ColumnDefinition Width="*" />
24+
<ColumnDefinition Width="36px" />
25+
</Grid.ColumnDefinitions>
26+
<Label Grid.Column="0" Content="Input Symbol Map :" Margin="5" HorizontalContentAlignment="Right"
27+
VerticalContentAlignment="Center" />
28+
<TextBox Grid.Column="1" Margin="5" VerticalContentAlignment="Center"
29+
Text="{Binding InputSymbolMap, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
30+
local:Skin.EmptyPrompt="Reuse a previous symbols.map for consistent re-obfuscation"
31+
local:FileDragDrop.Command="{x:Static local:FileDragDrop.FileCmd}" />
32+
<Button Grid.Column="2" Margin="5" VerticalAlignment="Center" Height="26" x:Name="ChooseSymbolMap">
33+
<TextBlock FontSize="14px" FontFamily="{DynamicResource FontAwesome}" Text="&#xf141;" Height="10px"
34+
TextOptions.TextRenderingMode="GrayScale" />
35+
</Button>
36+
</Grid>
37+
38+
<Label Grid.Row="1" Grid.Column="0" Content="Probe Paths :" Margin="5" VerticalAlignment="Center" />
39+
<ListBox Grid.Row="2" Grid.Column="0" Margin="5" x:Name="ProbePaths" ItemsSource="{Binding ProbePaths}"
2140
local:FileDragDrop.Command="{x:Static local:FileDragDrop.DirectoryCmd}"
2241
ScrollViewer.CanContentScroll="False" />
23-
<StackPanel Grid.Row="1" Grid.Column="1">
42+
<StackPanel Grid.Row="2" Grid.Column="1">
2443
<Button Height="26" Margin="5" DockPanel.Dock="Top" x:Name="AddProbe">
2544
<TextBlock FontSize="14px" FontFamily="{DynamicResource FontAwesome}" Text="&#xf067;" Height="12px"
2645
TextOptions.TextRenderingMode="GrayScale" />
@@ -31,11 +50,11 @@
3150
</Button>
3251
</StackPanel>
3352

34-
<Label Grid.Row="0" Grid.Column="2" Content="Plugins :" Margin="5" VerticalAlignment="Center" />
35-
<ListBox Grid.Row="1" Grid.Column="2" Margin="5" x:Name="PluginPaths" ItemsSource="{Binding Plugins}"
53+
<Label Grid.Row="1" Grid.Column="2" Content="Plugins :" Margin="5" VerticalAlignment="Center" />
54+
<ListBox Grid.Row="2" Grid.Column="2" Margin="5" x:Name="PluginPaths" ItemsSource="{Binding Plugins}"
3655
local:FileDragDrop.Command="{x:Static local:FileDragDrop.FileCmd}"
3756
ScrollViewer.CanContentScroll="False" />
38-
<StackPanel Grid.Row="1" Grid.Column="3">
57+
<StackPanel Grid.Row="2" Grid.Column="3">
3958
<Button Height="26" Margin="5" DockPanel.Dock="Top" x:Name="AddPlugin">
4059
<TextBlock FontSize="14px" FontFamily="{DynamicResource FontAwesome}" Text="&#xf067;" Height="12px"
4160
TextOptions.TextRenderingMode="GrayScale" />

ConfuserEx/Views/ProjectTabAdvancedView.xaml.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,13 @@ public ProjectTabAdvancedView(ProjectVM project) {
1818
public override void OnApplyTemplate() {
1919
base.OnApplyTemplate();
2020

21+
ChooseSymbolMap.Command = new RelayCommand(() => {
22+
var ofd = new VistaOpenFileDialog();
23+
ofd.Filter = "Symbol map (*.map)|*.map|All Files (*.*)|*.*";
24+
if (ofd.ShowDialog() ?? false)
25+
project.InputSymbolMap = ofd.FileName;
26+
});
27+
2128
AddPlugin.Command = new RelayCommand(() => {
2229
var ofd = new VistaOpenFileDialog();
2330
ofd.Filter = ".NET assemblies (*.exe, *.dll)|*.exe;*.dll|All Files (*.*)|*.*";

0 commit comments

Comments
 (0)