Change references to IDA to generic 'Python script'
This commit is contained in:
@@ -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")]
|
[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; }
|
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; }
|
public string PythonOutFile { get; set; }
|
||||||
|
|
||||||
[Option('h', "cpp-out", Required = false, HelpText = "C++ scaffolding / DLL injection project output path", Default = "cpp")]
|
[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")]
|
[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; }
|
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; }
|
public UnityVersion UnityVersion { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -269,8 +269,8 @@ namespace Il2CppInspector.CLI
|
|||||||
new JSONMetadata(appModel).Write(options.JsonOutPath);
|
new JSONMetadata(appModel).Write(options.JsonOutPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
// IDA Python script output
|
// Python script output
|
||||||
using (new Benchmark("Generate IDAPython script")) {
|
using (new Benchmark("Generate Python script")) {
|
||||||
new PythonScript(appModel).WriteScriptToFile(options.PythonOutFile, "IDA",
|
new PythonScript(appModel).WriteScriptToFile(options.PythonOutFile, "IDA",
|
||||||
Path.Combine(options.CppOutPath, "appdata/il2cpp-types.h"),
|
Path.Combine(options.CppOutPath, "appdata/il2cpp-types.h"),
|
||||||
options.JsonOutPath);
|
options.JsonOutPath);
|
||||||
|
|||||||
@@ -363,10 +363,10 @@
|
|||||||
|
|
||||||
<Separator Margin="5,15,5,15"/>
|
<Separator Margin="5,15,5,15"/>
|
||||||
|
|
||||||
<!-- IDAPython script -->
|
<!-- Python script -->
|
||||||
<RadioButton GroupName="grpOutputType" Name="rdoOutputIDA" VerticalContentAlignment="Center" FontSize="18" Foreground="{StaticResource MicrosoftGreen}">IDAPython script</RadioButton>
|
<RadioButton GroupName="grpOutputType" Name="rdoOutputPy" VerticalContentAlignment="Center" FontSize="18" Foreground="{StaticResource MicrosoftGreen}">Python script for disassemblers</RadioButton>
|
||||||
<DockPanel>
|
<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>
|
<Label DockPanel.Dock="Left" Width="170" VerticalAlignment="Center" HorizontalAlignment="Left">Unity version (if known):</Label>
|
||||||
</DockPanel>
|
</DockPanel>
|
||||||
|
|
||||||
|
|||||||
@@ -215,22 +215,22 @@ namespace Il2CppInspectorGUI
|
|||||||
trvNamespaces.ItemsSource = namespaceTree;
|
trvNamespaces.ItemsSource = namespaceTree;
|
||||||
|
|
||||||
// Populate Unity version combo boxes
|
// Populate Unity version combo boxes
|
||||||
var prevIdaSelection = cboIdaUnityVersion.SelectedItem;
|
var prevIdaSelection = cboPyUnityVersion.SelectedItem;
|
||||||
var prevCppSelection = cboCppUnityVersion.SelectedItem;
|
var prevCppSelection = cboCppUnityVersion.SelectedItem;
|
||||||
var prevJsonSelection = cboJsonUnityVersion.SelectedItem;
|
var prevJsonSelection = cboJsonUnityVersion.SelectedItem;
|
||||||
cboIdaUnityVersion.Items.Clear();
|
cboPyUnityVersion.Items.Clear();
|
||||||
cboCppUnityVersion.Items.Clear();
|
cboCppUnityVersion.Items.Clear();
|
||||||
cboJsonUnityVersion.Items.Clear();
|
cboJsonUnityVersion.Items.Clear();
|
||||||
foreach (var version in UnityHeaders.GuessHeadersForBinary(model.Package.Binary)) {
|
foreach (var version in UnityHeaders.GuessHeadersForBinary(model.Package.Binary)) {
|
||||||
cboIdaUnityVersion.Items.Add(version);
|
cboPyUnityVersion.Items.Add(version);
|
||||||
cboCppUnityVersion.Items.Add(version);
|
cboCppUnityVersion.Items.Add(version);
|
||||||
cboJsonUnityVersion.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;
|
cboCppUnityVersion.SelectedIndex = cboCppUnityVersion.Items.Count - 1;
|
||||||
cboJsonUnityVersion.SelectedIndex = cboJsonUnityVersion.Items.Count - 1;
|
cboJsonUnityVersion.SelectedIndex = cboJsonUnityVersion.Items.Count - 1;
|
||||||
if (prevIdaSelection != null) {
|
if (prevIdaSelection != null) {
|
||||||
cboIdaUnityVersion.SelectedItem = prevIdaSelection;
|
cboPyUnityVersion.SelectedItem = prevIdaSelection;
|
||||||
cboCppUnityVersion.SelectedItem = prevCppSelection;
|
cboCppUnityVersion.SelectedItem = prevCppSelection;
|
||||||
cboJsonUnityVersion.SelectedItem = prevJsonSelection;
|
cboJsonUnityVersion.SelectedItem = prevJsonSelection;
|
||||||
}
|
}
|
||||||
@@ -409,29 +409,29 @@ namespace Il2CppInspectorGUI
|
|||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// IDA Python script
|
// Python script
|
||||||
case { rdoOutputIDA: var r } when r.IsChecked == true:
|
case { rdoOutputPy: var r } when r.IsChecked == true:
|
||||||
|
|
||||||
var idaSaveFileDialog = new SaveFileDialog {
|
var pySaveFileDialog = new SaveFileDialog {
|
||||||
Filter = "Python scripts (*.py)|*.py|All files (*.*)|*.*",
|
Filter = "Python scripts (*.py)|*.py|All files (*.*)|*.*",
|
||||||
FileName = "ida.py",
|
FileName = "il2cpp.py",
|
||||||
CheckFileExists = false,
|
CheckFileExists = false,
|
||||||
OverwritePrompt = true
|
OverwritePrompt = true
|
||||||
};
|
};
|
||||||
|
|
||||||
if (idaSaveFileDialog.ShowDialog() == false)
|
if (pySaveFileDialog.ShowDialog() == false)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
var idaOutFile = idaSaveFileDialog.FileName;
|
var pyOutFile = pySaveFileDialog.FileName;
|
||||||
|
|
||||||
areaBusyIndicator.Visibility = Visibility.Visible;
|
areaBusyIndicator.Visibility = Visibility.Visible;
|
||||||
var selectedIdaUnityVersion = ((UnityHeaders) cboIdaUnityVersion.SelectedItem)?.VersionRange.Min;
|
var selectedPyUnityVersion = ((UnityHeaders) cboPyUnityVersion.SelectedItem)?.VersionRange.Min;
|
||||||
await Task.Run(() => {
|
await Task.Run(() => {
|
||||||
OnStatusUpdate(this, "Building C++ application model");
|
OnStatusUpdate(this, "Building C++ application model");
|
||||||
model.Build(selectedIdaUnityVersion, CppCompilerType.GCC);
|
model.Build(selectedPyUnityVersion, CppCompilerType.GCC);
|
||||||
|
|
||||||
OnStatusUpdate(this, "Generating IDAPython script");
|
OnStatusUpdate(this, "Generating Python script");
|
||||||
new PythonScript(model).WriteScriptToFile(idaOutFile, "IDA");
|
new PythonScript(model).WriteScriptToFile(pyOutFile, "IDA");
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user