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

JVMTI is null when using ClassLoader.choose of another classloader #341

Open
numnum17 opened this issue Nov 18, 2024 · 0 comments
Open

JVMTI is null when using ClassLoader.choose of another classloader #341

numnum17 opened this issue Nov 18, 2024 · 0 comments

Comments

@numnum17
Copy link

numnum17 commented Nov 18, 2024

Hi,
I'm trying to perform instance choose in different class loaders -

export function chooseAll<T>(className: string, callbacks: ChooseCallbacks<T>) {
    Java.enumerateClassLoadersSync().forEach((loader: any) => {
        const cLoader = Java.ClassFactory.get(loader)
        Logger.debug(loader)
        Logger.debug(cLoader.toString())
        
        try {
            cLoader.choose(className, {
                onMatch(instance) {
                    return callbacks.onMatch(instance)
                },
                onComplete() {
                    callbacks.onComplete()
                }
            })
        } catch (e: any) {
            if (!e.toString().includes("java.lang.ClassNotFoundException"))
                Logger.error(e.toString())
        }
    })
}

When running, I'm receiving an error message -

TypeError: cannot read property 'iterateOverInstancesOfClass' of null
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