genebrawl-public: Gene Brawl: The TypeScript Control Layer That Rewrites a Mobile Game in Memory

A Frida-powered mod for Brawl Stars that hooks native functions, patches behavior at runtime, and uses a high-level runtime to manage a low-level client.

10 min read • View on GitHub • More from RomashkaTea

A wide editorial scene shows a mobile game client as a mechanical stage being controlled from outside by a scripted hand. Thin probes enter the client shell, while the internal gears of the game loop, UI panels, and memory blocks stay visible beneath the surface. It explains the article’s core idea: the client is not replaced, it is steered in place at runtime.
Gene Brawl treats a native game client like a programmable host, not a file to patch.
Key Takeaways

A game mod that behaves like a software platform

Most game mods start by changing files on disk. Gene Brawl starts by changing the terms of execution. It attaches to the Brawl Stars client in memory, hooks native functions, and routes behavior through a TypeScript runtime that can coordinate features without rebuilding the app.

That makes the project feel less like a cheat and more like a control plane. The client is still the client, but its inputs, state transitions, and UI updates can be intercepted and redirected while the game keeps running.

A close-up cross section shows a hand-drawn control console splitting one native game client into layered subsystems. On one side are memory pointers and offset markers. On the other side are modular feature blocks for chat commands, UI popups, and config updates, all fed by the same runtime spine. It explains how one hook can coordinate many features.
The project’s power comes from orchestration, not from any single feature toggle.

Why Frida changes the shape of the problem

Frida matters because it lets the mod intervene where the app is actually behaving: in memory, in native calls, and in the game loop. That is a different problem from editing assets or swapping a binary. Instead of freezing the client into a fixed altered state, Gene Brawl can inspect and steer behavior while execution is still live.

One frame callback becomes a control surface for state, UI, and feature orchestration.

That architecture also explains why the repo feels so intentional. It is not trying to win by brute force. It is trying to sit inside the client’s normal rhythm and make each frame do useful work.

Frida hook -> read game state -> update feature modules -> patch UI -> return control

Android offsets  ─┐
                  ├──> shared TypeScript feature layer
iOS offsets      ─┘

The orchestrator lives in `src/index.ts`

The entry point behaves like a switchboard. It wires together patch managers, extends core prototypes, and bridges the gap between JavaScript objects and the game’s native memory formats. That bridge matters because most of the hard work is not in calling hooks. It is in making native data feel safe enough to manipulate from a higher-level language.

The repo’s use of TypeScript is not decorative. It makes the control layer legible, and legibility is what keeps a memory-heavy codebase from collapsing into one-off hacks.

// Conceptual shape of the orchestrator
patchManagers.forEach(manager => manager.patch())

String.prototype.fromSC = function () {
  return convertSupercellString(this)
}

NativePointer.prototype.scptr = function () {
  return wrapNativePointer(this)
}

The real engine is the frame hook

The project’s heartbeat is the frame callback in `GameMain_draw`. That is where the mod stops being a set of scattered features and becomes a system. Each frame gives it a chance to read state, refresh UI, process commands, and keep the rest of the runtime synchronized with what the client is doing.

This is the most important mental model in the repo. A frame hook is not just an interception point. It is a clock. Once you have a clock, you can coordinate everything around it.

A practical side effect follows from that design. Features no longer need to wait for user actions or background timers. They can react on the same cadence as the game itself.

TypeScript as the safety rail over memory

Raw pointers are unforgiving. TypeScript does not make them safe, but it does make them easier to reason about. In Gene Brawl, types help describe game structures, pointer wrappers, config objects, and feature modules in a way that keeps the reverse engineering work from becoming unreadable.

Traditional low-level moddingGene Brawl’s TypeScript layer
Ad hoc pointer math scattered across hooksTyped wrappers and shared helpers around native memory
Features wired directly into one-off patchesModules coordinated through a patch manager
State hidden inside callback chainsExplicit config and runtime models
Hard to extend without breaking internalsStructured enough to add features without rewriting the core

That is the real engineering trade-off here. The repo still lives close to the metal, but the language choice gives the author enough structure to keep the system extensible.

interface FeatureState {
  enabled: boolean
  lastFrameSeen: number
}

class FrameCoordinator {
  tick(state: FeatureState) {
    if (!state.enabled) return
    syncUI()
    processCommands()
    refreshMemoryViews()
  }
}

The mod is a feature platform, not a single cheat

The feature list is broad: configuration, chat commands, debug UI, skin logic, latency handling, and game-state helpers. On the surface that can look like a pile of toggles. Read as architecture, it looks different. The repo is built to host behavior, not just deliver one exploit.

Single-purpose cheatGene Brawl
One effect, one hookMany features behind a shared runtime
Hard-coded behaviorConfigurable modules and command paths
Manual activationRuntime control through UI and chat
Static and brittleFrame-driven and state-aware

That modularity is what makes the repo more interesting than a feature dump. Each feature is less important than the pattern that lets features coexist.

The hidden layer: obfuscation, encrypted settings, and anti-tamper pressure

The presence of obfuscation and encrypted settings tells you the code was written with scrutiny in mind. Whatever else the repository is, it is not naive about the environment it lives in. The architecture assumes that static inspection, tampering, and defensive countermeasures are part of the reality.

That does not make the project mysterious. It makes it honest about its threat model. If your system lives inside a commercial game client, concealment becomes part of the engineering surface.


What this repo is really teaching

Gene Brawl’s lesson is bigger than the game it targets. It shows how a high-level language can sit above low-level hooks and turn an opaque native client into a programmable runtime. The architecture is the product. The features are just evidence that the architecture works.

That is why the repo stands out. It does not merely modify behavior. It reorganizes the problem so the behavior can be managed at all.