Today, I’ll share a method to spoof your Arduino to act like a real mouse. Let’s get started!
- USB Device Tree Viewer: Download from here.
- Arduino Board Modification: Follow the steps or use this Python script to automate the process.
Important: Make these changes on a PC without Valorant installed. Fully reset Windows afterward to remove any traces left by drivers or files.
- Use this website to find details about your mouse. Enter your VID and PID.
- For example, if you have a Logitech mouse, copy "Logitech, Inc."
-
Go to your
boards.txt
file and add the following lines at the end:leonardo.build.core=arduino leonardo.build.variant=leonardo leonardo.build.extra_flags={build.usb_flags} leonardo.build.usb_manufacturer="Logitech, Inc."
-
Save and re-upload your script.
-
Navigate to:
C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino
-
Open
USBcore.cpp
with Notepad++ and go to line 44. Update it to match your mouse’s VID and manufacturer:// Example update
-
In
USBcore.cpp
at line 71, update it if your mouse has specific serial values:0xEF = Device class 0x02 = Device subclass 0x01 = Device protocol 0x100 = Version number (bcdDevice) Iserial = serial number
-
Open
USBcore.h
at line 101 and modify the power consumption to match your real mouse:// Example adjustment
So your pc turning on routine will be like this
Connect adapter to Arduino => power on the adapter => wait 10 seconds => connect Arduino via USB to pc => turn on your pc but keep both the usb and adapter connected all the time => you're good to go but to trigger the bootloader you will have to use the button on Arduino```
- If distributing, send a hex file instead of the sketch file for security.
- Use a hash changer for your .exe to enhance security.
- Brain
- Arduino Leonardo
- USB Host Shield
- Notepad++
- Backup system restore
-
Backup Your System: Create a system restore point.
-
Open
USBCore.cpp
in Notepad++: Navigate to:C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino
-
Modify
ClassInterfaceRequest
:-
Around line 373, comment out the
CDC_ACM_INTERFACE
check:// if (CDC_ACM_INTERFACE == i) // return CDC_Setup(setup);
-
-
Modify
SendInterfaces
:-
Around line 65, comment out the
CDC_GetInterface
line:// CDC_GetInterface(&interfaces);
-
-
Save Changes: Save
USBCore.cpp
. -
Update
boards.txt
:-
Add the following line at the end of the section for the Leonardo board:
leonardo.build.extra_flags={build.usb_flags} -DCDC_DISABLED
-
-
Configure Arduino IDE:
- Open Arduino IDE (version 1.8.9).
- Go to
File
>Preferences
. - Check "Show verbose output during: compilation" and "upload".
-
Upload .hex File:
-
Place the necessary library file in:
C:\Program Files (x86)\Arduino\hardware\tools\avr\bin
-
Open Command Prompt as administrator and run:
cd C:\Program Files (x86)\Arduino\hardware\tools\avr\bin
-
Select and upload the .hex file. If you see "avrdude.exe done. thank you.", everything went smoothly.
-
If you have any questions, feel free to ask. I can also show you how to use HID and fully turn off your COM port. Have a great day!