重命名

This commit is contained in:
Perfare 2020-02-13 01:15:10 +08:00
parent c80d4bd3ad
commit cc624ef293
13 changed files with 36 additions and 36 deletions

View file

@ -27,7 +27,7 @@ namespace Il2CppDumper
public Elf(Stream stream, float version, long maxMetadataUsages) : base(stream, version, maxMetadataUsages)
{
is32Bit = true;
Is32Bit = true;
elfHeader = ReadClass<Elf32_Ehdr>();
programSegment = ReadClassArray<Elf32_Phdr>(elfHeader.e_phoff, elfHeader.e_phnum);
try
@ -89,7 +89,7 @@ namespace Il2CppDumper
uint codeRegistration = 0;
uint metadataRegistration = 0;
var result = (uint)resultList[0];
if (version < 24f)
if (Version < 24f)
{
if (elfHeader.e_machine == EM_ARM)
{
@ -101,7 +101,7 @@ namespace Il2CppDumper
metadataRegistration = ReadUInt32();
}
}
else if (version >= 24f)
else if (Version >= 24f)
{
if (elfHeader.e_machine == EM_ARM)
{

View file

@ -35,7 +35,7 @@ namespace Il2CppDumper
protected Il2Cpp(Stream stream, float version, long maxMetadataUsages) : base(stream)
{
this.version = version;
this.Version = version;
this.maxMetadataUsages = maxMetadataUsages;
}
@ -58,18 +58,18 @@ namespace Il2CppDumper
genericMethodPointers = MapVATR<ulong>(pCodeRegistration.genericMethodPointers, pCodeRegistration.genericMethodPointersCount);
invokerPointers = MapVATR<ulong>(pCodeRegistration.invokerPointers, pCodeRegistration.invokerPointersCount);
customAttributeGenerators = MapVATR<ulong>(pCodeRegistration.customAttributeGenerators, pCodeRegistration.customAttributeCount);
if (version > 16)
if (Version > 16)
{
metadataUsages = MapVATR<ulong>(pMetadataRegistration.metadataUsages, maxMetadataUsages);
}
if (version >= 22)
if (Version >= 22)
{
reversePInvokeWrappers = MapVATR<ulong>(pCodeRegistration.reversePInvokeWrappers, pCodeRegistration.reversePInvokeWrapperCount);
unresolvedVirtualCallPointers = MapVATR<ulong>(pCodeRegistration.unresolvedVirtualCallPointers, pCodeRegistration.unresolvedVirtualCallCount);
}
genericInsts = Array.ConvertAll(MapVATR<ulong>(pMetadataRegistration.genericInsts, pMetadataRegistration.genericInstsCount), x => MapVATR<Il2CppGenericInst>(x));
fieldOffsetsArePointers = version > 21;
if (version == 21)
fieldOffsetsArePointers = Version > 21;
if (Version == 21)
{
var fieldTest = MapVATR<uint>(pMetadataRegistration.fieldOffsets, 6);
fieldOffsetsArePointers = fieldTest[0] == 0 && fieldTest[1] == 0 && fieldTest[2] == 0 && fieldTest[3] == 0 && fieldTest[4] == 0 && fieldTest[5] > 0;
@ -90,7 +90,7 @@ namespace Il2CppDumper
types[i].Init();
typeDic.Add(pTypes[i], types[i]);
}
if (version >= 24.2f)
if (Version >= 24.2f)
{
var pCodeGenModules = MapVATR<ulong>(pCodeRegistration.codeGenModules, pCodeRegistration.codeGenModulesCount);
codeGenModules = new Il2CppCodeGenModule[pCodeGenModules.Length];
@ -159,7 +159,7 @@ namespace Il2CppDumper
{
if (isValueType)
{
if (is32Bit)
if (Is32Bit)
{
offset -= 8;
}
@ -184,7 +184,7 @@ namespace Il2CppDumper
public ulong GetMethodPointer(int methodIndex, int methodDefinitionIndex, int imageIndex, uint methodToken)
{
if (version >= 24.2f)
if (Version >= 24.2f)
{
if (genericMethoddDictionary.TryGetValue(methodDefinitionIndex, out var methodPointer))
{

View file

@ -16,7 +16,7 @@ namespace Il2CppDumper
public Macho(Stream stream, float version, long maxMetadataUsages) : base(stream, version, maxMetadataUsages)
{
is32Bit = true;
Is32Bit = true;
Position += 16; //skip magic, cputype, cpusubtype, filetype
var ncmds = ReadUInt32();
Position += 8; //skip sizeofcmds, flags
@ -64,7 +64,7 @@ namespace Il2CppDumper
public override bool Search()
{
if (version < 21)
if (Version < 21)
{
var __mod_init_func = sections.First(x => x.sectname == "__mod_init_func");
var addrs = ReadClassArray<uint>(__mod_init_func.offset, __mod_init_func.size / 4u);

View file

@ -56,7 +56,7 @@ namespace Il2CppDumper
public override bool Search()
{
if (version < 23)
if (Version < 23)
{
var __mod_init_func = sections.First(x => x.sectname == "__mod_init_func");
var addrs = ReadClassArray<ulong>(__mod_init_func.offset, (long)__mod_init_func.size / 8);
@ -89,7 +89,7 @@ namespace Il2CppDumper
}
}
}
if (version == 23)
if (Version == 23)
{
/* ADRP X0, unk
* ADD X0, X0, unk
@ -130,7 +130,7 @@ namespace Il2CppDumper
}
}
}
if (version >= 24)
if (Version >= 24)
{
/* ADRP X0, unk
* ADD X0, X0, unk

View file

@ -35,7 +35,7 @@ namespace Il2CppDumper
public Metadata(Stream stream, float version) : base(stream)
{
this.version = version;
this.Version = version;
metadataHeader = ReadClass<Il2CppGlobalMetadataHeader>();
if (metadataHeader.sanity != 0xFAB11BAF)
{
@ -117,7 +117,7 @@ namespace Il2CppDumper
public int GetCustomAttributeIndex(Il2CppImageDefinition imageDef, int customAttributeIndex, uint token)
{
if (version > 24)
if (Version > 24)
{
var end = imageDef.customAttributeStart + imageDef.customAttributeCount;
for (int i = imageDef.customAttributeStart; i < end; i++)
@ -181,7 +181,7 @@ namespace Il2CppDumper
var attr = (VersionAttribute)Attribute.GetCustomAttribute(i, typeof(VersionAttribute));
if (attr != null)
{
if (version < attr.Min || version > attr.Max)
if (Version < attr.Min || Version > attr.Max)
continue;
}
switch (i.FieldType.Name)

View file

@ -200,7 +200,7 @@ namespace Il2CppDumper
}
writer.Flush();
unCompressedStream.Position = 0;
return new NSO(unCompressedStream, version, maxMetadataUsages);
return new NSO(unCompressedStream, Version, maxMetadataUsages);
}
return this;
}

View file

@ -27,7 +27,7 @@ namespace Il2CppDumper
var pos = Position;
if (fileHeader.Machine == 0x14c) //Intel 386
{
is32Bit = true;
Is32Bit = true;
var optionalHeader = ReadClass<OptionalHeader>();
imageBase = optionalHeader.ImageBase;
}

View file

@ -8,8 +8,8 @@ namespace Il2CppDumper
{
public class BinaryStream : IDisposable
{
public float version;
public bool is32Bit;
public float Version;
public bool Is32Bit;
private Stream stream;
private BinaryReader reader;
private BinaryWriter writer;
@ -94,11 +94,11 @@ namespace Il2CppDumper
return ReadUInt16();
case "Byte":
return ReadByte();
case "Int64" when is32Bit:
case "Int64" when Is32Bit:
return (long)ReadInt32();
case "Int64":
return ReadInt64();
case "UInt64" when is32Bit:
case "UInt64" when Is32Bit:
return (ulong)ReadUInt32();
case "UInt64":
return ReadUInt64();
@ -135,7 +135,7 @@ namespace Il2CppDumper
}
if (versionAttribute != null)
{
if (version < versionAttribute.Min || version > versionAttribute.Max)
if (Version < versionAttribute.Min || Version > versionAttribute.Max)
continue;
}
var fieldType = i.FieldType;

View file

@ -362,7 +362,7 @@ namespace Il2CppDumper
public string GetCustomAttribute(Il2CppImageDefinition image, int customAttributeIndex, uint token, string padding = "")
{
if (il2Cpp.version < 21)
if (il2Cpp.Version < 21)
return string.Empty;
var attributeIndex = metadata.GetCustomAttributeIndex(image, customAttributeIndex, token);
if (attributeIndex >= 0)

View file

@ -80,7 +80,7 @@ namespace Il2CppDumper
}
}
writer.WriteLine("print('Make method name done')");
if (il2Cpp.version > 16)
if (il2Cpp.Version > 16)
{
writer.WriteLine("print('Setting MetadataUsage...')");
foreach (var i in metadata.metadataUsageDic[1]) //kIl2CppMetadataUsageTypeInfo
@ -158,7 +158,7 @@ namespace Il2CppDumper
if (config.MakeFunction)
{
List<ulong> orderedPointers;
if (il2Cpp.version >= 24.2f)
if (il2Cpp.Version >= 24.2f)
{
orderedPointers = new List<ulong>();
foreach (var methodPointers in il2Cpp.codeGenModuleMethodPointers)
@ -173,7 +173,7 @@ namespace Il2CppDumper
orderedPointers.AddRange(il2Cpp.genericMethodPointers);
orderedPointers.AddRange(il2Cpp.invokerPointers);
orderedPointers.AddRange(il2Cpp.customAttributeGenerators);
if (il2Cpp.version >= 22)
if (il2Cpp.Version >= 22)
{
orderedPointers.AddRange(il2Cpp.reversePInvokeWrappers);
orderedPointers.AddRange(il2Cpp.unresolvedVirtualCallPointers);

View file

@ -194,7 +194,7 @@ namespace Il2CppDumper
break;
}
var version = config.ForceIl2CppVersion ? config.ForceVersion : metadata.version;
var version = config.ForceIl2CppVersion ? config.ForceVersion : metadata.Version;
Console.WriteLine("Initializing il2cpp file...");
var il2CppMemory = new MemoryStream(il2cppBytes);
if (isNSO)

View file

@ -313,7 +313,7 @@ namespace Il2CppDumper
}
}
//第三遍添加CustomAttribute
if (il2Cpp.version > 20)
if (il2Cpp.Version > 20)
{
PrepareCustomAttribute();
foreach (var imageDef in metadata.imageDefs)

View file

@ -148,15 +148,15 @@ namespace Il2CppDumper
public ulong FindCodeRegistration()
{
if (il2Cpp.is32Bit)
if (il2Cpp.Is32Bit)
{
if (il2Cpp.version >= 24.2)
if (il2Cpp.Version >= 24.2)
{
return FindCodeRegistration32Bit2019();
}
return FindCodeRegistration32Bit();
}
if (il2Cpp.version >= 24.2)
if (il2Cpp.Version >= 24.2)
{
return FindCodeRegistration64Bit2019();
}
@ -165,7 +165,7 @@ namespace Il2CppDumper
public ulong FindMetadataRegistration()
{
if (il2Cpp.is32Bit)
if (il2Cpp.Is32Bit)
{
return FindMetadataRegistration32Bit();
}