r/ZedEditor • • 13d ago

I managed to inject interactive GPUI components into a compiled Rust app using Frida

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

31 Upvotes

4 comments sorted by

1

u/2_BL 13d ago

Does this mean we could technically inject custom wallpapers for zed? 🤔

1

u/Kurimanju-dot-dev 13d ago

Probably, but I need to check if I can insert images

3

u/MikaylaAtZed 13d ago

yoooooo! Thats so cool! I was a little disheartened by the inability to hack stuff into GPUI applications as easily. So glad to see projects like this are still viable.

Just don’t break any TOS! Only use this for good :)

1

u/Repulsive_Battle248 13d ago

Discord kernel level anticheat before gta 6