Skip to content

diep.io now checks if some functions have been proxied #77

@Cazka

Description

@Cazka

the game uses toString to check if a function is proxied.

It seems that the the string representation of a proxied function is hardcoded here:
https://chromium.googlesource.com/v8/v8.git/+/f7d7b5c6a4a55baa8984525fba6d0d5e1355b3b0%5E%21/#F0

patch for the toString method that works:

Function.prototype.toString = new Proxy(Function.prototype.toString, {
    apply(target, thisArg, args) {
        const result = Reflect.apply(target, thisArg, args);

        if(result === `function () { [native code] }` && thisArg.name?.length > 0) {
            return `function ${thisArg.name}() { [native code] }`
        }

        return result;
    }
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions