Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

il2cpp class type #37

Open
IkuzaDev opened this issue Dec 5, 2024 · 0 comments
Open

il2cpp class type #37

IkuzaDev opened this issue Dec 5, 2024 · 0 comments

Comments

@IkuzaDev
Copy link

IkuzaDev commented Dec 5, 2024

static auto ForeachClass(Assembly* assembly, void* image) -> void {
if (mode_ == Mode::Il2Cpp) {
const auto count = Invoke("il2cpp_image_get_class_count", image);
for (auto i = 0; i < count; i++) {
const auto pClass = Invoke<void*>("il2cpp_image_get_class", image, i);
if (pClass == nullptr) continue;
const auto pAClass = new Class();
pAClass->address = pClass;
pAClass->name = Invoke<const char*>("il2cpp_class_get_name", pClass);
if (const auto pPClass = Invoke<void*>("il2cpp_class_get_parent", pClass)) pAClass->parent = Invoke<const char*>("il2cpp_class_get_name", pPClass);
//DO_API(Il2CppClass*, il2cpp_class_get_parent, (Il2CppClass * klass));
pAClass->namespaze = Invoke<const char*>("il2cpp_class_get_namespace", pClass);
pAClass->isEnum = Invoke("il2cpp_class_is_enum", pClass);
pAClass->isGeneric = Invoke("il2cpp_class_is_generic", pClass);
pAClass->isInflated = Invoke("il2cpp_class_is_inflated", pClass);
pAClass->isInterface = Invoke("il2cpp_class_is_interface", pClass);
pAClass->isAbstract = Invoke("il2cpp_class_is_abstract", pClass);
pAClass->isBlittable = Invoke("il2cpp_class_is_blittable", pClass);
pAClass->flags = Invoke("il2cpp_class_get_flags", pClass);
pAClass->rank = Invoke("il2cpp_class_get_rank", pClass);
//DO_API(Il2CppClass*, il2cpp_class_get_declaring_type, (Il2CppClass * klass));
assembly->classes.push_back(pAClass);

			ForeachFields(pAClass, pClass);
			ForeachMethod(pAClass, pClass);

			void* i_class;
			void* iter{};
			do {
				if ((i_class = Invoke<void*>("il2cpp_class_get_interfaces", pClass, &iter))) {
					ForeachFields(pAClass, i_class);
					ForeachMethod(pAClass, i_class);
				}
			} while (i_class);
		}
	}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant