mirror of
https://github.com/Perfare/Il2CppDumper.git
synced 2025-01-10 03:27:28 -03:00
修复bug
This commit is contained in:
parent
6e3601f307
commit
11af31b0b1
1 changed files with 18 additions and 10 deletions
|
@ -80,8 +80,15 @@ namespace Il2CppDumper
|
|||
scriptMetadataMethod.Name = "Method$" + methodName;
|
||||
var imageIndex = typeDefImageIndices[typeDef];
|
||||
var methodPointer = il2Cpp.GetMethodPointer(methodDef.methodIndex, (int)i.Value, imageIndex, methodDef.token);
|
||||
if (methodPointer == 0)
|
||||
{
|
||||
scriptMetadataMethod.MethodAddress = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
scriptMetadataMethod.MethodAddress = il2Cpp.GetRVA(methodPointer);
|
||||
}
|
||||
}
|
||||
foreach (var i in metadata.metadataUsageDic[4]) //kIl2CppMetadataUsageFieldInfo
|
||||
{
|
||||
var fieldRef = metadata.fieldRefs[i.Value];
|
||||
|
@ -131,9 +138,16 @@ namespace Il2CppDumper
|
|||
scriptMetadataMethod.Name = "Method$" + methodName;
|
||||
var imageIndex = typeDefImageIndices[typeDef];
|
||||
var methodPointer = il2Cpp.GetMethodPointer(methodDef.methodIndex, methodSpec.methodDefinitionIndex, imageIndex, methodDef.token);
|
||||
if (methodPointer == 0)
|
||||
{
|
||||
scriptMetadataMethod.MethodAddress = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
scriptMetadataMethod.MethodAddress = il2Cpp.GetRVA(methodPointer);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (config.MakeFunction)
|
||||
{
|
||||
List<ulong> orderedPointers;
|
||||
|
@ -160,17 +174,11 @@ namespace Il2CppDumper
|
|||
//TODO interopData内也包含函数
|
||||
orderedPointers = orderedPointers.Distinct().OrderBy(x => x).ToList();
|
||||
orderedPointers.Remove(0);
|
||||
var addresses = new List<ulong>(orderedPointers.Count);
|
||||
for (int i = 0; i < orderedPointers.Count; i++)
|
||||
{
|
||||
var addr = orderedPointers[i];
|
||||
if (addr > long.MaxValue)
|
||||
{
|
||||
continue;
|
||||
orderedPointers[i] = il2Cpp.GetRVA(orderedPointers[i]);
|
||||
}
|
||||
addresses.Add(il2Cpp.GetRVA(addr));
|
||||
}
|
||||
json.Addresses = addresses;
|
||||
json.Addresses = orderedPointers;
|
||||
}
|
||||
File.WriteAllText("script.json", JsonConvert.SerializeObject(json, Formatting.Indented));
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue