whatisgithub

What is r2garlic?

radareorg/r2garlic — explained in plain English

Analysis updated 2026-05-18

40CAudience · developerComplexity · 3/5Setup · moderate

In one sentence

A radare2 plugin that decompiles Android DEX bytecode into readable code directly inside radare2.

Mindmap

mindmap
  root((r2garlic))
    What it does
      Decompiles DEX bytecode
      Wraps Garlic decompiler
      Runs inside radare2
    Tech stack
      C
      radare2
      Garlic
    Use cases
      Reverse engineer Android apps
      Inspect DEX classes
      Output smali code
    Audience
      Security researchers
      Reverse engineers
    Commands
      pd:G decompile method
      pd:Gc decompile class
      pd:Ga decompile all

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Decompile an Android app's DEX bytecode into readable code from within radare2.

USE CASE 2

Inspect a single method or an entire class during Android reverse engineering.

USE CASE 3

Dump general DEX file info similar to the standard dexdump tool.

USE CASE 4

Generate smali output for a class you are analyzing.

What is it built with?

Cradare2Garlic

How does it compare?

radareorg/r2garlicjakobfriedl/usb-monitor-bofhomemadegarbage/selfrisingrobot
Stars403938
LanguageCCC
Setup difficultymoderatehardhard
Complexity3/54/54/5
Audiencedeveloperdeveloperresearcher

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · moderate Time to first run · 30min

Requires an existing radare2 install, building from source needs git submodules.

The README does not state a license for this project.

So what is it?

r2garlic is a radare2 plugin that adds DEX and Dalvik decompiling to the popular reverse engineering framework radare2. It wraps a separate project called Garlic, described as a very fast decompiler for Android's DEX bytecode format, and exposes its output directly inside radare2's command line interface. DEX is the compiled bytecode format used by Android apps, so this plugin is aimed at people who reverse engineer or analyze Android applications. The README describes the plugin mainly through the commands it adds once installed. You can decompile a single method at the current position with pd:G, decompile an entire class with pd:Gc, decompile every class in the loaded DEX file at once with pd:Ga, print general information about the DEX file similar to the dexdump tool with pd:Gi, or output smali, the human-readable assembly-like representation of DEX bytecode, for the current class with pd:Gs. A help command, pd:G?, lists these options from within radare2 itself. Installing r2garlic is straightforward for anyone already using radare2. The recommended route is through r2pm, radare2's own package manager, with a single install command. Alternatively, the README shows how to build it from source: clone the repository, initialize and update its git submodules, since it depends on the separate Garlic decompiler project, and run make. There is also a documented uninstall path for both the package manager and source-build routes. This is a small, focused tool written in C, meant to be used inside an existing radare2 setup rather than as a standalone application. It suits developers and security researchers who already analyze Android apps or DEX files and want fast decompiled output without leaving radare2.

Copy-paste prompts

Prompt 1
Explain what DEX and Dalvik bytecode are and why an Android reverse engineer would need a decompiler for them.
Prompt 2
Walk me through installing r2garlic with r2pm versus building it from source with submodules.
Prompt 3
Show me how to use the pd:Gc and pd:Ga commands to decompile a class or an entire DEX file.
Prompt 4
Explain the difference between the pd:Gs smali output and the pd:G decompiled output.
Prompt 5
Help me troubleshoot the submodule setup if the Garlic dependency fails to build.

Frequently asked questions

What is r2garlic?

A radare2 plugin that decompiles Android DEX bytecode into readable code directly inside radare2.

What language is r2garlic written in?

Mainly C. The stack also includes C, radare2, Garlic.

What license does r2garlic use?

The README does not state a license for this project.

How hard is r2garlic to set up?

Setup difficulty is rated moderate, with roughly 30min to a first successful run.

Who is r2garlic for?

Mainly developer.

Open on GitHub → Ask about another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.