BadUSB制作基础(基于Teensy++2.0)

我这里用的Teensy++2.0的板子,因为看上了它的特点:Windows免驱动,某宝上有卖

首先搭开发环境:
windows7_64_专业版

ARDUINO 1.8.12
https://www.arduino.cc/en/main/OldSoftwareReleases

Teensyduino Version 1.53
https://www.pjrc.com/teensy/td_download.html

先装的 ARDUINO 再装 Teensyduino

安装完成后在工具栏里选择对应的板,以及usb type
在这里插入图片描述
然后插入Teensy++2.0的板子,在ARDUINO IDE里写入

#include "Keyboard.h"

/* Init function */
void setup()
{
// Begining the Keyboard stream
Keyboard.begin();

// Wait 500ms
delay(500);
delay(3000);

Keyboard.press(KEY_LEFT_GUI);
Keyboard.press('r');
Keyboard.releaseAll();
  
delay(500);
Keyboard.print("cmd");
delay(1000);
Keyboard.press(KEY_RETURN);
delay(50);
Keyboard.release(KEY_RETURN);

delay(1000);
Keyboard.print("echo Hello,Teensy++2.0!");
Keyboard.press(KEY_RETURN);
delay(50);
Keyboard.release(KEY_RETURN);
delay(700);
Keyboard.press(KEY_LEFT_ALT);
Keyboard.press(KEY_F4);
Keyboard.releaseAll();
// Ending stream
Keyboard.end();
}
  /* Unused endless loop */
void loop() {}

然后点击上传/编译
在这里插入图片描述
When the compile finishes, Arduino will tell you the final size. The Teensy Loader will also automatically update with the sketch name, and Auto mode will activate.

在这里插入图片描述
这时可能会提示摁一下Teensy上边的按钮进入可编程模式
在这里插入图片描述
也就是这里
在这里插入图片描述

摁一下之后窗口会有反应,reboot之后就写入完成了,并且自动运行。
The Teensy Loader will program your sketch and run it automatically.
在这里插入图片描述
这是我机器上的案例
在这里插入图片描述

关于Teensy++2.0基本用法这里有详细的说明:
https://www.pjrc.com/teensy/td_usage.html

然后关于上面IDE的键盘输入代码以及所用的API都在这里有详细的说明:
https://www.pjrc.com/teensy/td_keyboard.html

Teensy++2.0除了有键盘按键输入,还有鼠标、MIDI、Flight Sim、Joystick、Serial等其他功能,详细用法在这:
https://www.pjrc.com/teensy/teensyduino.html

至于怎么玩就看师傅的想象力了

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值