Hooking Color Change

Discussion in 'Razer Chroma' started by bobng, Jul 28, 2016.

Thread Status:
Not open for further replies.
  1. Izuzusama

    Izuzusama New Member

    Is there any way to hook an app that is changing the color of any of the Chroma device?

    Example:
    Current:
    App1 -> SDK -> Synapse

    Want to:
    App1 -> SDK -> (Hooked) -> Synapse
    -> (Hooked) -> SDK -> Synapse

    The aim is to change the color preset by the app / game
     
  2. njbmartin

    njbmartin Developer of Awesome

    Can you explain a little more as to the use case?
     
    Vaypron likes this.
  3. I think he is talking about getting information of which keys with which color for example overwatch while its running is setting to the keyboard.
    The default WASD keys color may be blue, but he does want to change it to red or something.

    Since the nature of the Chroma SDK its definitely not possible to address chroma devices simultaneously from many different applications at the same time.
    Means, for my understanding there is no other way then the following.

    You could try to create a proxy dll. (Don't know anything about the legals here, so maybe reach out to @Razer|Rfx for that).

    The goal here is to create a library, that looks and beheaves exactly as the original one.
    Any method, any variables and any classes and so on are the same.
    Every application using the Chroma SDK will load the RzChromaSDK.dll from System folder to use it. So you will create a dll that will be loaded instead, move the original one to an other directory and call the original methods from there.
    This means, any method call with their parameter will be accessible to you and you then just pass the same parameters to the same method contained in the original dll in the other directory.

    Just search for "Proxy DLL" on google to get some detailed explanations on how this works.
    This is one of the first results, which is for automatic creation of a proxy dll:
    http://www.codeproject.com/Articles/16541/Create-your-Proxy-DLLs-automatically

    The RzChromaSDK.dll / RzChromaSDK64.dll (which both are the ones, you want to proxy) are located either for 32-bit at C:\Windows\System32\ or for 64-bit at C:\Windows\SysWOW64\

    Edit:
    This will result in global changes. You need to consider creating something, which will detect the application you are trying to modify the lighting of.
     
    Last edited by a moderator: Aug 13, 2016
    bobng likes this.
  4. Izuzusama

    Izuzusama New Member

    Thats exactly right!

    It seems that using the SDK I cant even get the current color of the chroma device if the color is set by another application. Either is sandboxed or the SDK dont fetch the color from the devices only local variable. But thx for the info about proxy will look into it.
     
  5. Sharparam

    Sharparam Member

    Creating the proxy DLL in the directory of the game should be enough (next to the game executable). When loading libraries, it should be checking in the current directory first before going further into the PATH configured on the system. This is how unofficial "mods" for various game work, like DSFix for Dark Souls, which "injects" itself as a DirectX framework DLL.

    The SDK doesn't have any endpoints for reading current color period. You can only set colors with the SDK, not read them.
     
    BlackWorx likes this.
  6. njbmartin

    njbmartin Developer of Awesome

    It seems like @BlackWorx and @Sharparam are fairly confident in this method, the only concern would be whether the game would detect this as malicious.
     
  7. Sharparam

    Sharparam Member

    It would most likely violate the terms of whatever game is intercepted, and possibly Razer's ToS as well?

    As far as detection, it would probably be difficult to detect from the game side, since the modification is done to a third party library (from the game's point of view).

    Looking at history, most developers/publishers don't seem to care much if people use this method to modify things, as long as it's client-side only and doesn't provide an advantage (if it's a multiplayer game). A common example is dumping DLLs into games to customize shaders.
     
    BlackWorx and Vaypron like this.
  8. What if the Application uses Colore?
     
  9. Sharparam

    Sharparam Member

    Colore would be using the same load path as the game, so it would also be loading the modified SDK DLL.
     
  10. Izuzusama

    Izuzusama New Member

    Since Colore is open source you can just directly modify and build
     
Thread Status:
Not open for further replies.
Sign In with Razer ID >


Don't have a Razer ID yet?
Get Razer ID >