Coder Social home page Coder Social logo

razer-ctl's Introduction

Razer Blade control utility

For those of you who

  • own a Razer Blade 16 2023 or Razor Blade 14 2023
  • use Windows 11
  • Razer Synapse 3 (including the Beta) makes your eyes bleed
  • baffled by why your fans are always at full-throttle
  • and the battery depletes in just an hour

I have great news. I've reverse-engineered the Razer protocol and have crafted an alternative solution. A drop-in predictable and compact Razer Synapse alternative.

What can it control?

  • Performance modes (including overclock)
  • Lid logo modes: off, static, breathing
  • Keyboard brightness (works on Windows with Fn keys anyway)

Reverse Engineering

Read about the reverse engineering process for Razer Blade 16 in data/README.md. You can follow the steps and adjust the utility for other Razer laptops.

Run razer-cli enumerate to get PID. Then razer-cli -p 0xPID info to check if the application works for your Razer device.

Special thanks to

FAQ

Q: How to build?

A: I build in WSL2(Arch) with cargo run --release --target x86_64-pc-windows-gnu --bin razer-tray.

Q: Does it work on Linux?

A: I didn't test, but nothing prevents it, all libraries are cross-platform.

Q: Why Windows Defender tells me it is a Trojan

A: Read rust-lang/rust#88297, and make sure recent Intelligence Updates are installed for Microsoft Defender.

Q: What's the easiest way to try?

A: Download razer-tray.exe from Releases and launch it.

razer-ctl's People

Contributors

tdakhran avatar jacobgelling avatar

Stargazers

Dragofagnir avatar Steven Kessler avatar Manab Shrestha avatar KMPLSV avatar  avatar  avatar  avatar  avatar skye avatar Bartosz Cichecki avatar  avatar Sam Pollard avatar 4rtz1z avatar  avatar

Watchers

 avatar  avatar  avatar

razer-ctl's Issues

Norton 360 discovered Trojan.Gen.MBT in razer-tray.exe

Below I am pasting report from Norton.

Filename: razer-tray.exe
Threat name: Trojan.Gen.MBT
Full Path: C:\Users\Marcin\Downloads\razer-tray.exe

On computers as of
23.04.2024 at 11:02:12

Last Used
23.04.2024 at 11:04:13

Startup Item
No
Launched
No
Threat type: Virus. Programs that infect other programs, files, or areas of a computer by inserting themselves or attaching themselves to that medium.

razer-tray.exe
Threat name: Trojan.Gen.MBT
Locate

Very Few Users
Fewer than 5 users in the Norton Community have used this file.

Very New
This file was released less than 1 week ago.

High
This file risk is high.

https://objects.githubusercontent.com/github-production-release-asset-2e65be/763630838/59e08e68-1131-4379-aabf-e2edfe933ecb?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAVCODYLSA53PQK4ZA/20240421/us-east-1/s3/aws4_request&X-Amz-Date=20240421T121246Z&X-Amz-Expires=300&X-Amz-Signature=ae4e7e261be6a88edd9c866f1454d5e77a83f63ff13d41dc919729d9b61ca826&X-Amz-SignedHeaders=host&actor_id=73128255&key_id=0&repo_id=763630838&response-content-disposition=attachment; filename=razer-tray.exe&response-content-type=application/octet-stream
Downloaded File from githubusercontent.com
Source: External Media

razer-tray.exe

File Actions

File: C:\Users\Marcin\Downloads\razer-tray.exe Removed

File: c:\Users\Marcin\AppData\Local\Temp\razer-tray.logThreat Removed

File Thumbprint - SHA:
13d9221eb6d3feb2f6c272b5cc409956aba60bfc9ce9c1d478a71eaa090d6938
File Thumbprint - MD5:
e54987141d83881a780d789364b85c70

Support for Razer BlackWidow Elite Keyboard

Hello,

Would it be possible to include support for Razer BlackWidow Elite keyboard?
Thanks a lot!

C:\Users\Marcin\Downloads>razer-cli.exe enumerate
RazerDevice { vid: 0x1532, pid: 0x0228, manufacturer: Razer, product: Razer BlackWidow Elite }
RazerDevice { vid: 0x1532, pid: 0x0228, manufacturer: Razer, product: Razer BlackWidow Elite }
RazerDevice { vid: 0x1532, pid: 0x0228, manufacturer: Razer, product: Razer BlackWidow Elite }
RazerDevice { vid: 0x1532, pid: 0x0228, manufacturer: Razer, product: Razer BlackWidow Elite }
RazerDevice { vid: 0x1532, pid: 0x0306, manufacturer: , product: }
RazerDevice { vid: 0x1532, pid: 0x0306, manufacturer: , product: }
RazerDevice { vid: 0x1532, pid: 0x0228, manufacturer: Razer, product: Razer BlackWidow Elite }
RazerDevice { vid: 0x1532, pid: 0x0228, manufacturer: Razer, product: Razer BlackWidow Elite }
RazerDevice { vid: 0x1532, pid: 0x0228, manufacturer: Razer, product: Razer BlackWidow Elite }
RazerDevice { vid: 0x1532, pid: 0x0228, manufacturer: , product: }

C:\Users\Marcin\Downloads>
C:\Users\Marcin\Downloads>razer-cli.exe backlight 100
Error: hidapi error: No HID devices with requested VID/PID found in the system.
C:\Users\Marcin\Downloads>razer-cli.exe -p 0x0228 info
Error: hidapi error: HidD_SetFeature: (0x00000001) Incorrect function.

C:\Users\Marcin\Downloads>

Kind regards,
Marcin.

Clarify README, add support for Razer Blade 14 2022

Thanks for doing this. I had a few more packages to install on WSL Ubuntu 22.04.

First, install rustup. Then,

sudo apt install libudev-dev libxdo-dev gcc-mingw-w64
rustup target add x86_64-pc-windows-gnu

Then build as usual. Compiled versions are kept in target/x86_64-pc-windows-gnu/release/.

(This info was valuable to me, who's never used Rust before)

Testing on a Razer Blade 14 2022, 3070Ti, mercury, PID 0x028c I get the following:

PS > .\razer-cli.exe enumerate
RazerDevice { vid: 0x1532, pid: 0x028c, manufacturer: Razer, product: Razer Blade }
RazerDevice { vid: 0x1532, pid: 0x028c, manufacturer: Razer, product: Razer Blade }
RazerDevice { vid: 0x1532, pid: 0x028c, manufacturer: Razer, product: Razer Blade }
RazerDevice { vid: 0x1532, pid: 0x028c, manufacturer: Razer, product: Razer Blade }
RazerDevice { vid: 0x1532, pid: 0x028c, manufacturer: Razer, product: Razer Blade }
RazerDevice { vid: 0x1532, pid: 0x028c, manufacturer: Razer, product: Razer Blade }
RazerDevice { vid: 0x1532, pid: 0x028c, manufacturer: , product:  }
RazerDevice { vid: 0x1532, pid: 0x028c, manufacturer: Razer, product: Razer Blade }
PS > .\razer-cli.exe -p 0x028c info
Error: hidapi error: HidD_SetFeature: (0x00000001) Incorrect function.

At some point I'll get around to installing wireshark and checking the output of the USB, but making this issue for now for other Razer blade 14 2022 owners.

Support for 2024 Blade 14

Love my laptop but want to ditch the horrible Synapse. My laptop is not supported by your great work....
Here is the output of enumerate ; "RazerDevice { vid: 0x1532, pid: 0x02b6, manufacturer: Razer, product: Razer Blade }"

Thank you!

Support for Blade 2019 (i7 8750H, 2080MQ)

Enumerate output:
PS C:\Users\v_opo\Downloads> .\razer-cli.exe enumerate
RazerDevice { vid: 0x1532, pid: 0x023a, manufacturer: Razer, product: Razer Blade }
RazerDevice { vid: 0x1532, pid: 0x023a, manufacturer: Razer, product: Razer Blade }
RazerDevice { vid: 0x1532, pid: 0x023a, manufacturer: Razer, product: Razer Blade }
RazerDevice { vid: 0x1532, pid: 0x023a, manufacturer: Razer, product: Razer Blade }
RazerDevice { vid: 0x1532, pid: 0x023a, manufacturer: Razer, product: Razer Blade }
RazerDevice { vid: 0x1532, pid: 0x023a, manufacturer: Razer, product: Razer Blade }
RazerDevice { vid: 0x1532, pid: 0x023a, manufacturer: , product: }
RazerDevice { vid: 0x1532, pid: 0x023a, manufacturer: Razer, product: Razer Blade }

Info output:
PS C:\Users\v_opo\Downloads> .\razer-cli.exe -p 0x023a info
Error: hidapi error: HidD_SetFeature: (0x00000001) Incorrect function.

Add basic CI functionality

Check that the following work

  • cargo build --release for Linux
  • cargo build --release --target x86_64-pc-windows-gnu for Windows

Support for Razer Blade 15" - 2019 Advanced

Device/Specs:

RZ09-03017E01
i7-9750H
RTX 2070 Max-Q
Windows 11 24H2 (IoT Enterprise LTSC) (26100.712)
PID: 0x0245

Found this project after considering having a go at my own, Synapse is sh*t so kind of need an alternative.

I've been able to get razer-cli enumerate to show the RazerDevice instances, and with manually specifying, or compiling librazer with the PID for my laptop, I can get every function working as far as I know (Fan Control, Performance Modes, Logo Control, Keyboard Backlight).

However trying to run razer-cli info ends up spitting out a Error: Command not supported or Error: Command failed with unknown status: 01, which are the same errors returned by attempting to use functions that don't exist on my model (Battery Care) (There may be more but I'm not sure).

razer-cli itself works (excl info), and I expect razer-tray may be failing due to not getting a valid response from an info check?

Any help on getting this SKU supported would be appreciated, thanks for all your work so far :)

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.