This commit is contained in:
Perfare 2019-02-22 05:43:38 +08:00
parent 7a61e1b2ab
commit be89ac9deb
2 changed files with 49 additions and 95 deletions

View file

@ -329,31 +329,7 @@ namespace Il2CppDumper
public override bool PlusSearch(int methodCount, int typeDefinitionsCount)
{
if (sectionWithName.ContainsKey(".data.rel.ro") && sectionWithName.ContainsKey(".text") && sectionWithName.ContainsKey(".bss"))
{
var datarelro = sectionWithName[".data.rel.ro"];
var text = sectionWithName[".text"];
var bss = sectionWithName[".bss"];
sectionWithName.TryGetValue(".data.rel.ro.local", out var datarelrolocal);
var plusSearch = new PlusSearch(this, methodCount, typeDefinitionsCount, maxMetadataUsages);
plusSearch.SetSearch(datarelro, datarelrolocal);
plusSearch.SetPointerRangeFirst(datarelro, datarelrolocal);
plusSearch.SetPointerRangeSecond(text);
var codeRegistration = plusSearch.FindCodeRegistration();
plusSearch.SetPointerRangeSecond(bss);
var metadataRegistration = plusSearch.FindMetadataRegistration();
if (codeRegistration != 0 && metadataRegistration != 0)
{
Console.WriteLine("CodeRegistration : {0:x}", codeRegistration);
Console.WriteLine("MetadataRegistration : {0:x}", metadataRegistration);
Init(codeRegistration, metadataRegistration);
return true;
}
}
else
{
if (!isDump)
if (!isDump && (!sectionWithName.ContainsKey(".data.rel.ro") || !sectionWithName.ContainsKey(".text") || !sectionWithName.ContainsKey(".bss")))
{
Console.WriteLine("ERROR: This file has been protected.");
}
@ -410,7 +386,6 @@ namespace Il2CppDumper
Init(codeRegistration, metadataRegistration);
return true;
}
}
return false;
}

View file

@ -81,27 +81,6 @@ namespace Il2CppDumper
public override bool PlusSearch(int methodCount, int typeDefinitionsCount)
{
/*if (sectionWithName.ContainsKey(".data") && sectionWithName.ContainsKey(".text") && sectionWithName.ContainsKey(".bss"))
{
var data = sectionWithName[".data"];
var text = sectionWithName[".text"];
var bss = sectionWithName[".bss"];
var plusSearch = new PlusSearch(this, methodCount, typeDefinitionsCount, maxMetadataUsages);
plusSearch.SetSearch(data);
plusSearch.SetPointerRangeFirst(data);
plusSearch.SetPointerRangeSecond(text);
var codeRegistration = plusSearch.FindCodeRegistration64Bit();
plusSearch.SetPointerRangeSecond(bss);
var metadataRegistration = plusSearch.FindMetadataRegistration64Bit();
if (codeRegistration != 0 && metadataRegistration != 0)
{
Console.WriteLine("CodeRegistration : {0:x}", codeRegistration);
Console.WriteLine("MetadataRegistration : {0:x}", metadataRegistration);
Init(codeRegistration, metadataRegistration);
return true;
}
}*/
var plusSearch = new PlusSearch(this, methodCount, typeDefinitionsCount, maxMetadataUsages);
var dataList = new List<Elf64_Phdr>();
var execList = new List<Elf64_Phdr>();