Change references to IDA to generic 'Python script'

This commit is contained in:
Katy Coe
2020-08-06 05:29:41 +02:00
parent 567bbd2706
commit a81b2707c9
3 changed files with 22 additions and 22 deletions

View File

@@ -29,7 +29,7 @@ namespace Il2CppInspector.CLI
[Option('c', "cs-out", Required = false, HelpText = "C# output file (when using single-file layout) or path (when using per namespace, assembly or class layout)", Default = "types.cs")]
public string CSharpOutPath { get; set; }
[Option('p', "py-out", Required = false, HelpText = "IDA Python script output file", Default = "ida.py")]
[Option('p', "py-out", Required = false, HelpText = "Python script output file", Default = "il2cpp.py")]
public string PythonOutFile { get; set; }
[Option('h', "cpp-out", Required = false, HelpText = "C++ scaffolding / DLL injection project output path", Default = "cpp")]
@@ -84,7 +84,7 @@ namespace Il2CppInspector.CLI
[Option("unity-assemblies", Required = false, HelpText = "Path to Unity script assemblies (when using --project). Wildcards select last matching folder in alphanumeric order", Default = @"C:\Program Files\Unity\Hub\Editor\*\Editor\Data\Resources\PackageManager\ProjectTemplates\libcache\com.unity.template.3d-*\ScriptAssemblies")]
public string UnityAssembliesPath { get; set; }
[Option("unity-version", Required = false, HelpText = "Version of Unity used to create the input files, if known. Used to enhance IDAPython and C++ output. If not specified, a close match will be inferred automatically.", Default = null)]
[Option("unity-version", Required = false, HelpText = "Version of Unity used to create the input files, if known. Used to enhance Python, C++ and JSON output. If not specified, a close match will be inferred automatically.", Default = null)]
public UnityVersion UnityVersion { get; set; }
}
@@ -269,8 +269,8 @@ namespace Il2CppInspector.CLI
new JSONMetadata(appModel).Write(options.JsonOutPath);
}
// IDA Python script output
using (new Benchmark("Generate IDAPython script")) {
// Python script output
using (new Benchmark("Generate Python script")) {
new PythonScript(appModel).WriteScriptToFile(options.PythonOutFile, "IDA",
Path.Combine(options.CppOutPath, "appdata/il2cpp-types.h"),
options.JsonOutPath);

View File

@@ -363,10 +363,10 @@
<Separator Margin="5,15,5,15"/>
<!-- IDAPython script -->
<RadioButton GroupName="grpOutputType" Name="rdoOutputIDA" VerticalContentAlignment="Center" FontSize="18" Foreground="{StaticResource MicrosoftGreen}">IDAPython script</RadioButton>
<!-- Python script -->
<RadioButton GroupName="grpOutputType" Name="rdoOutputPy" VerticalContentAlignment="Center" FontSize="18" Foreground="{StaticResource MicrosoftGreen}">Python script for disassemblers</RadioButton>
<DockPanel>
<ComboBox Name="cboIdaUnityVersion" DockPanel.Dock="Right" Margin="4"></ComboBox>
<ComboBox Name="cboPyUnityVersion" DockPanel.Dock="Right" Margin="4"></ComboBox>
<Label DockPanel.Dock="Left" Width="170" VerticalAlignment="Center" HorizontalAlignment="Left">Unity version (if known):</Label>
</DockPanel>

View File

@@ -215,22 +215,22 @@ namespace Il2CppInspectorGUI
trvNamespaces.ItemsSource = namespaceTree;
// Populate Unity version combo boxes
var prevIdaSelection = cboIdaUnityVersion.SelectedItem;
var prevIdaSelection = cboPyUnityVersion.SelectedItem;
var prevCppSelection = cboCppUnityVersion.SelectedItem;
var prevJsonSelection = cboJsonUnityVersion.SelectedItem;
cboIdaUnityVersion.Items.Clear();
cboPyUnityVersion.Items.Clear();
cboCppUnityVersion.Items.Clear();
cboJsonUnityVersion.Items.Clear();
foreach (var version in UnityHeaders.GuessHeadersForBinary(model.Package.Binary)) {
cboIdaUnityVersion.Items.Add(version);
cboPyUnityVersion.Items.Add(version);
cboCppUnityVersion.Items.Add(version);
cboJsonUnityVersion.Items.Add(version);
}
cboIdaUnityVersion.SelectedIndex = cboIdaUnityVersion.Items.Count - 1;
cboPyUnityVersion.SelectedIndex = cboPyUnityVersion.Items.Count - 1;
cboCppUnityVersion.SelectedIndex = cboCppUnityVersion.Items.Count - 1;
cboJsonUnityVersion.SelectedIndex = cboJsonUnityVersion.Items.Count - 1;
if (prevIdaSelection != null) {
cboIdaUnityVersion.SelectedItem = prevIdaSelection;
cboPyUnityVersion.SelectedItem = prevIdaSelection;
cboCppUnityVersion.SelectedItem = prevCppSelection;
cboJsonUnityVersion.SelectedItem = prevJsonSelection;
}
@@ -409,29 +409,29 @@ namespace Il2CppInspectorGUI
});
break;
// IDA Python script
case { rdoOutputIDA: var r } when r.IsChecked == true:
// Python script
case { rdoOutputPy: var r } when r.IsChecked == true:
var idaSaveFileDialog = new SaveFileDialog {
var pySaveFileDialog = new SaveFileDialog {
Filter = "Python scripts (*.py)|*.py|All files (*.*)|*.*",
FileName = "ida.py",
FileName = "il2cpp.py",
CheckFileExists = false,
OverwritePrompt = true
};
if (idaSaveFileDialog.ShowDialog() == false)
if (pySaveFileDialog.ShowDialog() == false)
return;
var idaOutFile = idaSaveFileDialog.FileName;
var pyOutFile = pySaveFileDialog.FileName;
areaBusyIndicator.Visibility = Visibility.Visible;
var selectedIdaUnityVersion = ((UnityHeaders) cboIdaUnityVersion.SelectedItem)?.VersionRange.Min;
var selectedPyUnityVersion = ((UnityHeaders) cboPyUnityVersion.SelectedItem)?.VersionRange.Min;
await Task.Run(() => {
OnStatusUpdate(this, "Building C++ application model");
model.Build(selectedIdaUnityVersion, CppCompilerType.GCC);
model.Build(selectedPyUnityVersion, CppCompilerType.GCC);
OnStatusUpdate(this, "Generating IDAPython script");
new PythonScript(model).WriteScriptToFile(idaOutFile, "IDA");
OnStatusUpdate(this, "Generating Python script");
new PythonScript(model).WriteScriptToFile(pyOutFile, "IDA");
});
break;