Skip to content

Commit

Permalink
支持Unity最新版本
Browse files Browse the repository at this point in the history
  • Loading branch information
Perfare committed Mar 21, 2022
1 parent 98a8b4d commit 260978a
Show file tree
Hide file tree
Showing 4 changed files with 2,659 additions and 11 deletions.
9 changes: 5 additions & 4 deletions module/src/main/cpp/game.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#define RIRU_IL2CPPDUMPER_GAME_H

#define GamePackageName "com.game.packagename"
#define UnityVersion 2020.2.4f1
#define UnityVersion 2021.2.0f1

// 2018.3.0f2 and up enable it
#define VersionAbove2018dot3
Expand Down Expand Up @@ -36,10 +36,11 @@
// 2019.3.0f6 | 2019.3.0f6 - 2019.3.6f1 | v24.2
// 2019.3.7f1 | 2019.3.7f1 - 2019.4.14f1 | v24.3
// 2019.4.15f1 | 2019.4.15f1 - 2019.4.20f1 | v24.4
// 2019.4.21f1 | 2019.4.21f1 - 2019.4.29f1 | v24.5
// 2019.4.21f1 | 2019.4.21f1 - 2019.4.36f1 | v24.5
// 2020.1.0f1 | 2020.1.0f1 - 2020.1.10f1 | v24.3
// 2020.1.11f1 | 2020.1.11f1 - 2020.1.17f1 | v24.4
// 2020.2.0f1 | 2020.2.0f1 - 2020.2.3f1 | v27
// 2020.2.4f1 | 2020.2.4f1 - 2020.3.15f2 | v27.1
// 2021.1.0f1 | 2021.1.0f1 - 2021.1.16f1 | v27.2
// 2020.2.4f1 | 2020.2.4f1 - 2020.3.31f1 | v27.1
// 2021.1.0f1 | 2021.1.0f1 - 2021.1.28f1 | v27.2
// 2021.2.0f1 | 2021.2.0f1 ~ | v29
#endif //RIRU_IL2CPPDUMPER_GAME_H
14 changes: 7 additions & 7 deletions module/src/main/cpp/il2cpp_dump.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,10 +134,9 @@ std::string dump_method(Il2CppClass *klass) {
auto return_class = il2cpp_class_from_type(return_type);
outPut << return_class->name << " " << method->name << "(";
for (int i = 0; i < method->parameters_count; ++i) {
auto parameters = method->parameters[i];
auto parameter_type = parameters.parameter_type;
auto attrs = parameter_type->attrs;
if (parameter_type->byref) {
auto param = il2cpp_method_get_param(method, i);
auto attrs = param->attrs;
if (param->byref) {
if (attrs & PARAM_ATTRIBUTE_OUT && !(attrs & PARAM_ATTRIBUTE_IN)) {
outPut << "out ";
} else if (attrs & PARAM_ATTRIBUTE_IN && !(attrs & PARAM_ATTRIBUTE_OUT)) {
Expand All @@ -153,8 +152,8 @@ std::string dump_method(Il2CppClass *klass) {
outPut << "[Out] ";
}
}
auto parameter_class = il2cpp_class_from_type(parameter_type);
outPut << parameter_class->name << " " << parameters.name;
auto parameter_class = il2cpp_class_from_type(param);
outPut << parameter_class->name << " " << il2cpp_method_get_param_name(method, i);
outPut << ", ";
}
if (method->parameters_count > 0) {
Expand All @@ -181,7 +180,8 @@ std::string dump_property(Il2CppClass *klass) {
prop_class = il2cpp_class_from_type(prop->get->return_type);
} else if (prop->set) {
outPut << get_method_modifier(prop->set->flags);
prop_class = il2cpp_class_from_type(prop->set->parameters[0].parameter_type);
auto param = il2cpp_method_get_param(prop->set, 0);
prop_class = il2cpp_class_from_type(param);
}
if (prop_class) {
outPut << prop_class->name << " " << prop->name << " { ";
Expand Down
Loading

0 comments on commit 260978a

Please sign in to comment.