mirror of
https://github.com/Perfare/Il2CppDumper.git
synced 2025-01-10 03:27:28 -03:00
提取函数
This commit is contained in:
parent
c03e915182
commit
7a13ac1af9
2 changed files with 18 additions and 10 deletions
|
@ -70,6 +70,7 @@ namespace Il2CppDumper
|
|||
}
|
||||
var pt_dynamic = programSegment.First(x => x.p_type == PT_DYNAMIC);
|
||||
dynamicSection = ReadClassArray<Elf32_Dyn>(pt_dynamic.p_offset, pt_dynamic.p_filesz / 8u);
|
||||
ReadSymbol();
|
||||
if (!isDumped)
|
||||
{
|
||||
RelocationProcessing();
|
||||
|
@ -204,18 +205,21 @@ namespace Il2CppDumper
|
|||
return false;
|
||||
}
|
||||
|
||||
private void ReadSymbol()
|
||||
{
|
||||
var dynsymOffset = MapVATR(dynamicSection.First(x => x.d_tag == DT_SYMTAB).d_un);
|
||||
var dynstrOffset = MapVATR(dynamicSection.First(x => x.d_tag == DT_STRTAB).d_un);
|
||||
var dynsymSize = dynstrOffset - dynsymOffset;
|
||||
symbolTable = ReadClassArray<Elf32_Sym>(dynsymOffset, (long)dynsymSize / 16);
|
||||
}
|
||||
|
||||
private void RelocationProcessing()
|
||||
{
|
||||
Console.WriteLine("Applying relocations...");
|
||||
try
|
||||
{
|
||||
var dynsymOffset = MapVATR(dynamicSection.First(x => x.d_tag == DT_SYMTAB).d_un);
|
||||
var dynstrOffset = MapVATR(dynamicSection.First(x => x.d_tag == DT_STRTAB).d_un);
|
||||
var dynsymSize = dynstrOffset - dynsymOffset;
|
||||
var reldynOffset = MapVATR(dynamicSection.First(x => x.d_tag == DT_REL).d_un);
|
||||
var reldynSize = dynamicSection.First(x => x.d_tag == DT_RELSZ).d_un;
|
||||
symbolTable = ReadClassArray<Elf32_Sym>(dynsymOffset, (long)dynsymSize / 16);
|
||||
var relTable = ReadClassArray<Elf32_Rel>(reldynOffset, reldynSize / 8);
|
||||
var isx86 = elfHeader.e_machine == 0x3;
|
||||
foreach (var rel in relTable)
|
||||
|
|
|
@ -59,6 +59,7 @@ namespace Il2CppDumper
|
|||
}
|
||||
var pt_dynamic = programSegment.First(x => x.p_type == PT_DYNAMIC);
|
||||
dynamicSection = ReadClassArray<Elf64_Dyn>(pt_dynamic.p_offset, (long)pt_dynamic.p_filesz / 16L);
|
||||
ReadSymbol();
|
||||
if (!isDumped)
|
||||
{
|
||||
RelocationProcessing();
|
||||
|
@ -145,18 +146,21 @@ namespace Il2CppDumper
|
|||
return false;
|
||||
}
|
||||
|
||||
private void ReadSymbol()
|
||||
{
|
||||
var dynsymOffset = MapVATR(dynamicSection.First(x => x.d_tag == DT_SYMTAB).d_un);
|
||||
var dynstrOffset = MapVATR(dynamicSection.First(x => x.d_tag == DT_STRTAB).d_un);
|
||||
var dynsymSize = dynstrOffset - dynsymOffset;
|
||||
symbolTable = ReadClassArray<Elf64_Sym>(dynsymOffset, (long)dynsymSize / 24L);
|
||||
}
|
||||
|
||||
private void RelocationProcessing()
|
||||
{
|
||||
Console.WriteLine("Applying relocations...");
|
||||
|
||||
try
|
||||
{
|
||||
ulong dynsymOffset = MapVATR(dynamicSection.First(x => x.d_tag == DT_SYMTAB).d_un);
|
||||
ulong dynstrOffset = MapVATR(dynamicSection.First(x => x.d_tag == DT_STRTAB).d_un);
|
||||
var dynsymSize = dynstrOffset - dynsymOffset;
|
||||
ulong relaOffset = MapVATR(dynamicSection.First(x => x.d_tag == DT_RELA).d_un);
|
||||
var relaOffset = MapVATR(dynamicSection.First(x => x.d_tag == DT_RELA).d_un);
|
||||
var relaSize = dynamicSection.First(x => x.d_tag == DT_RELASZ).d_un;
|
||||
symbolTable = ReadClassArray<Elf64_Sym>(dynsymOffset, (long)dynsymSize / 24L);
|
||||
var relaTable = ReadClassArray<Elf64_Rela>(relaOffset, (long)relaSize / 24L);
|
||||
foreach (var rela in relaTable)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue