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

No type in List and Dictionary #172

Open
ArifRios1st opened this issue Dec 4, 2023 · 1 comment
Open

No type in List and Dictionary #172

ArifRios1st opened this issue Dec 4, 2023 · 1 comment

Comments

@ArifRios1st
Copy link

image

how to get type of List or Dictionary ?

@kotori2
Copy link

kotori2 commented Dec 18, 2023

Got the idea from Il2CppArray* vm::Type::GetGenericArgumentsInternal(Il2CppReflectionType* type, bool runtimeArray). Might not covering all the cases.

    if (prop_class) {
        LOGI("prop %s %s", il2cpp_class_get_name(prop_class), prop_name);
        if(prop_class->generic_class) {
            const Il2CppGenericInst *inst = prop_class->generic_class->context.class_inst;
            for (size_t generic_id = 0; generic_id < inst->type_argc; generic_id++) {
                LOGI("generic type %zu: %s", generic_id, il2cpp_type_get_name(inst->type_argv[generic_id]));
            }
        }
    }

Result:
image

Since this approach depends on precise Il2CppClass offsets to work and Perfare already removed the versioned offset controls, I'm not gonna file a PR.

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

2 participants