Skip to content

Commit 105595e

Browse files
committed
修复高版本下MethodInfo生成错误
1 parent ee6c715 commit 105595e

File tree

1 file changed

+25
-3
lines changed

1 file changed

+25
-3
lines changed

Il2CppDumper/Outputs/StructGenerator.cs

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1389,7 +1389,15 @@ private void GenerateMethodInfo(string methodInfoName, string structTypeName, Li
13891389

13901390
methodInfoHeader.Append($"struct {methodInfoName} {{\n");
13911391
methodInfoHeader.Append($"\tIl2CppMethodPointer methodPointer;\n");
1392-
methodInfoHeader.Append($"\tvoid* invoker_method;\n");
1392+
if (il2Cpp.Version >= 29)
1393+
{
1394+
methodInfoHeader.Append($"\tIl2CppMethodPointer virtualMethodPointer;\n");
1395+
methodInfoHeader.Append($"\tInvokerMethod invoker_method;\n");
1396+
}
1397+
else
1398+
{
1399+
methodInfoHeader.Append($"\tvoid* invoker_method;\n"); //TODO
1400+
}
13931401
methodInfoHeader.Append($"\tconst char* name;\n");
13941402
if (il2Cpp.Version <= 24)
13951403
{
@@ -1400,7 +1408,14 @@ private void GenerateMethodInfo(string methodInfoName, string structTypeName, Li
14001408
methodInfoHeader.Append($"\t{structTypeName}_c *klass;\n");
14011409
}
14021410
methodInfoHeader.Append($"\tconst Il2CppType *return_type;\n");
1403-
methodInfoHeader.Append($"\tconst void* parameters;\n");
1411+
if (il2Cpp.Version >= 29)
1412+
{
1413+
methodInfoHeader.Append($"\tconst Il2CppType** parameters;\n");
1414+
}
1415+
else
1416+
{
1417+
methodInfoHeader.Append($"\tconst void* parameters;\n"); //ParameterInfo*
1418+
}
14041419
if (rgctxs.Count > 0)
14051420
{
14061421
methodInfoHeader.Append($"\tconst {methodInfoName}_RGCTXs* rgctx_data;\n");
@@ -1412,7 +1427,14 @@ private void GenerateMethodInfo(string methodInfoName, string structTypeName, Li
14121427
methodInfoHeader.Append($"\tunion\n");
14131428
methodInfoHeader.Append($"\t{{\n");
14141429
methodInfoHeader.Append($"\t\tconst void* genericMethod;\n");
1415-
methodInfoHeader.Append($"\t\tconst void* genericContainer;\n");
1430+
if (il2Cpp.Version >= 27)
1431+
{
1432+
methodInfoHeader.Append($"\t\tconst void* genericContainerHandle;\n");
1433+
}
1434+
else
1435+
{
1436+
methodInfoHeader.Append($"\t\tconst void* genericContainer;\n");
1437+
}
14161438
methodInfoHeader.Append($"\t}};\n");
14171439
if (il2Cpp.Version <= 24)
14181440
{

0 commit comments

Comments
 (0)