BadUSB
この時、BadUSBとしては使わないって書いたけど、やっぱりやってみたくなったのでやってみる。
お品書き
Keyboard.h
#include <Keyboard.h>
void setup() {
Keyboard.begin();
delay(1000);
Keyboard.press(131);
delay(1000);
Keyboard.print("r");
delay(100);
Keyboard.releaseAll();
delay(1000);
Keyboard.print("notepad");
Keyboard.press(KEY_RETURN);
delay(10);
Keyboard.releaseAll();
delay(1000);
Keyboard.print("This message was written by BadUSB !");
delay(5000);
Keyboard.press(KEY_LEFT_CTRL);
Keyboard.press("a");
delay(10);
Keyboard.releaseAll();
Keyboard.press(KEY_DELETE);
Keyboard.press(KEY_LEFT_ALT);
Keyboard.press(KEY_F4);
delay(10);
Keyboard.releaseAll();
delay(1000);
Keyboard.press("n");
delay(10);
Keyboard.releaseAll();
Keyboard.end();
}
void loop() {
// put your main code here, to run repeatedly:
}
win+Rが上手く動かなかったので、printに変えてる。メモ帳閉じる時ダイアログが出るのでnで閉じてる。を追加してる。
動かしてみる
モアレ出まくりで見づらいけど、めっちゃ動くー。USBにぶっ挿すだけでこれだけできんだもんな。すごいなぁ。
参考

How To Make DIY Keyboard With ATMEGA32U4 Dev Board |From ICStation.com
How to use Beetle USB ATMEGA32U4 development board as USB keyboard.Edit: Sorry for those watching with smaller displays....
https://www.arduino.cc/reference/en/language/functions/usb/keyboard/
コメント