Skip to content

HybridCLR support #231

@pkuislm

Description

@pkuislm

#230 The problem mentioned in this issue is due to the signature of the hook function being incorrect. HybridCLR passes a pointer into this function, but we're using an int here, which causes the upper 32 bits of the pointer to be lost, resulting in an illegal memory access exception. To fix this issue, we can change the argument to long.

[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
internal delegate Il2CppClass* MethodDelegate(long index);

private Il2CppClass* Hook(long index)
{
    if (InjectorHelpers.s_InjectedClasses.TryGetValue(index, out IntPtr classPtr))
        return (Il2CppClass*)classPtr;

    return Original(index);
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions