diff --git a/Il2CppDumper/Il2CppDumper.csproj b/Il2CppInspector.CLI/Il2CppInspector.CLI.csproj similarity index 65% rename from Il2CppDumper/Il2CppDumper.csproj rename to Il2CppInspector.CLI/Il2CppInspector.CLI.csproj index 2337430..dc1258e 100644 --- a/Il2CppDumper/Il2CppDumper.csproj +++ b/Il2CppInspector.CLI/Il2CppInspector.CLI.csproj @@ -12,12 +12,12 @@ Noisy Cow Studios Il2CppInspector Command-Line Edition (c) 2017-2020 Katy Coe - www.djkaty.com - www.github.com/djkaty - Il2CppDumper + Il2CppInspector.CLI Katy Coe + Il2CppInspector - @@ -27,18 +27,7 @@ - - True - True - Resources.resx - - - - - - ResXFileCodeGenerator - Resources.Designer.cs - + diff --git a/Il2CppDumper/Program.cs b/Il2CppInspector.CLI/Program.cs similarity index 98% rename from Il2CppDumper/Program.cs rename to Il2CppInspector.CLI/Program.cs index 370d2a3..02b7d3c 100644 --- a/Il2CppDumper/Program.cs +++ b/Il2CppInspector.CLI/Program.cs @@ -9,8 +9,9 @@ using System.Linq; using System.Text.RegularExpressions; using CommandLine; using Il2CppInspector.Reflection; +using Il2CppInspector.Outputs; -namespace Il2CppInspector +namespace Il2CppInspector.CLI { public class App { @@ -163,7 +164,7 @@ namespace Il2CppInspector // C# signatures output using (var signaturesDumperTimer = new Benchmark("Generate C# code")) { - var writer = new Il2CppCSharpDumper(model) { + var writer = new CSharpCodeStubs(model) { ExcludedNamespaces = options.ExcludedNamespaces.ToList(), SuppressMetadata = options.SuppressMetadata, MustCompile = options.MustCompile @@ -215,7 +216,7 @@ namespace Il2CppInspector // IDA Python script output using (var scriptDumperTimer = new Benchmark("IDA Python Script Dumper")) { - var idaWriter = new Il2CppIDAScriptDumper(model); + var idaWriter = new IDAPythonScript(model); idaWriter.WriteScriptToFile(options.PythonOutFile); } } diff --git a/Il2CppInspector.CLI/Properties/launchSettings.json b/Il2CppInspector.CLI/Properties/launchSettings.json new file mode 100644 index 0000000..6f7e67a --- /dev/null +++ b/Il2CppInspector.CLI/Properties/launchSettings.json @@ -0,0 +1,8 @@ +{ + "profiles": { + "Il2CppDumper": { + "commandName": "Project", + "commandLineArgs": "--bin f:\\source\\repos\\il2cppinspector\\il2cpptests\\testbinaries\\hearthstone-ios-15.6.35747\\hearthstone-ios-15.6.35747 --metadata f:\\source\\repos\\il2cppinspector\\il2cpptests\\testbinaries\\hearthstone-ios-15.6.35747\\global-metadata.dat -c f:\\source\\repos\\il2cppinspector\\il2cpptests\\testbinaries\\hearthstone-ios-15.6.35747\\project -p f:\\source\\repos\\il2cppinspector\\il2cpptests\\testbinaries\\Hearthstone-ios-15.6.35747\\ida.py -j -n" + } + } +} \ No newline at end of file diff --git a/Il2CppInspector/Architectures/Il2CppBinaryARM.cs b/Il2CppInspector.Common/Architectures/Il2CppBinaryARM.cs similarity index 100% rename from Il2CppInspector/Architectures/Il2CppBinaryARM.cs rename to Il2CppInspector.Common/Architectures/Il2CppBinaryARM.cs diff --git a/Il2CppInspector/Architectures/Il2CppBinaryARM64.cs b/Il2CppInspector.Common/Architectures/Il2CppBinaryARM64.cs similarity index 100% rename from Il2CppInspector/Architectures/Il2CppBinaryARM64.cs rename to Il2CppInspector.Common/Architectures/Il2CppBinaryARM64.cs diff --git a/Il2CppInspector/Architectures/Il2CppBinaryX64.cs b/Il2CppInspector.Common/Architectures/Il2CppBinaryX64.cs similarity index 100% rename from Il2CppInspector/Architectures/Il2CppBinaryX64.cs rename to Il2CppInspector.Common/Architectures/Il2CppBinaryX64.cs diff --git a/Il2CppInspector/Architectures/Il2CppBinaryX86.cs b/Il2CppInspector.Common/Architectures/Il2CppBinaryX86.cs similarity index 100% rename from Il2CppInspector/Architectures/Il2CppBinaryX86.cs rename to Il2CppInspector.Common/Architectures/Il2CppBinaryX86.cs diff --git a/Il2CppInspector/FileFormatReaders/ElfReader.cs b/Il2CppInspector.Common/FileFormatReaders/ElfReader.cs similarity index 100% rename from Il2CppInspector/FileFormatReaders/ElfReader.cs rename to Il2CppInspector.Common/FileFormatReaders/ElfReader.cs diff --git a/Il2CppInspector/FileFormatReaders/FileFormatReader.cs b/Il2CppInspector.Common/FileFormatReaders/FileFormatReader.cs similarity index 100% rename from Il2CppInspector/FileFormatReaders/FileFormatReader.cs rename to Il2CppInspector.Common/FileFormatReaders/FileFormatReader.cs diff --git a/Il2CppInspector/FileFormatReaders/FormatLayouts/Elf.cs b/Il2CppInspector.Common/FileFormatReaders/FormatLayouts/Elf.cs similarity index 100% rename from Il2CppInspector/FileFormatReaders/FormatLayouts/Elf.cs rename to Il2CppInspector.Common/FileFormatReaders/FormatLayouts/Elf.cs diff --git a/Il2CppInspector/FileFormatReaders/FormatLayouts/MachO.cs b/Il2CppInspector.Common/FileFormatReaders/FormatLayouts/MachO.cs similarity index 100% rename from Il2CppInspector/FileFormatReaders/FormatLayouts/MachO.cs rename to Il2CppInspector.Common/FileFormatReaders/FormatLayouts/MachO.cs diff --git a/Il2CppInspector/FileFormatReaders/FormatLayouts/PE.cs b/Il2CppInspector.Common/FileFormatReaders/FormatLayouts/PE.cs similarity index 100% rename from Il2CppInspector/FileFormatReaders/FormatLayouts/PE.cs rename to Il2CppInspector.Common/FileFormatReaders/FormatLayouts/PE.cs diff --git a/Il2CppInspector/FileFormatReaders/FormatLayouts/UB.cs b/Il2CppInspector.Common/FileFormatReaders/FormatLayouts/UB.cs similarity index 100% rename from Il2CppInspector/FileFormatReaders/FormatLayouts/UB.cs rename to Il2CppInspector.Common/FileFormatReaders/FormatLayouts/UB.cs diff --git a/Il2CppInspector/FileFormatReaders/MachOReader.cs b/Il2CppInspector.Common/FileFormatReaders/MachOReader.cs similarity index 100% rename from Il2CppInspector/FileFormatReaders/MachOReader.cs rename to Il2CppInspector.Common/FileFormatReaders/MachOReader.cs diff --git a/Il2CppInspector/FileFormatReaders/PEReader.cs b/Il2CppInspector.Common/FileFormatReaders/PEReader.cs similarity index 100% rename from Il2CppInspector/FileFormatReaders/PEReader.cs rename to Il2CppInspector.Common/FileFormatReaders/PEReader.cs diff --git a/Il2CppInspector/FileFormatReaders/UBReader.cs b/Il2CppInspector.Common/FileFormatReaders/UBReader.cs similarity index 100% rename from Il2CppInspector/FileFormatReaders/UBReader.cs rename to Il2CppInspector.Common/FileFormatReaders/UBReader.cs diff --git a/Il2CppInspector/FileFormatReaders/WordConversions.cs b/Il2CppInspector.Common/FileFormatReaders/WordConversions.cs similarity index 100% rename from Il2CppInspector/FileFormatReaders/WordConversions.cs rename to Il2CppInspector.Common/FileFormatReaders/WordConversions.cs diff --git a/Il2CppInspector/IL2CPP/Il2CppBinary.cs b/Il2CppInspector.Common/IL2CPP/Il2CppBinary.cs similarity index 100% rename from Il2CppInspector/IL2CPP/Il2CppBinary.cs rename to Il2CppInspector.Common/IL2CPP/Il2CppBinary.cs diff --git a/Il2CppInspector/IL2CPP/Il2CppBinaryClasses.cs b/Il2CppInspector.Common/IL2CPP/Il2CppBinaryClasses.cs similarity index 100% rename from Il2CppInspector/IL2CPP/Il2CppBinaryClasses.cs rename to Il2CppInspector.Common/IL2CPP/Il2CppBinaryClasses.cs diff --git a/Il2CppInspector/IL2CPP/Il2CppConstants.cs b/Il2CppInspector.Common/IL2CPP/Il2CppConstants.cs similarity index 100% rename from Il2CppInspector/IL2CPP/Il2CppConstants.cs rename to Il2CppInspector.Common/IL2CPP/Il2CppConstants.cs diff --git a/Il2CppInspector/IL2CPP/Il2CppInspector.cs b/Il2CppInspector.Common/IL2CPP/Il2CppInspector.cs similarity index 100% rename from Il2CppInspector/IL2CPP/Il2CppInspector.cs rename to Il2CppInspector.Common/IL2CPP/Il2CppInspector.cs diff --git a/Il2CppInspector/IL2CPP/Metadata.cs b/Il2CppInspector.Common/IL2CPP/Metadata.cs similarity index 100% rename from Il2CppInspector/IL2CPP/Metadata.cs rename to Il2CppInspector.Common/IL2CPP/Metadata.cs diff --git a/Il2CppInspector/IL2CPP/MetadataClasses.cs b/Il2CppInspector.Common/IL2CPP/MetadataClasses.cs similarity index 100% rename from Il2CppInspector/IL2CPP/MetadataClasses.cs rename to Il2CppInspector.Common/IL2CPP/MetadataClasses.cs diff --git a/Il2CppInspector/IL2CPP/MetadataUsage.cs b/Il2CppInspector.Common/IL2CPP/MetadataUsage.cs similarity index 100% rename from Il2CppInspector/IL2CPP/MetadataUsage.cs rename to Il2CppInspector.Common/IL2CPP/MetadataUsage.cs diff --git a/Il2CppInspector.Common/Il2CppInspector.csproj b/Il2CppInspector.Common/Il2CppInspector.csproj new file mode 100644 index 0000000..bd0a7c4 --- /dev/null +++ b/Il2CppInspector.Common/Il2CppInspector.csproj @@ -0,0 +1,35 @@ + + + + netstandard2.1 + Il2CppInspector.Common + Katy Coe + 2.0 + Noisy Cow Studios + Il2CppInspector Shared Library + + + + + + + + + + + + + True + True + Resources.resx + + + + + + ResXFileCodeGenerator + Resources.Designer.cs + + + + \ No newline at end of file diff --git a/Il2CppDumper/Il2CppCSharpDumper.cs b/Il2CppInspector.Common/Outputs/CSharpCodeStubs.cs similarity index 99% rename from Il2CppDumper/Il2CppCSharpDumper.cs rename to Il2CppInspector.Common/Outputs/CSharpCodeStubs.cs index c5855b8..e6b39d2 100644 --- a/Il2CppDumper/Il2CppCSharpDumper.cs +++ b/Il2CppInspector.Common/Outputs/CSharpCodeStubs.cs @@ -3,25 +3,22 @@ using System; using System.Collections.Generic; -using System.ComponentModel; using System.IO; using System.Linq; using System.Reflection; -using System.Reflection.Metadata.Ecma335; -using System.Runtime.InteropServices.ComTypes; using System.Text; using System.Text.RegularExpressions; using System.Threading.Tasks; -using Il2CppDumper.Properties; +using Il2CppInspector.Properties; using Il2CppInspector.Reflection; using Assembly = Il2CppInspector.Reflection.Assembly; using CustomAttributeData = Il2CppInspector.Reflection.CustomAttributeData; using MethodInfo = Il2CppInspector.Reflection.MethodInfo; using TypeInfo = Il2CppInspector.Reflection.TypeInfo; -namespace Il2CppInspector +namespace Il2CppInspector.Outputs { - public class Il2CppCSharpDumper + public class CSharpCodeStubs { private readonly Il2CppModel model; @@ -43,7 +40,7 @@ namespace Il2CppInspector private HashSet usedAssemblyAttributes = new HashSet(); private readonly object usedAssemblyAttributesLock = new object(); - public Il2CppCSharpDumper(Il2CppModel model) => this.model = model; + public CSharpCodeStubs(Il2CppModel model) => this.model = model; public void WriteSingleFile(string outFile) => WriteSingleFile(outFile, t => t.Index); diff --git a/Il2CppDumper/Il2CppIDAScriptDumper.cs b/Il2CppInspector.Common/Outputs/IDAPythonScript.cs similarity index 97% rename from Il2CppDumper/Il2CppIDAScriptDumper.cs rename to Il2CppInspector.Common/Outputs/IDAPythonScript.cs index da708f8..969fde0 100644 --- a/Il2CppDumper/Il2CppIDAScriptDumper.cs +++ b/Il2CppInspector.Common/Outputs/IDAPythonScript.cs @@ -9,14 +9,14 @@ using System.IO; using System.Text; using Il2CppInspector.Reflection; -namespace Il2CppInspector +namespace Il2CppInspector.Outputs { - public class Il2CppIDAScriptDumper + public class IDAPythonScript { private readonly Il2CppModel model; private StreamWriter writer; - public Il2CppIDAScriptDumper(Il2CppModel model) => this.model = model; + public IDAPythonScript(Il2CppModel model) => this.model = model; public void WriteScriptToFile(string outputFile) { using var fs = new FileStream(outputFile, FileMode.Create); diff --git a/Il2CppDumper/Properties/Resources.Designer.cs b/Il2CppInspector.Common/Properties/Resources.Designer.cs similarity index 94% rename from Il2CppDumper/Properties/Resources.Designer.cs rename to Il2CppInspector.Common/Properties/Resources.Designer.cs index ddacae7..966d43d 100644 --- a/Il2CppDumper/Properties/Resources.Designer.cs +++ b/Il2CppInspector.Common/Properties/Resources.Designer.cs @@ -8,7 +8,7 @@ // //------------------------------------------------------------------------------ -namespace Il2CppDumper.Properties { +namespace Il2CppInspector.Properties { using System; @@ -39,7 +39,7 @@ namespace Il2CppDumper.Properties { internal static global::System.Resources.ResourceManager ResourceManager { get { if (object.ReferenceEquals(resourceMan, null)) { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Il2CppDumper.Properties.Resources", typeof(Resources).Assembly); + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Il2CppInspector.Properties.Resources", typeof(Resources).Assembly); resourceMan = temp; } return resourceMan; @@ -69,10 +69,10 @@ namespace Il2CppDumper.Properties { /// <PropertyGroup> /// <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> /// <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> - /// <ProjectGuid>%PROJECTGUID%</ProjectGuid> + /// <ProjectGuid>{%PROJECTGUID%}</ProjectGuid> /// <!--<ProductVersion/>--> /// <!--<SchemaVersion/>--> - /// <Outp [rest of string was truncated]";. + /// <OutputType>Li [rest of string was truncated]";. /// internal static string CsProjTemplate { get { diff --git a/Il2CppDumper/Properties/Resources.resx b/Il2CppInspector.Common/Properties/Resources.resx similarity index 100% rename from Il2CppDumper/Properties/Resources.resx rename to Il2CppInspector.Common/Properties/Resources.resx diff --git a/Il2CppInspector/Reflection/Assembly.cs b/Il2CppInspector.Common/Reflection/Assembly.cs similarity index 100% rename from Il2CppInspector/Reflection/Assembly.cs rename to Il2CppInspector.Common/Reflection/Assembly.cs diff --git a/Il2CppInspector/Reflection/Constants.cs b/Il2CppInspector.Common/Reflection/Constants.cs similarity index 100% rename from Il2CppInspector/Reflection/Constants.cs rename to Il2CppInspector.Common/Reflection/Constants.cs diff --git a/Il2CppInspector/Reflection/ConstructorInfo.cs b/Il2CppInspector.Common/Reflection/ConstructorInfo.cs similarity index 100% rename from Il2CppInspector/Reflection/ConstructorInfo.cs rename to Il2CppInspector.Common/Reflection/ConstructorInfo.cs diff --git a/Il2CppInspector/Reflection/CustomAttributeData.cs b/Il2CppInspector.Common/Reflection/CustomAttributeData.cs similarity index 100% rename from Il2CppInspector/Reflection/CustomAttributeData.cs rename to Il2CppInspector.Common/Reflection/CustomAttributeData.cs diff --git a/Il2CppInspector/Reflection/EventInfo.cs b/Il2CppInspector.Common/Reflection/EventInfo.cs similarity index 100% rename from Il2CppInspector/Reflection/EventInfo.cs rename to Il2CppInspector.Common/Reflection/EventInfo.cs diff --git a/Il2CppInspector/Reflection/Extensions.cs b/Il2CppInspector.Common/Reflection/Extensions.cs similarity index 100% rename from Il2CppInspector/Reflection/Extensions.cs rename to Il2CppInspector.Common/Reflection/Extensions.cs diff --git a/Il2CppInspector/Reflection/FieldInfo.cs b/Il2CppInspector.Common/Reflection/FieldInfo.cs similarity index 100% rename from Il2CppInspector/Reflection/FieldInfo.cs rename to Il2CppInspector.Common/Reflection/FieldInfo.cs diff --git a/Il2CppInspector/Reflection/Il2CppModel.cs b/Il2CppInspector.Common/Reflection/Il2CppModel.cs similarity index 100% rename from Il2CppInspector/Reflection/Il2CppModel.cs rename to Il2CppInspector.Common/Reflection/Il2CppModel.cs diff --git a/Il2CppInspector/Reflection/MemberInfo.cs b/Il2CppInspector.Common/Reflection/MemberInfo.cs similarity index 100% rename from Il2CppInspector/Reflection/MemberInfo.cs rename to Il2CppInspector.Common/Reflection/MemberInfo.cs diff --git a/Il2CppInspector/Reflection/MethodBase.cs b/Il2CppInspector.Common/Reflection/MethodBase.cs similarity index 100% rename from Il2CppInspector/Reflection/MethodBase.cs rename to Il2CppInspector.Common/Reflection/MethodBase.cs diff --git a/Il2CppInspector/Reflection/MethodInfo.cs b/Il2CppInspector.Common/Reflection/MethodInfo.cs similarity index 100% rename from Il2CppInspector/Reflection/MethodInfo.cs rename to Il2CppInspector.Common/Reflection/MethodInfo.cs diff --git a/Il2CppInspector/Reflection/MethodInvoker.cs b/Il2CppInspector.Common/Reflection/MethodInvoker.cs similarity index 100% rename from Il2CppInspector/Reflection/MethodInvoker.cs rename to Il2CppInspector.Common/Reflection/MethodInvoker.cs diff --git a/Il2CppInspector/Reflection/ParameterInfo.cs b/Il2CppInspector.Common/Reflection/ParameterInfo.cs similarity index 100% rename from Il2CppInspector/Reflection/ParameterInfo.cs rename to Il2CppInspector.Common/Reflection/ParameterInfo.cs diff --git a/Il2CppInspector/Reflection/PropertyInfo.cs b/Il2CppInspector.Common/Reflection/PropertyInfo.cs similarity index 100% rename from Il2CppInspector/Reflection/PropertyInfo.cs rename to Il2CppInspector.Common/Reflection/PropertyInfo.cs diff --git a/Il2CppInspector/Reflection/Scope.cs b/Il2CppInspector.Common/Reflection/Scope.cs similarity index 100% rename from Il2CppInspector/Reflection/Scope.cs rename to Il2CppInspector.Common/Reflection/Scope.cs diff --git a/Il2CppInspector/Reflection/TypeInfo.cs b/Il2CppInspector.Common/Reflection/TypeInfo.cs similarity index 100% rename from Il2CppInspector/Reflection/TypeInfo.cs rename to Il2CppInspector.Common/Reflection/TypeInfo.cs diff --git a/Il2CppInspector.sln b/Il2CppInspector.sln index 8a87784..e00f6e7 100644 --- a/Il2CppInspector.sln +++ b/Il2CppInspector.sln @@ -5,11 +5,17 @@ VisualStudioVersion = 16.0.29409.12 MinimumVisualStudioVersion = 10.0.40219.1 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Bin2Object", "Bin2Object\Bin2Object\Bin2Object.csproj", "{55382D6C-01B6-4AFD-850C-7A79DAB6F270}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Il2CppInspector", "Il2CppInspector\Il2CppInspector.csproj", "{E4721466-CC6F-47EB-AD48-F4DE70D77E5C}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Il2CppInspector", "Il2CppInspector.Common\Il2CppInspector.csproj", "{E4721466-CC6F-47EB-AD48-F4DE70D77E5C}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Il2CppDumper", "Il2CppDumper\Il2CppDumper.csproj", "{EA4C27DF-4640-48DF-8CAF-5587884CAF30}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Il2CppInspector.CLI", "Il2CppInspector.CLI\Il2CppInspector.CLI.csproj", "{EA4C27DF-4640-48DF-8CAF-5587884CAF30}" + ProjectSection(ProjectDependencies) = postProject + {E4721466-CC6F-47EB-AD48-F4DE70D77E5C} = {E4721466-CC6F-47EB-AD48-F4DE70D77E5C} + EndProjectSection EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Il2CppTests", "Il2CppTests\Il2CppTests.csproj", "{389E4BDF-A749-4554-848B-32B3B6EE5684}" + ProjectSection(ProjectDependencies) = postProject + {E4721466-CC6F-47EB-AD48-F4DE70D77E5C} = {E4721466-CC6F-47EB-AD48-F4DE70D77E5C} + EndProjectSection EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{46226B08-22BA-455E-8B99-F496E90EDCBC}" ProjectSection(SolutionItems) = preProject diff --git a/Il2CppInspector/Il2CppInspector.csproj b/Il2CppInspector/Il2CppInspector.csproj deleted file mode 100644 index 67d912b..0000000 --- a/Il2CppInspector/Il2CppInspector.csproj +++ /dev/null @@ -1,15 +0,0 @@ - - - - netstandard2.1 - - - - - - - - - - - \ No newline at end of file diff --git a/Il2CppTests/Il2CppTests.csproj b/Il2CppTests/Il2CppTests.csproj index 9cb6b50..a416127 100644 --- a/Il2CppTests/Il2CppTests.csproj +++ b/Il2CppTests/Il2CppTests.csproj @@ -78,7 +78,7 @@ - + diff --git a/Il2CppTests/TestRunner.cs b/Il2CppTests/TestRunner.cs index 8c08fe0..2a37b4f 100644 --- a/Il2CppTests/TestRunner.cs +++ b/Il2CppTests/TestRunner.cs @@ -9,6 +9,7 @@ using System.Collections.Generic; using System.IO; using System.Linq; using Il2CppInspector.Reflection; +using Il2CppInspector.Outputs; using NUnit.Framework; namespace Il2CppInspector @@ -57,7 +58,7 @@ namespace Il2CppInspector // Dump each image in the binary separately int i = 0; foreach (var il2cpp in inspectors) - new Il2CppCSharpDumper(new Il2CppModel(il2cpp)) { + new CSharpCodeStubs(new Il2CppModel(il2cpp)) { ExcludedNamespaces = excludedNamespaces, SuppressMetadata = false, MustCompile = true