From 74fa4287d3d12547e1edfa1a6664d7210efd707a Mon Sep 17 00:00:00 2001 From: Perfare Date: Fri, 6 Mar 2020 18:36:33 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0.net=20core=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 144 ++++++++++++++++++++---- Il2CppDumper.sln | 15 ++- Il2CppDumper/Il2CppDumper.csproj | 131 ++++----------------- Il2CppDumper/Program.cs | 17 ++- Il2CppDumper/Properties/AssemblyInfo.cs | 36 ------ Il2CppDumper/app.config | 3 - Il2CppDumper/packages.config | 5 - 7 files changed, 162 insertions(+), 189 deletions(-) delete mode 100644 Il2CppDumper/Properties/AssemblyInfo.cs delete mode 100644 Il2CppDumper/app.config delete mode 100644 Il2CppDumper/packages.config diff --git a/.gitignore b/.gitignore index 1c9a181..4ce6fdd 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,10 @@ ## Ignore Visual Studio temporary files, build results, and ## files generated by popular Visual Studio add-ons. +## +## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore # User-specific files +*.rsuser *.suo *.user *.userosscache @@ -15,18 +18,23 @@ [Dd]ebugPublic/ [Rr]elease/ [Rr]eleases/ -[Xx]64/ -[Xx]86/ -[Bb]uild/ +x64/ +x86/ +[Aa][Rr][Mm]/ +[Aa][Rr][Mm]64/ bld/ [Bb]in/ [Oo]bj/ +[Ll]og/ -# Visual Studio 2015 cache/options directory +# Visual Studio 2015/2017 cache/options directory .vs/ # Uncomment if you have tasks that create the project's static files in wwwroot #wwwroot/ +# Visual Studio 2017 auto generated files +Generated\ Files/ + # MSTest test Results [Tt]est[Rr]esult*/ [Bb]uild[Ll]og.* @@ -40,18 +48,28 @@ TestResult.xml [Rr]eleasePS/ dlldata.c -# DNX +# Benchmark Results +BenchmarkDotNet.Artifacts/ + +# .NET Core project.lock.json +project.fragment.lock.json artifacts/ +# StyleCop +StyleCopReport.xml + +# Files built by Visual Studio *_i.c *_p.c -*_i.h +*_h.h *.ilk *.meta *.obj +*.iobj *.pch *.pdb +*.ipdb *.pgc *.pgd *.rsp @@ -61,6 +79,7 @@ artifacts/ *.tlh *.tmp *.tmp_proj +*_wpftmp.csproj *.log *.vspscc *.vssscc @@ -81,6 +100,7 @@ ipch/ *.sdf *.cachefile *.VC.db +*.VC.VC.opendb # Visual Studio profiler *.psess @@ -88,6 +108,9 @@ ipch/ *.vspx *.sap +# Visual Studio Trace Files +*.e2e + # TFS 2012 Local Workspace $tf/ @@ -108,6 +131,14 @@ _TeamCity* # DotCover is a Code Coverage Tool *.dotCover +# AxoCover is a Code Coverage Tool +.axoCover/* +!.axoCover/settings.json + +# Visual Studio code coverage results +*.coverage +*.coveragexml + # NCrunch _NCrunch_* .*crunch*.local.xml @@ -139,22 +170,25 @@ publish/ # Publish Web Output *.[Pp]ublish.xml *.azurePubxml - -# TODO: Un-comment the next line if you do not want to checkin -# your web deploy settings because they may include unencrypted -# passwords -#*.pubxml +# Note: Comment the next line if you want to checkin your web deploy settings, +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml *.publishproj +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + # NuGet Packages *.nupkg # The packages folder can be ignored because of Package Restore -**/packages/* +**/[Pp]ackages/* # except build/, which is used as an MSBuild target. -!**/packages/build/ +!**/[Pp]ackages/build/ # Uncomment if necessary however generally it will be regenerated when needed -#!**/packages/repositories.config -# NuGet v3's project.json files produces more ignoreable files +#!**/[Pp]ackages/repositories.config +# NuGet v3's project.json files produces more ignorable files *.nuget.props *.nuget.targets @@ -166,28 +200,38 @@ csx/ ecf/ rcf/ -# Windows Store app package directory +# Windows Store app package directories and files AppPackages/ BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt +*.appx # Visual Studio cache files # files ending in .cache can be ignored *.[Cc]ache # but keep track of directories ending in .cache -!*.[Cc]ache/ +!?*.[Cc]ache/ # Others ClientBin/ -[Ss]tyle[Cc]op.* ~$* *~ *.dbmdl *.dbproj.schemaview +*.jfm *.pfx *.publishsettings -node_modules/ orleans.codegen.cs +# Including strong name files can present a security risk +# (https://github.com/github/gitignore/pull/2483#issue-259490424) +#*.snk + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) +#bower_components/ + # RIA/Silverlight projects Generated_Code/ @@ -198,15 +242,20 @@ _UpgradeReport_Files/ Backup*/ UpgradeLog*.XML UpgradeLog*.htm +ServiceFabricBackup/ +*.rptproj.bak # SQL Server files *.mdf *.ldf +*.ndf # Business Intelligence projects *.rdl.data *.bim.layout *.bim_*.settings +*.rptproj.rsuser +*- Backup*.rdl # Microsoft Fakes FakesAssemblies/ @@ -216,6 +265,7 @@ FakesAssemblies/ # Node.js Tools for Visual Studio .ntvs_analysis.dat +node_modules/ # Visual Studio 6 build log *.plg @@ -223,6 +273,9 @@ FakesAssemblies/ # Visual Studio 6 workspace options file *.opt +# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) +*.vbw + # Visual Studio LightSwitch build output **/*.HTMLClient/GeneratedArtifacts **/*.DesktopClient/GeneratedArtifacts @@ -231,12 +284,57 @@ FakesAssemblies/ **/*.Server/ModelManifest.xml _Pvt_Extensions -# LightSwitch generated files -GeneratedArtifacts/ -ModelManifest.xml - # Paket dependency manager .paket/paket.exe +paket-files/ # FAKE - F# Make .fake/ + +# JetBrains Rider +.idea/ +*.sln.iml + +# CodeRush personal settings +.cr/personal + +# Python Tools for Visual Studio (PTVS) +__pycache__/ +*.pyc + +# Cake - Uncomment if you are using it +# tools/** +# !tools/packages.config + +# Tabs Studio +*.tss + +# Telerik's JustMock configuration file +*.jmconfig + +# BizTalk build output +*.btp.cs +*.btm.cs +*.odx.cs +*.xsd.cs + +# OpenCover UI analysis results +OpenCover/ + +# Azure Stream Analytics local run output +ASALocalRun/ + +# MSBuild Binary and Structured Log +*.binlog + +# NVidia Nsight GPU debugger configuration file +*.nvuser + +# MFractors (Xamarin productivity tool) working folder +.mfractor/ + +# Local History for Visual Studio +.localhistory/ + +# BeatPulse healthcheck temp database +healthchecksdb \ No newline at end of file diff --git a/Il2CppDumper.sln b/Il2CppDumper.sln index 8889191..0217444 100644 --- a/Il2CppDumper.sln +++ b/Il2CppDumper.sln @@ -1,9 +1,9 @@  Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 16 -VisualStudioVersion = 16.0.29728.190 +VisualStudioVersion = 16.0.29806.167 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Il2CppDumper", "Il2CppDumper\Il2CppDumper.csproj", "{379715D4-4B7B-41F2-B78A-8B18D86320E2}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Il2CppDumper", "Il2CppDumper\Il2CppDumper.csproj", "{2087F99A-A655-41C1-84BB-54798AEA4080}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -11,12 +11,15 @@ Global Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {379715D4-4B7B-41F2-B78A-8B18D86320E2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {379715D4-4B7B-41F2-B78A-8B18D86320E2}.Debug|Any CPU.Build.0 = Debug|Any CPU - {379715D4-4B7B-41F2-B78A-8B18D86320E2}.Release|Any CPU.ActiveCfg = Release|Any CPU - {379715D4-4B7B-41F2-B78A-8B18D86320E2}.Release|Any CPU.Build.0 = Release|Any CPU + {2087F99A-A655-41C1-84BB-54798AEA4080}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2087F99A-A655-41C1-84BB-54798AEA4080}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2087F99A-A655-41C1-84BB-54798AEA4080}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2087F99A-A655-41C1-84BB-54798AEA4080}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {E570C2EE-9A67-4FA2-A564-FB23AD4800C9} + EndGlobalSection EndGlobal diff --git a/Il2CppDumper/Il2CppDumper.csproj b/Il2CppDumper/Il2CppDumper.csproj index d3e0635..b7f70f1 100644 --- a/Il2CppDumper/Il2CppDumper.csproj +++ b/Il2CppDumper/Il2CppDumper.csproj @@ -1,127 +1,36 @@ - - - + + - Debug - AnyCPU - {379715D4-4B7B-41F2-B78A-8B18D86320E2} Exe - Properties - Il2CppDumper - Il2CppDumper - v4.6 - 512 - - - - AnyCPU - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - false - - - AnyCPU - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - false + netcoreapp3.1;net46 + 1.0.0 + 1.0.0.0 + 1.0.0.0 + Copyright © Perfare 2016-2020 + - - ..\packages\Mono.Cecil.0.11.1\lib\net40\Mono.Cecil.dll - - - ..\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll - - - + + + + + - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + PreserveNewest - + PreserveNewest - + PreserveNewest - - - - + PreserveNewest - - - - - - - - - \ No newline at end of file + + diff --git a/Il2CppDumper/Program.cs b/Il2CppDumper/Program.cs index dbcaacf..11eb9bd 100644 --- a/Il2CppDumper/Program.cs +++ b/Il2CppDumper/Program.cs @@ -1,9 +1,10 @@ using System; using System.IO; using System.Linq; -using System.Text.RegularExpressions; -using System.Windows.Forms; using Newtonsoft.Json; +#if NETFRAMEWORK +using System.Windows.Forms; +#endif namespace Il2CppDumper { @@ -14,7 +15,7 @@ namespace Il2CppDumper [STAThread] static void Main(string[] args) { - config = JsonConvert.DeserializeObject(File.ReadAllText(Application.StartupPath + Path.DirectorySeparatorChar + @"config.json")); + config = JsonConvert.DeserializeObject(File.ReadAllText(AppDomain.CurrentDomain.BaseDirectory + @"config.json")); byte[] il2cppBytes = null; byte[] metadataBytes = null; @@ -46,6 +47,7 @@ namespace Il2CppDumper metadataBytes = file2; } } +#if NETFRAMEWORK if (il2cppBytes == null) { var ofd = new OpenFileDialog(); @@ -68,6 +70,12 @@ namespace Il2CppDumper return; } } +#endif + if (il2cppBytes == null) + { + ShowHelp(); + return; + } try { if (Init(il2cppBytes, metadataBytes, out var metadata, out var il2Cpp)) @@ -85,8 +93,7 @@ namespace Il2CppDumper static void ShowHelp() { - Console.WriteLine($"usage: {AppDomain.CurrentDomain.FriendlyName} [mode]"); - Application.ExitThread(); + Console.WriteLine($"usage: {AppDomain.CurrentDomain.FriendlyName} "); } private static bool Init(byte[] il2cppBytes, byte[] metadataBytes, out Metadata metadata, out Il2Cpp il2Cpp) diff --git a/Il2CppDumper/Properties/AssemblyInfo.cs b/Il2CppDumper/Properties/AssemblyInfo.cs deleted file mode 100644 index e33cdca..0000000 --- a/Il2CppDumper/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// 有关程序集的一般信息由以下 -// 控制。更改这些特性值可修改 -// 与程序集关联的信息。 -[assembly: AssemblyTitle("Il2CppDumper")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("Il2CppDumper")] -[assembly: AssemblyCopyright("Copyright © Perfare 2016-2020")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -//将 ComVisible 设置为 false 将使此程序集中的类型 -//对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型, -//请将此类型的 ComVisible 特性设置为 true。 -[assembly: ComVisible(false)] - -// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID -[assembly: Guid("379715d4-4b7b-41f2-b78a-8b18d86320e2")] - -// 程序集的版本信息由下列四个值组成: -// -// 主版本 -// 次版本 -// 生成号 -// 修订号 -// -//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值, -// 方法是按如下所示使用“*”: : -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Il2CppDumper/app.config b/Il2CppDumper/app.config deleted file mode 100644 index b45f31e..0000000 --- a/Il2CppDumper/app.config +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/Il2CppDumper/packages.config b/Il2CppDumper/packages.config deleted file mode 100644 index 29014e0..0000000 --- a/Il2CppDumper/packages.config +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file