rev.ng logo
Back to Blog

What's new in the rev.ng decompiler

Drake rejecting verbose floating-point helper calls and approving a simple return a + b

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!

How? Take a look at the initial setup guide and then head into your very first decompilation.

In this post we'll talk about some significant stability and performance improvements we've made, but keep in mind we're still doing some major work in this area, so expect rough edges. If you have problems, please do not hesitate to reach out to us on Discord or to open an issue on GitHub. Don't forget to attach a reproducer :)

Note that today we're just going to talk about rev.ng, our open source decompiler engine. If you're looking for news about the UI, subscribe to the newsletter now: big news is coming soon there as well.

By the way, at rev.ng Labs we also do contract work. If you have a challenge for us about binary analysis, emulation or compilers, reach out. We're your guys.

Enough talk. Ready? Let's get into it.

Prototypes for 600k well-known functions

We now ship a database of prototypes for all the library functions of the following operating systems:

  • Windows 11 x86-64, AArch64
  • Windows 7 x86
  • Windows 8 and 8.1 x86-64
  • Ubuntu 24.04 x86, x86-64, ARM, AArch64, s390x
  • Ubuntu 20.04, 22.04 x86-64
  • Debian Buster MIPS (big endian)
  • Debian Bookworm MIPS (little endian)

This means you get nice prototypes for all the Win32 library functions and for the most common libraries under Linux, out of the box. Here's the difference it makes on a call to VirtualAllocEx, on the function signatures:

// Default prototypes for the Windows calling conventions
generic64_t
GetCurrentProcess(
generic64_t register_rcx _REG(rcx_x86_64),
generic64_t register_rdx _REG(rdx_x86_64),
generic64_t register_r8 _REG(r8_x86_64),
generic64_t register_r9 _REG(r9_x86_64)
);

generic64_t
VirtualAllocEx(
generic64_t register_rcx _REG(rcx_x86_64),
generic64_t register_rdx _REG(rdx_x86_64),
generic64_t register_r8 _REG(r8_x86_64),
generic64_t register_r9 _REG(r9_x86_64)
);

And in the function body:

// Default prototypes for the Windows calling conventions
generic32_t *
function_0x140001000_Code_x86_64(generic64_t argument_0) {
struct_7 stack;
// Stack argument mistaken for a write on the stack frame
stack.offset_32 = 4U;

generic64_t var_0;
var_0 = GetCurrentProcess(argument_0,
undef(generic64_t),
undef(generic64_t),
undef(generic64_t));
generic32_t *var_1;
var_1 = VirtualAllocEx(var_0,
0ULL,
argument_0,
12288ULL);

if (var_1)
*var_1 = 4660U;
return var_1;
}

Overall, the database currently provides 600k function prototypes, 590k structs, 564k typedefs, 34k unions and 20k enums.

The database is a plain SQLite file: if you're curious, you can take a look at it (1.86 GB).

Floating point support

Support for floating point is finally landing in rev.ng. We now support floating point arguments in many calling conventions and emit floating point operations as plain C operators:

// Before floating point support
_ABI(raw_x86_64)
generic512_t
add(
generic512_t register_zmm0 _REG(zmm0_x86_64),
generic512_t register_zmm1 _REG(zmm1_x86_64)
) {
generic64_t var_1;
var_1 = float64_add(register_zmm0,
register_zmm1,
(void *) 10998ULL);
return rr_bitor(rr_bitand(register_zmm0,
rr_neg(rr_imm(generic512_t,
1 << 64))),
rr_zext(generic512_t, var_1));
}

As of today, we mainly support it in the Microsoft x86-64, ARM (32-bit) and MIPS ABIs. Wider support is being worked on and will be merged soon.

Fewer casts

We now suppress casts that are not necessary according to the "integer promotions" and "usual arithmetic conversions", as specified by the C99 standard (§6.3.1.1, Boolean, characters, and integers and §6.3.1.8, Usual arithmetic conversions).

In practice:

// Before cast elision
_ABI(SystemV_x86_64)
int32_t SignedSumLess(uint64_t FirstAddend,
uint64_t SecondAddend,
int64_t Limit) {
return (int32_t) (
(int64_t) (
(generic64_t) FirstAddend
+ (generic64_t) SecondAddend
)
< Limit
);
}

Note that we don't just "hide casts": we omit a cast only if doing so doesn't change the semantics of the code. For instance, removing the surviving int64_t cast would make the < comparison unsigned, which would be incorrect.

We also implemented intraprocedural type propagation to further reduce casts:

// Without type propagation
_ABI(SystemV_x86_64)
node *
find_last_non_zero(node *head) {
generic64_t var_0 = (generic64_t) next(head);
generic64_t var_1 = 0UL;
if (var_0) {
generic64_t var_2 = var_0;
generic64_t var_3 = 0UL;
do {
var_3 = value((node *) var_2) ? var_2 : var_3;
var_2 = (generic64_t) next((node *) var_2);
} while (var_2);
var_1 = var_3;
}
return (node *) var_1;
}

Interprocedural type propagation is in the oven: if you're curious, check out REP84: Value Manipulation Analysis (VMA).

Fewer local variables

Decompilers use local variables to ensure memory accesses are performed in the same order as in the original binary. For instance, the following transformation is not valid:

// Original code
long function(long *a, long *b) {
long value = *a;
*b = 3;
return value;
}

In fact, if we were to do it, and a and b happened to point to the same memory, we'd be corrupting the program's behavior!

This problem is known as aliasing, and LLVM has a pretty powerful alias analysis framework, which we now rely upon. The end result: we can omit a lot of redundant local variables.

// Without reduction of local variables
_ABI(SystemV_x86_64)
generic64_t
compute(struct_62 *argument_0) {
generic64_t var_0 = 0UL;
struct_62 *var_1 = argument_0;
generic64_t var_2;
do {
var_2 = sum(var_1);
var_0 = var_0 + var_2;
var_1 = var_1->offset_40;
} while (var_1);
return var_0;
}

Bonus: we now also push local variable declarations into the narrowest possible scope. Take a look:

// Original code
_ABI(SystemV_x86_64)
generic64_t f(generic64_t arg) {
generic64_t v0;
generic64_t v1;
generic64_t v2;
v0 = 0UL;
if (arg) {
v1 = g(arg);
v2 = v1 ? v1 : arg;
v0 = v2;
}
return v0;
}

CFG restructuring

We're also working on emitting better C in terms of control constructs. For instance, consider the following snippet: initially a raw while (1) with several non-fallthrough constructs (continue, break, return), it is turned into a nice and compact do { ... } while (...) loop:

while (1) {
if (a) {
do_A();
return;
} else {
do_B();
if (b)
break;
else
continue;
}
}

Clift interlude

The transformations in the last three sections were made possible, and easy, by Clift. Clift is our MLIR-based intermediate representation targeting the subset of C99 that we emit: instead of patching up strings, we now have a proper IR for C on which we can write small, testable transformations.

Here's a taste of it, taken from our test suite. This is how a function returning the result of an arithmetic expression looks in Clift, one operation per line:

!int32_t = !clift.int<signed 4>

!f = !clift.func<
  "/type-definition/1001-CABIFunctionDefinition" : !int32_t()
>

module attributes {clift.module} {
  clift.func @fun_0x40001001<!f>() attributes {
    handle = "/function/0x40001001:Code_x86_64"
  } {
    clift.return {
      %0 = clift.imm 0 : !int32_t
      %1 = clift.imm 1 : !int32_t
      %2 = clift.imm 2 : !int32_t
      %3 = clift.imm 3 : !int32_t
      %4 = clift.imm 4 : !int32_t
      %5 = clift.imm 5 : !int32_t

      %a = clift.add %0, %1 : !int32_t
      %b = clift.sub %a, %2 : !int32_t
      %c = clift.mul %b, %3 : !int32_t
      %d = clift.sdiv %c, %4 : !int32_t
      %e = clift.srem %d, %5 : !int32_t

      clift.yield %e : !int32_t
    }
  }
}

And this is the C we emit for it, with parentheses only where C needs them:

int32_t fun_0x40001001(void) {
  return (0 + 1 - 2) * 3 / 4 % 5;
}

But Clift is much more than that! We have constructs to describe types, control flow (including loops), statements and expressions. Everything you need to improve the quality of the C code we emit, and that LLVM doesn't provide. If you want to see more, the test suite is a good place to start:

There are many more in tests/filecheck/clift.

New pipeline infrastructure: a nicer CLI and a lot less memory

If you have used rev.ng in the past, you might be accustomed to running something like this:

# Old syntax
revng project artifact --analyze emit-c-as-single-file mybinary

This is now obsolete, in favor of a new, more user-friendly CLI that looks like this:

# Current syntax
revng project init mybinary # Creates revng.yml project file
revng project artifact emit-c-as-single-file

# Or, more concisely:
revng quick artifact emit-c-as-single-file mybinary

Take a look at the Your first decompilation tutorial and at the CLI reference.

This change comes with the merge of the new pipeline, i.e., the rev.ng component that orchestrates the production of artifacts such as decompiled code. Beyond having a new, nicer CLI, the new pipeline also consumes a lot less memory.

Memory consumption before and after the new pipelineRSS memory usage. Before: 69.6 seconds; after: 53.2 seconds.
  • Before · peak 1.082 GB
  • After · peak 0.334 GB
Memory (RSS) (GB)
00.250.50.7511.250255075100Recorded duration (%)Before: peak 1.082 GBAfter: peak 0.334 GB00.250.50.7511.250255075100Recorded duration (%)Before: peak 1.082 GBAfter: peak 0.334 GB

For this program, peak memory consumption fell from about 1.08 GB to 334 MB with the new pipeline.

Explore the full traces in the trace visualizer, Perfetto: open the "Before" trace and open the "After" trace.

Basically, we no longer keep all intermediate artifacts in memory: we flush them to disk as soon as we can. This saves a lot of memory.

The new pipeline will also enable us to emit artifacts in parallel, but that still needs some love.

Tested weekly on 20k+ binaries

Mass-testing report showing a 64% success rate across 21,415 binaries

Every week, we run mass testing, a testing campaign where we decompile 20k+ binaries coming from Linux, Android and Windows installations and monitor the results in terms of success, crashes, timeouts and memory exhaustion.

This approach has been very effective in helping us prioritize fixes for the most common crashes and the most common performance bottlenecks. It also enables us to help users who cannot share the binary they are working on with us, but have a problem similar to one we already know about thanks to mass testing.

Mass testing outcomes over timeEvolution over time of decompilation results. Source.
Tested binaries (%)
Out of memory: latest 9.56%Timed out: latest 22.96%Crashes: latest 1.04%Invalid binary: latest 2.46%Successes: latest 63.99%0%20%40%60%80%100%Oct 2024Apr 2025Nov 2025May 2026Nov 2026Campaign date (UTC)Out of memory: latest 9.56%Timed out: latest 22.96%Crashes: latest 1.04%Invalid binary: latest 2.46%Successes: latest 63.99%0%20%40%60%80%100%Oct 2024Nov 2025Nov 2026Campaign date (UTC)
October 17, 2024
  • Successes49%
  • Invalid binary8.78%
  • Crashes3.3%
  • Timed out9.19%
  • Out of memory29.73%
October 31, 2024
  • Successes49.89%
  • Invalid binary8.78%
  • Crashes3.01%
  • Timed out21.63%
  • Out of memory16.68%
November 8, 2024
  • Successes58.12%
  • Invalid binary2.01%
  • Crashes3.28%
  • Timed out19.43%
  • Out of memory17.16%
November 15, 2024
  • Successes35.48%
  • Invalid binary2%
  • Crashes30.04%
  • Timed out16.8%
  • Out of memory15.68%
November 22, 2024
  • Successes34.43%
  • Invalid binary2%
  • Crashes29.67%
  • Timed out18.2%
  • Out of memory15.69%
January 20, 2025
  • Successes48.59%
  • Invalid binary9.1%
  • Crashes2.83%
  • Timed out20.64%
  • Out of memory18.84%
January 23, 2025
  • Successes48.86%
  • Invalid binary9.1%
  • Crashes2.91%
  • Timed out17.47%
  • Out of memory21.66%
January 31, 2025
  • Successes46.89%
  • Invalid binary9.1%
  • Crashes2.99%
  • Timed out22.17%
  • Out of memory18.85%
February 26, 2025
  • Successes46.9%
  • Invalid binary9.1%
  • Crashes2.9%
  • Timed out17.53%
  • Out of memory23.57%
March 7, 2025
  • Successes47.49%
  • Invalid binary9.1%
  • Crashes2.26%
  • Timed out16.86%
  • Out of memory24.28%
March 14, 2025
  • Successes47.35%
  • Invalid binary9.08%
  • Crashes2.23%
  • Timed out17.06%
  • Out of memory24.28%
March 21, 2025
  • Successes47.5%
  • Invalid binary9.09%
  • Crashes2.21%
  • Timed out18.06%
  • Out of memory23.14%
April 11, 2025
  • Successes47.39%
  • Invalid binary9.09%
  • Crashes2.22%
  • Timed out16.97%
  • Out of memory24.32%
April 18, 2025
  • Successes36.52%
  • Invalid binary9.11%
  • Crashes28.11%
  • Timed out11.22%
  • Out of memory15.05%
April 30, 2025
  • Successes46.8%
  • Invalid binary9.1%
  • Crashes2.47%
  • Timed out17.05%
  • Out of memory24.58%
May 9, 2025
  • Successes46.87%
  • Invalid binary9.09%
  • Crashes2.14%
  • Timed out22.91%
  • Out of memory18.99%
July 18, 2025
  • Successes47.63%
  • Invalid binary9.09%
  • Crashes1.45%
  • Timed out22.09%
  • Out of memory19.74%
July 25, 2025
  • Successes47.49%
  • Invalid binary8.69%
  • Crashes1.06%
  • Timed out26.86%
  • Out of memory15.89%
August 1, 2025
  • Successes46.6%
  • Invalid binary9.09%
  • Crashes1.28%
  • Timed out26.36%
  • Out of memory16.67%
August 8, 2025
  • Successes47.57%
  • Invalid binary9.09%
  • Crashes1.35%
  • Timed out25.25%
  • Out of memory16.73%
August 15, 2025
  • Successes47.62%
  • Invalid binary9.09%
  • Crashes1.44%
  • Timed out22.04%
  • Out of memory19.81%
September 5, 2025
  • Successes47.59%
  • Invalid binary9.09%
  • Crashes1.41%
  • Timed out22.95%
  • Out of memory18.96%
September 12, 2025
  • Successes46.81%
  • Invalid binary9.09%
  • Crashes1.38%
  • Timed out23.71%
  • Out of memory19.01%
September 19, 2025
  • Successes46.26%
  • Invalid binary9.09%
  • Crashes1.39%
  • Timed out23.32%
  • Out of memory19.93%
September 26, 2025
  • Successes46.07%
  • Invalid binary8.88%
  • Crashes1.31%
  • Timed out23.64%
  • Out of memory20.1%
October 4, 2025
  • Successes33.39%
  • Invalid binary8.45%
  • Crashes1.06%
  • Timed out36.95%
  • Out of memory20.15%
October 10, 2025
  • Successes21.28%
  • Invalid binary6.97%
  • Crashes0.72%
  • Timed out62.26%
  • Out of memory8.77%
October 17, 2025
  • Successes46.11%
  • Invalid binary9.09%
  • Crashes1.41%
  • Timed out23.8%
  • Out of memory19.58%
October 25, 2025
  • Successes46.14%
  • Invalid binary9.09%
  • Crashes1.43%
  • Timed out22.73%
  • Out of memory20.61%
November 1, 2025
  • Successes46.07%
  • Invalid binary9.09%
  • Crashes1.41%
  • Timed out25.45%
  • Out of memory17.98%
November 14, 2025
  • Successes45.24%
  • Invalid binary10.46%
  • Crashes7.08%
  • Timed out22.81%
  • Out of memory14.41%
November 21, 2025
  • Successes45.27%
  • Invalid binary10.5%
  • Crashes7.08%
  • Timed out22.37%
  • Out of memory14.77%
November 29, 2025
  • Successes45.23%
  • Invalid binary10.49%
  • Crashes7.02%
  • Timed out22.68%
  • Out of memory14.58%
December 5, 2025
  • Successes45.22%
  • Invalid binary10.5%
  • Crashes7.05%
  • Timed out22.43%
  • Out of memory14.81%
July 20, 2026
  • Successes59.05%
  • Invalid binary2.01%
  • Crashes9.39%
  • Timed out22.31%
  • Out of memory7.25%
July 24, 2026
  • Successes58.7%
  • Invalid binary2%
  • Crashes9.15%
  • Timed out23.31%
  • Out of memory6.85%
July 31, 2026
  • Successes58.11%
  • Invalid binary2%
  • Crashes8.83%
  • Timed out25.01%
  • Out of memory6.05%
August 7, 2026
  • Successes58.84%
  • Invalid binary2.01%
  • Crashes9.38%
  • Timed out22.27%
  • Out of memory7.5%
August 14, 2026
  • Successes59.05%
  • Invalid binary2.01%
  • Crashes9.36%
  • Timed out22.42%
  • Out of memory7.17%
August 21, 2026
  • Successes58.84%
  • Invalid binary2.01%
  • Crashes9.26%
  • Timed out22.91%
  • Out of memory6.98%
August 28, 2026
  • Successes58.76%
  • Invalid binary2.01%
  • Crashes9.32%
  • Timed out22.6%
  • Out of memory7.31%
September 4, 2026
  • Successes58.7%
  • Invalid binary2.01%
  • Crashes9.26%
  • Timed out22.8%
  • Out of memory7.24%
September 12, 2026
  • Successes65.9%
  • Invalid binary2.32%
  • Crashes2.35%
  • Timed out20.61%
  • Out of memory8.82%
September 19, 2026
  • Successes66.43%
  • Invalid binary2.32%
  • Crashes2.5%
  • Timed out19.57%
  • Out of memory9.19%
September 26, 2026
  • Successes66%
  • Invalid binary2.32%
  • Crashes2.48%
  • Timed out20.01%
  • Out of memory9.19%
October 4, 2026
  • Successes65.77%
  • Invalid binary2.35%
  • Crashes2.39%
  • Timed out20.48%
  • Out of memory9.02%
October 10, 2026
  • Successes64.19%
  • Invalid binary2.33%
  • Crashes2.08%
  • Timed out23.26%
  • Out of memory8.14%
October 17, 2026
  • Successes65.94%
  • Invalid binary2.35%
  • Crashes2.47%
  • Timed out20.11%
  • Out of memory9.12%
October 24, 2026
  • Successes65.68%
  • Invalid binary2.36%
  • Crashes2.37%
  • Timed out20.67%
  • Out of memory8.92%
October 31, 2026
  • Successes66.08%
  • Invalid binary2.33%
  • Crashes2.38%
  • Timed out20.19%
  • Out of memory9.02%
November 7, 2026
  • Successes66.01%
  • Invalid binary2.36%
  • Crashes2.45%
  • Timed out20%
  • Out of memory9.18%
November 16, 2026
  • Successes63.99%
  • Invalid binary2.46%
  • Crashes1.04%
  • Timed out22.96%
  • Out of memory9.56%

Over time, crashes went down from 7% to 1%. Also, between December 2025 and July 2026 we merged the new pipeline, which led to a reduction of timeouts from 14% to 7%.

Our goal is to reduce the number of crashes to 0 and to progressively reduce the number of timeouts and OOM situations, although we don't expect them to reach zero, since we set arbitrary limits in terms of time and memory usage for each binary, which chrome.exe is unlikely to fit into :).

Documentation

Along with the new pipeline infrastructure, we revamped the documentation, which now provides:

What rev.ng supports today

As of today, the platform support in rev.ng is as follows:

  • Architectures: x86/x86-64, ARM/AArch64, MIPS and s390x.
  • Binary formats: ELF (+DWARF), PE/COFF (+PDB/CodeView) and Mach-O.
  • Host: Linux x86-64. We're working on running rev.ng natively on macOS and Windows too, employing a new Nix-based build system.

What about other architectures, say, RISC-V or Hexagon? rev.ng lifts code using QEMU, so supporting an architecture QEMU already handles is not too much work. If you need one, let us know: it helps us decide what to do next and, if you can't wait, it's the kind of work we take on as a contract.

What about the cloud version? And what's next?

The improvements above are not available in the cloud version of rev.ng, and they won't be: we're suspending it. Thanks to all those who tried it and provided feedback: your help is greatly appreciated! hub.rev.ng remains available for public consultation.

The reason is that we've been busy building something new. We'll tell you more soon but, in the meantime, here's a sneak peek:

Preview of rev.ng Studio showing decompiled C alongside an agent's analysis of the binary

Subscribe to the newsletter to hear about it first.

Where to go from here

See you in the next post! The wait won't be long ;)