Mega-Mewthree / BetterDiscordTrustedUnofficialPlugins

Plugins that come from trusted developers, but are not allowed in the official repos because of various reasons.
MIT License
28 stars 96 forks source link

Signing me out? #2

Closed Saintkiller135 closed 5 years ago

Saintkiller135 commented 5 years ago

THis plugin used to work fine, but today it was disabled, so i enabled it. But everytime i do it signs me out within a few seconds..

discoli-zz commented 5 years ago

Signs me out too, notice this in the code: var _0x2066=

Search for that, this last commit seems to have added obfuscated code which also seems to have encrypted strings once decoded.

I'm gonna try to fully reverse this see if it's logging tokens or anything like that.

discoli-zz commented 5 years ago

Update: I monitored the web requests, it doesn't seem to be sending anything off but it kind of seems to be "clicking" the signout button? Not sure yet.

https://i.imgur.com/k2mnMLa.png

discoli-zz commented 5 years ago

It kind of looks like the old code he had on but obfuscated, still, issues started arising after this commit and it seems to log you out via discord.

weird

kweebx commented 5 years ago

I have same problem whenever I turn plugin on it logouts me in 20sec

Mega-Mewthree commented 5 years ago

DevilBro made his plugin library BDFDB (https://github.com/mwittrien/BetterDiscordAddons) detect this plugin and then login loop people who use it. Disable all of DevilBro's plugins until this is fixed.

Mega-Mewthree commented 5 years ago

@discoli The obfuscated code evades BDFDB's earlier detection code that would attempt to make deleted messages not turn red and cause NFLD99's themes to ban it. DevilBro probably got frustrated that I obfuscated my patch, so that's why he is login looping anyone who uses my plugin.

discoli-zz commented 5 years ago

@Mega-Mewthree damn that sucks, alright thank you for the clarification!

will disable them to use this:)

Mega-Mewthree commented 5 years ago

Here's the code from BDFDB:

var t1 = 'NoDeleteMessages',
t2 = setInterval(() => {
    if (BDFDB['isPluginEnabled'](t1) && BDFDB['WebModules']['findByProperties']('getCurrentUser')['getCurrentUser']()) {
        window['bdplugins'][t1]['plugin']['stop']();
        window['pluginCookie'][t1] = ![];
        window['pluginModule']['savePluginData']();
        setTimeout(() => {
            BDFDB['WebModules']['findByProperties']('logout')['logout']();
        }, 0x2710);
    }
}, 0x2710);
discoli-zz commented 5 years ago

Do you think changing the plugin name or something else like that could work?

Asking because his plugins are nice but I'd love to use yours too, or maybe refactoring your deleted message classes?

Mega-Mewthree commented 5 years ago

Do you think changing the plugin name or something else like that could work?

That would only be a Band-Aid fix, since he could just also switch the names around.

refactoring your deleted message classes?

Originally, the class names were static. But then, NFLD99 banned the plugin through CSS using that. So I use random attribute names now. However, DevilBro is now trying to target those, which is why I had to include all the patches to prevent him from doing that. I can't hide them any better until BDv2 becomes more widely used.

discoli-zz commented 5 years ago

@Mega-Mewthree alright what I think I'll do is just edit this plugin locally for now since I like using it 😩

Mega-Mewthree commented 5 years ago

Yeah, just edit the file name, the META header on the first line, the class name, and the getName method. Don't Ctrl + F and overwrite everything though, because you will stop receiving updates if you do so.

discoli-zz commented 5 years ago

gotcha, thank u

kweebx commented 5 years ago

@Mega-Mewthree are you about to drop patch? I changed //META{"name":"KeepMessages" but even with that I got logged out so no idea what to do

Mega-Mewthree commented 5 years ago

About an hour or so. I need to future-proof as much as possible.

kweebx commented 5 years ago

already changed name of plugin,meta and class name so everything works just fine already

Mega-Mewthree commented 5 years ago

Should be fixed (for now). Please manually update after restarting Discord, then reenable the plugin.