Hey my fellow Rustaceans! I've been experimenting with externally injected UI elements in GPUI and today I got my first promising results!
I'm not an expert when it comes to Rust or reverse engineering, but I'm doing this to hopefully find out if and how the soon-to-come GPUI discord client can be modded like vencord did it. Unfortunately I don't have access to the new client, so I'm experimenting with other programs, such as Zed.
Using Frida on macOS ARM64, I hook a specific Div::child<T> call during rendering and use an ARM64 bridge to call Zed’s own compiled GPUI constructors. This lets me append new elements directly into the existing UI tree, without modifying Zed’s source code.
So far I’ve managed to:
* Inject native GPUI containers, text, and buttons.
* Handle button clicks through GPUI’s own event system.
* Update UI state and preserve it across rerenders and resizing.
* Modify existing UI text, ordering, and application behavior through separate hooks.
It’s still very build-specific because of Rust’s unstable ABI, compiler optimizations, and internal memory layouts.
I’m calling the project Traitcord. The long-term goal is a Vencord-like modding framework for the native discord client, potentially with WebAssembly plugins in the future.
I’d love feedback or contributions from anyone familiar with GPUI, Frida, Rust internals, or reverse engineering! This whole approach is suuuuper janky and incredibly unsafe, so I'm really hoping someone will eventually find a better approach.
PoC + technical details: https://github.com/traitcord/traitcord-poc