GithubHelp home page GithubHelp logo

Comments (12)

dokutan avatar dokutan commented on August 28, 2024 2

A few links about the process copied from a previous issue:
https://bytepunk.wordpress.com/2017/03/25/reverse-engineering-a-usb-mouse/
https://github.com/pez2001/razer_chroma_drivers/wiki/Reverse-Engineering-USB-Protocol
https://github.com/dokutan/rgb_keyboard/tree/master/doc (from my other usb reverse engineering project)

The idea is to capture:

  • the data sent when changing each (unsupported) button on its own to a known value, e.g. a specific keyboard key. It would additionally be helpful if you could attach a screenshot or list of what all buttons do for each capture.
  • the data sent when opening the official sofware after closing it completely from the task manager

from mouse_m908.

dokutan avatar dokutan commented on August 28, 2024 1

Thanks for the report, this is indeed an alternative code for the fire button, i have added support in 40eef1c.

Please note that if you are interested in configuring all buttons of the mouse and reading the configuration of the remaining buttons, you would need to capture the USB communication from the official software with wireshark to allow me to implement these features.

from mouse_m908.

grafov avatar grafov commented on August 28, 2024

Thank you for the reply! It would be great to get the fully working configuration support on Linux. I have already installed official software to the Windows machine, I'll install Wireshark too. Could you provide the instructions that exactly I need to capture?

from mouse_m908.

REmerald avatar REmerald commented on August 28, 2024

Hi, I setted up the reverse engineering environment in windows pe, installed the official software, wireshark, setted up the filter (usb.bus_id == 1 && usb.device_address == 2 && usb.src == "host"), etc.
When I change the mouse settings in the software, I get the entries/frames in wireshark with the hex values, how to "understand" them?
When I change the settings that apply immideately, I get 6 entries in wireshark. I noticed that the 2nd one contains the hex of the color I set. This is the only thing I understood.
But some settings don't apply immideately and need clicking the "apply" button to actually apply, so when I click the button, it applies all the settings and I get around 175 entries in wireshark. This makes me feel completely lost.
So what should I do with the output?
I can send it here. Here is the output of launching and quiting from the official software (only launching prodused any output). It contains output from the other devices, so don't forget to apply the filter above, when you'll read it.
m990-rgb--bus-1--addr-2_software-launch-quit.pcapng.gz

from mouse_m908.

REmerald avatar REmerald commented on August 28, 2024

Btw, here is the output of changing the mode/profile by the software (instead of by the special button on the mouse):
m990-rgb-mode1
m990-rgb-mode2
m990-rgb--bus-1--addr-2_mode1-to-mode2.pcapng.gz
m990-rgb--bus-1--addr-2_mode2-to-mode1.pcapng.gz
Applies immediately right after selecting the mode from the combobox.
Maybe this would be a cool feaure to implement.

from mouse_m908.

REmerald avatar REmerald commented on August 28, 2024

Anyways, since only setting buttons >12 doesn't work (if I read everything correctly), I'll send screens only of the keybindings settings and leave other settings default (except few ones I already changed):

m990-rgb-mode1__13
m990-rgb-mode1__14
m990-rgb-mode1__15
m990-rgb-mode1__16
m990-rgb-mode2__13
m990-rgb-mode2__14
m990-rgb-mode2__15
m990-rgb-mode2__16
m990-rgb-mode3__13
m990-rgb-mode3__14
m990-rgb-mode3__15
m990-rgb-mode3__16
m990-rgb-mode4__13
m990-rgb-mode4__14
m990-rgb-mode4__15
m990-rgb-mode4__16
m990-rgb-mode5__13
m990-rgb-mode5__14
m990-rgb-mode5__15
m990-rgb-mode5__16
m990-rgb--bus-1--addr-2_apply-all-button.pcapng.gz
Hope all this will help.

from mouse_m908.

dokutan avatar dokutan commented on August 28, 2024

When I change the mouse settings in the software, I get the entries/frames in wireshark with the hex values, how to "understand" them?

Understanding them means which bytes need to be set (and to what values, for speeds etc.) for each setting. e.g. which bytes represent the LED color.

But some settings don't apply immideately and need clicking the "apply" button to actually apply, so when I click the button, it applies all the settings and I get around 175 entries in wireshark. This makes me feel completely lost.
So what should I do with the output?

I find it helpful to only change one setting at a time, then export the captured packets as json. This allows you to narrow down the changed bytes using tools like grep and diff. You can see that a lot of packets are sent each time the settings are changed in https://github.com/dokutan/mouse_m908/blob/master/include/m990chroma/data.cpp, but only a few bytes are set to different values in https://github.com/dokutan/mouse_m908/blob/master/include/m990chroma/writers.cpp. If you don't want to do that, just send me your captured data.

Maybe this would be a cool feaure to implement.

This should alread work using the -p option, please let me know if that is not the case.

I will have a look at remapping buttons 13-16 (Edit: for now the captured data seems sufficient, i will let you know if i anything else is required). It would be extremely helpful if you could confirm which other features of mouse_m908 work or don't work for the M990 Chroma.

from mouse_m908.

dokutan avatar dokutan commented on August 28, 2024

@REmerald Which and how many front buttons can be customized?

from mouse_m908.

REmerald avatar REmerald commented on August 28, 2024

Reading the settings from the mouse seems alright, except the macros section (and >12 buttons ofc):

# Macros

;## macro8
;# unknown, please report as bug: ff ff 0

I didn't make any macros in the official software as I remember. Here's an ini file and a dump in case you might need it:
m990rgb_remerald.ini.txt
m990rgb_remerald.dump.txt
PS: the -p feature works

from mouse_m908.

REmerald avatar REmerald commented on August 28, 2024

I modified the ini file
m990rgb_myconf.ini.txt
and it completely messed up my mouse settings: the only thing that worked is setting the rgb color and (maybe) brightness in mode 1. The dpi became the same on all modes: mid-high on X and very low on Y. 1-12 buttons didn't change, 13 became ledmodeswitch on all modes except 1, 14 became change mode on all profiles. 15 and 16 didn't change. The lowest button on the top of the mouse became dpicycle (or dpi+?) on all modes except 1.
Maybe that's because I added button_13 in the ini file.
Then I read the settings again:
m990rgb_messedup.ini.txt
m990rgb_messedup.dump.txt

from mouse_m908.

REmerald avatar REmerald commented on August 28, 2024

Here's the version I used:

 remorin@archsys@pts/2 ~ $ sudo mouse_m908 -v                                                                          4:03PM | Wed, Jun 22
Version: 3.3
 remorin@archsys@pts/2 ~ $ paru -Sii mouse_m908                                                                        4:05PM | Wed, Jun 22
Repository      : aur
Name            : mouse_m908
Version         : 3.3-1
Description     : Control Redragon gaming mice from Linux, BSD and Haiku
URL             : https://github.com/dokutan/mouse_m908
AUR URL         : https://aur.archlinux.org/packages/mouse_m908
Groups          : None
Licenses        : GPL3
Provides        : mouse_m908
Depends On      : libusb  gcc-libs
Make Deps       : make
Check Deps      : None
Optional Deps   : None
Conflicts With  : None
Maintainer      : dokutan
Votes           : 3
Popularity      : 0.034016
First Submitted : Tue, 03 Aug 2021 16:49:03 +0000
Last Modified   : Sat, 22 Jan 2022 01:36:31 +0000
Out Of Date     : No
ID              : 1023172
Package Base ID : 169560
Keywords        : None
Snapshot URL    : https://aur.archlinux.org/cgit/aur.git/snapshot/mouse_m908.tar.gz

 remorin@archsys@pts/3 ~ $ paru -Qii mouse_m908                                                                        7:10PM | Wed, Jun 22
Name            : mouse_m908
Version         : 3.3-1
Description     : Control Redragon gaming mice from Linux, BSD and Haiku
Architecture    : x86_64
URL             : https://github.com/dokutan/mouse_m908
Licenses        : GPL3
Groups          : None
Provides        : mouse_m908
Depends On      : libusb  gcc-libs
Optional Deps   : None
Required By     : None
Optional For    : None
Conflicts With  : None
Replaces        : None
Installed Size  : 1054.44 KiB
Packager        : Unknown Packager
Build Date      : Mon 20 Jun 2022 04:07:18 PM MSK
Install Date    : Mon 20 Jun 2022 04:09:26 PM MSK
Install Reason  : Explicitly installed
Install Script  : No
Validated By    : None
Backup Files    :
(none)

from mouse_m908.

dokutan avatar dokutan commented on August 28, 2024

@REmerald For testing purposes, building the current git version is required (the reported version is still 3.3):

git clone https://github.com/dokutan/mouse_m908 && cd mouse_m908
# or
git pull

make clean
make
sudo make install

I updated setting the button mapping in commit 0f510f3.

from mouse_m908.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.