rev.ng logo
Back to Blog

Introducing rev.ng Studio: a decompiler for your agent

tl;dr Today we're releasing rev.ng Studio, our offline desktop decompiler that integrates with your agent (Claude Code, Codex, OpenCode or pi.dev) out of the box.
Download the free beta of rev.ng Studio.

Looking for a backdoor in fauxware, a small CTF login program. We open main with Ctrl+P, follow the call to authenticate, and ask Claude to annotate the decompiled C. The function comment appears in the editor while Claude is still working. We then return to the caller and rename a variable by hand.

Hello there again! Second blog post in less than a month, wow!

Today, we're here to introduce rev.ng Studio, our desktop decompiler UI built on top of rev.ng, our open source decompiler.

Before we go any further, note that rev.ng has recently received a lot of improvements, including prototypes for 600k well-known functions, fewer casts, fewer local variables, floating-point support and a much smaller memory footprint.
In case you missed it, we covered all of this in our previous blog post, What's new in the rev.ng decompiler.

Enough with the introduction. Let's get into it.

Welcome to the LLM reverse engineering era

You wouldn’t use an LLM as a compiler

As you might have noticed, things have been quite hectic in the computer security space over the last few months. LLMs have proven able to take over a lot of "intellectual grinding" tasks, and reading decompiled code is certainly one of them.

So we asked ourselves: what is a decompiler for, nowadays?
Here's our view:

  1. The agent leads.
    From now on, reverse engineering tasks are going to be led by an agent, not by a human through a decompiler's UI.
  2. Your decompiler does what it's good at.
    Producing C code from a binary and detecting data structures need to be scalable, deterministic and accurate. That's the decompiler's job: give the agent good decompiled code to read and reason about.
    You wouldn't use an LLM as a compiler, don't use one as a decompiler.
  3. You review results.
    You need a place to monitor progress, verify the results of the analysis carried out by the agent, draw conclusions and lead the analysis towards the next step.
    For this, a regular text editor is not enough: you need an interactive user interface.
  4. Let's use your agent.
    We suspect you're already paying for an agent subscription, maybe two.
    Why would we make you pay for a model we host when you are already using a frontier one? Bring your own agent, harness and model.

rev.ng Studio is built around these ideas. Its goal is not to take over your whole reverse engineering toolbox, but just to give the agent a solid starting point and provide you with a window into what it's doing.

Why should I use rev.ng with my agent over XYZ?

In the following sections, we'll go through some reasons why we think you should adopt rev.ng Studio. Here's an executive summary:

  1. Your project is a text file.
    Everything known about a binary lives in a documented, strictly verified YAML file that your agent can easily read and patch, and whose changes you can review as a diff.
  2. Valid C and well-known IR.
    Unlike most decompilers, we emit syntactically valid C code that you, or your agent, can feed to other static analysis tools.
    Also, we expose our internal representation, LLVM IR, the most popular compiler IR, on top of which you can use existing tools such as symbolic execution engines.
  3. One project, many clients.
    Agents, Python scripts and other humans using rev.ng Studio can all work on the same project at the same time, talking to a (possibly remote) daemon. Collaboration works out of the box.
  4. Its core is Free Software.
    rev.ng, the engine under the hood of rev.ng Studio, is open source.
    The rev.ng Studio beta is free to use. After the beta, rev.ng Studio will require a subscription.

Your project is a text file

To interact with a rev.ng project and make changes, your agent needs no MCP, plugins or anything like that. Just let your coding agent do what it has been trained for: edit text files.

In rev.ng, the model is the document that holds everything we know about a binary. It describes how the binary is loaded and records its functions, prototypes, types, names and comments.
The model is not an opaque database: it's a YAML file, revng.yml. Its schema and all its fields are documented in the reference, but we also have a gentler tutorial to get the gist of it.

Let's take the tiny add function from our model-from-scratch tutorial. To see how it's decompiled, request C with revng project artifact emit-c and render it with revng ptml.

revng project artifact emit-c 0x400000:Code_x86_64 | revng ptml
_ABI(SystemV_x86_64)
uint64_t
function_0x400000_Code_x86_64(uint64_t argument_0,
                              uint64_t argument_1) {
  return argument_0 + argument_1;
}

To give the function a name, add Name: Sum to its entry in revng.yml.

# Before
Functions:
- Entry: "0x400000:Code_x86_64"
Prototype:
Kind: DefinedType
Definition: "/TypeDefinitions/0-CABIFunctionDefinition"

Run the same revng project artifact command again and the decompiled function is now called Sum.

// Before
_ABI(SystemV_x86_64)
uint64_t
function_0x400000_Code_x86_64(uint64_t argument_0,
uint64_t argument_1) {
return argument_0 + argument_1;
}

A textual project file is good for you too: whatever the agent did to your project is a diff you can read and commit to a git repository.

When editing C is the better option

While a YAML project file is rather accessible, C is sometimes better suited to certain types of changes, or to batching together multiple changes to a function.
For this reason, we provide ways to make changes by "editing" (annotating) the decompiled C code, something coding agents are very proficient at.

Here, the agent adds // RENAME: value and // RETYPE: int64_t above the declaration of var_0, then adds a plain comment above the if it describes. rev.ng records all three edits in the model with annotate-c-body.

// Original decompiled code
_ABI(SystemV_x86_64)
generic64_t resolve(generic64_t argument_0,
generic64_t argument_1) {


generic64_t var_0 = 0UL;

if (argument_0 != argument_1)
var_0 = raw(argument_0) ^ argument_0;
return var_0;
}

The same approach works for types too, including function prototypes and the struct describing the stack frame (i.e., stack variables). The agent edits the C declaration and imports it with edit-c-type.

Why valid C and well-known IR matter

rev.ng takes pride in emitting valid C. But why does this matter?
To explain, let's compile a demo program containing a use-after-free vulnerability.

int do_stuff(int condition) {
  int *p = malloc(sizeof(int));
  if (condition > 4) {
    my_free(p);
  }
  // Writes to freed memory if the branch was taken.
  *p = 3;
  // ...
  // Frees the same allocation again on that path.
  my_free(p);
  // ...
}

With the demo compiled as ./demo, we can export its recovered C, along with the necessary headers, using the emit-recompilable-archive artifact:

$ revng quick artifact emit-recompilable-archive ./demo -o recovered.tar
$ tar xvf recovered.tar
decompiled/functions.c
decompiled/types-and-globals.h
decompiled/helpers.h
decompiled/attributes.h
decompiled/primitive-types.h
decompiled/runtime-library.h

Let's feed this archive to Codex and ask it to check the C for vulnerabilities using at least two well-known static analysis tools of its choice.

Codex found the problem with GCC's -fanalyzer, Cppcheck and Clang Static Analyzer. Note that Codex autonomously decided to employ GCC's -fanalyzer and Cppcheck, whereas we usually run this demo with Clang Static Analyzer and CodeQL.

Other decompilers emit pseudocode, which is much more difficult to turn into valid C than one might think, making tasks like this significantly more complex and error-prone.

Beyond using static analysis tools for C, we also asked Claude to run symbolic execution on the LLVM IR that rev.ng produces: it used KLEE and found the same use-after-free. Check out the asciinema recording.

One project, many clients

You (CLI)
Your Python script
rev.ng daemon
rev.ng Studio
Your agent (Claude)

rev.ng can run as a headless daemon via revng project daemon. This daemon is long-running and can handle multiple clients. This enables real-time collaboration between users out of the box, but it also allows you to open your project in the UI, launch one or more agents to analyze the binary, write a Python script and, at the same time, interact with the project from the CLI.

We launch the daemon, attach rev.ng Studio to it, and ask Claude to rename compute and its argument. We attach the CLI to the same daemon and see the updated signature, sum_list with the argument head. Finally, we run a Python script against that daemon to read the argument name from the C AST.

Do I have to pay for it?

  1. rev.ng Studio is currently in free beta. Download it here.
  2. After the beta, rev.ng Studio will require a subscription.
  3. rev.ng, the open source project without a UI, is and will always be Free Software, and it's developed in the open on GitHub. If you don't need the UI, you don't need rev.ng Studio: get rev.ng from the binary distribution or build it from source.

Note that subscribers to the newsletter will get a discount! Subscribe to the newsletter now!
Also, we're always open to offering professional support for rev.ng: feel free to reach out to us.

Current status

rev.ng Studio is in beta: you will get crashes. When you do, please tell us on Discord or, better, open an issue on GitHub.

Here's our current platform support matrix:

  • Host: Linux x86-64 only, for now. We are working on macOS and Windows ports.
  • Architectures: x86/x86-64, ARM/AArch64, MIPS and s390x.
  • Binary formats: ELF (+DWARF), PE/COFF (+PDB/CodeView) and Mach-O.
  • Agents: Claude Code, Codex, OpenCode and pi.dev.

Try it and tell us how it goes

  1. Download rev.ng Studio.
  2. Load a binary and ask your agent something.
  3. Tell us what broke and what you'd like to see on Discord or open an issue on GitHub.
  4. Subscribe to the newsletter to get updates on the macOS and Windows ports and a subscriber discount.

That's all for today.

More from our blog

What's new in the rev.ng decompiler
Announcement

What's new in the rev.ng decompiler

Hello again! We haven't posted in a while, so it's high time we gave you some updates about the rev.ng decompiler.

tl;dr You should give it another try!

The rev.ng decompiler goes open source + start of the UI closed beta
Announcement

The rev.ng decompiler goes open source + start of the UI closed beta

In this blog post we announce the open sourcing of the rev.ng decompiler, the start of the UI closed beta, how to try rev.ng and much more!

rev.ng: The Road Ahead
Announcement

rev.ng: The Road Ahead

In this blog post we will briefly describe today's release, provide an overview of the components of rev.ng and introduce you the next steps the rev.ng project intends to take towards the 1.0 release