Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

马娘新版本DMMdump的DLL 无法使用 #584

Closed
hswangrui opened this issue Mar 16, 2022 · 4 comments
Closed

马娘新版本DMMdump的DLL 无法使用 #584

hswangrui opened this issue Mar 16, 2022 · 4 comments

Comments

@hswangrui
Copy link

hswangrui commented Mar 16, 2022

  • Il2CppDumper版本 -v6.7.6

  • 目标Unity版本 2020.3.24f1

  • 问题描述 马娘新版本DMMdump的DLL 无法使用

image
https://drive.google.com/file/d/14mwdGhSJ-MSOMbO-RUxHgK-1t6d-kFix/view?usp=sharing

@akemimadoka
Copy link

akemimadoka commented Mar 30, 2022

马娘新版本的dll使用类似elf的IsDumped时的表示,可以参考elf的IsDumped然后使GetTypeDefinitionFromIl2CppType及GetGenericParameteFromIl2CppType也处理pe的IsDumped的情况即可

@seawolfers
Copy link

马娘新版本的dll使用类似elf的IsDumped时的表示,可以参考elf的IsDumped然后使GetTypeDefinitionFromIl2CppType及GetGenericParameteFromIl2CppType也处理pe的IsDumped的情况即可

有没有具体的修改点或者dump的结果

@akemimadoka
Copy link

马娘新版本的dll使用类似elf的IsDumped时的表示,可以参考elf的IsDumped然后使GetTypeDefinitionFromIl2CppType及GetGenericParameteFromIl2CppType也处理pe的IsDumped的情况即可

有没有具体的修改点或者dump的结果

可以尝试一下这个,因为没有判断是否需要设置IsDump的信息因此没有直接发pr

diff --git a/Il2CppDumper/ExecutableFormats/PE.cs b/Il2CppDumper/ExecutableFormats/PE.cs
index 2226b06..19e5dc7 100644
--- a/Il2CppDumper/ExecutableFormats/PE.cs
+++ b/Il2CppDumper/ExecutableFormats/PE.cs
@@ -10,6 +10,7 @@ namespace Il2CppDumper
     {
         private SectionHeader[] sections;
         private ulong imageBase;
+        public bool IsDumped;
 
         public PE(Stream stream) : base(stream)
         {
@@ -44,6 +45,8 @@ namespace Il2CppDumper
             }
             Position = pos + fileHeader.SizeOfOptionalHeader;
             sections = ReadClassArray<SectionHeader>(fileHeader.NumberOfSections);
+
+            IsDumped = true;
         }
 
         public void LoadFromMemory(ulong addr)
diff --git a/Il2CppDumper/Program.cs b/Il2CppDumper/Program.cs
index e1299da..10d4aa4 100644
--- a/Il2CppDumper/Program.cs
+++ b/Il2CppDumper/Program.cs
@@ -184,7 +184,7 @@ namespace Il2CppDumper
             var version = config.ForceIl2CppVersion ? config.ForceVersion : metadata.Version;
             il2Cpp.SetProperties(version, metadata.maxMetadataUsages);
             Console.WriteLine($"Il2Cpp Version: {il2Cpp.Version}");
-            if (il2Cpp.Version >= 27 && il2Cpp is ElfBase elf && elf.IsDumped)
+            if (il2Cpp.Version >= 27 && ((il2Cpp is ElfBase elf && elf.IsDumped) || (il2Cpp is PE pe && pe.IsDumped)))
             {
                 Console.WriteLine("Input global-metadata.dat dump address:");
                 metadata.Address = Convert.ToUInt64(Console.ReadLine(), 16);
diff --git a/Il2CppDumper/Utils/Il2CppExecutor.cs b/Il2CppDumper/Utils/Il2CppExecutor.cs
index eaa2afd..4c017c4 100644
--- a/Il2CppDumper/Utils/Il2CppExecutor.cs
+++ b/Il2CppDumper/Utils/Il2CppExecutor.cs
@@ -292,7 +292,7 @@ namespace Il2CppDumper
 
         public Il2CppTypeDefinition GetTypeDefinitionFromIl2CppType(Il2CppType il2CppType)
         {
-            if (il2Cpp.Version >= 27 && il2Cpp is ElfBase elf && elf.IsDumped)
+            if (il2Cpp.Version >= 27 && ((il2Cpp is ElfBase elf && elf.IsDumped) || (il2Cpp is PE pe && pe.IsDumped)))
             {
                 var offset = il2CppType.data.typeHandle - metadata.Address - metadata.header.typeDefinitionsOffset;
                 var index = offset / (ulong)metadata.SizeOf(typeof(Il2CppTypeDefinition));
@@ -306,7 +306,7 @@ namespace Il2CppDumper
 
         public Il2CppGenericParameter GetGenericParameteFromIl2CppType(Il2CppType il2CppType)
         {
-            if (il2Cpp.Version >= 27 && il2Cpp is ElfBase elf && elf.IsDumped)
+            if (il2Cpp.Version >= 27 && ((il2Cpp is ElfBase elf && elf.IsDumped) || (il2Cpp is PE pe && pe.IsDumped)))
             {
                 var offset = il2CppType.data.genericParameterHandle - metadata.Address - metadata.header.genericParametersOffset;
                 var index = offset / (ulong)metadata.SizeOf(typeof(Il2CppGenericParameter));

@Perfare
Copy link
Owner

Perfare commented Apr 21, 2022

已支持,另外现在也不需要输入Metadata地址了

@Perfare Perfare closed this as completed Apr 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants