HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
avast
retdec
C++2017–2025
avast / retdec

retdec

RetDec is a retargetable machine-code decompiler based on LLVM.

12Distinct people
13Mentions
0Explicit recommenders
8.7KGitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

RetDec is a retargetable machine-code decompiler based on LLVM.

GitHub

Where it is used

No documented product use was verified in the last source check.

What people are saying

No recommendation phrase was found in the indexed comments.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

No other repository is repeatedly linked in the same discussions.

This week on Hacker News

Nov 7–Nov 14 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/14/2026, 3:56:07 PM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by year13 dated mentions

Observed mentions: 2017-12-12 18:53:31 UTC to 2025-01-04 22:22:33 UTC.

0123452017-01-01 00:00:00 UTC to 2018-01-01 00:00:00 UTC (exclusive): 5 mentions; 2 submissions, 3 comments20172018-01-01 00:00:00 UTC to 2019-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2019-01-01 00:00:00 UTC to 2020-01-01 00:00:00 UTC (exclusive): 2 mentions; 1 submissions, 1 comments2020-01-01 00:00:00 UTC to 2021-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2021-01-01 00:00:00 UTC to 2022-01-01 00:00:00 UTC (exclusive): 1 mentions; 1 submissions, 0 comments20212022-01-01 00:00:00 UTC to 2023-01-01 00:00:00 UTC (exclusive): 2 mentions; 1 submissions, 1 comments2023-01-01 00:00:00 UTC to 2024-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2024-01-01 00:00:00 UTC to 2025-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2025-01-01 00:00:00 UTC to 2026-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2025

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
20172017-01-01 00:00:00 UTC2018-01-01 00:00:00 UTC523
20182018-01-01 00:00:00 UTC2019-01-01 00:00:00 UTC101
20192019-01-01 00:00:00 UTC2020-01-01 00:00:00 UTC211
20202020-01-01 00:00:00 UTC2021-01-01 00:00:00 UTC101
20212021-01-01 00:00:00 UTC2022-01-01 00:00:00 UTC110
20222022-01-01 00:00:00 UTC2023-01-01 00:00:00 UTC211
20232023-01-01 00:00:00 UTC2024-01-01 00:00:00 UTC000
20242024-01-01 00:00:00 UTC2025-01-01 00:00:00 UTC000
20252025-01-01 00:00:00 UTC2026-01-01 00:00:00 UTC101

What Hacker News says

13 sources
Most decompilers do not strive for recompilability. [1] I believe there are (or were) some academic projects that aimed for recompilation as a core feature, but it is a hard problem. On the commercial side, IDA / HexRays [2] is very strong for C-like decompilation. If you're looking at Go, Rust, or even C++ it is going to be a little bit more messy. As other commenters have said, you'll work function-by-function and it is expensive, though the free version does have decompilation (F5) for x86 and x64 (IIRC). Binary Ninja [3] (no affiliation) is the coolest IMO, they have multiple intermediate representations they lift the assembly through. So you get like assembly -> low level IL -> medium level IL -> high level IL. There are also SSA forms (static single assignment) that can aid in programmatic analyses. The high level IL is very readabl
Read the rest
e but makes no effort to be compilable as a programming language. That being said, Binary Ninja has implemented different "views" on the HLIL so you can show it as pseudo-C, Rust, etc. There is a free online version and the commercial version is cheaper than IDA but still expensive. Good Python API, good UI. Ghidra [4] is the RE framework released by NSA. It is free and open source. It supports a ton of niche architectures. This is what most people use. I think the UI is awful, personally. It has a decompiler, the results are OK. They have an intermediate representation (P-Code) and plugins are in Java (since it is written in Java). I haven't worked much with it. Most online decompilations you see for old games are likely using Ghidra, some might be using IDA. This is largely a manual process of doing a function at a time and building up the mental map of the program and how things interact. Also worth mentioning are lifters. There were a few projects that aimed to lift assembly to LLVM IR (compiler framework's intermediate representation), with the idea being that then all your analyses could be written over LLVM IR as a lingua franca. Since it is in LLVM IR, it would be also recompilable and retargetable. [5][6] 1. https://reverseengineering.stackexchange.com/questions/2603/... 2. https://hex-rays.com/ida-free 3. https://binary.ninja/free/ 4. https://ghidra-sre.org/ 5. https://github.com/avast/retdec 6. https://github.com/lifting-bits/mcsema
In Ask HN: How are you using LLMs for traversing decompiler output?
sargstuff·Apr 11, 2022Submission

Literal Hands on Coding Method(s)?

Anyone tried modifying the AST-tree of a compiler for a given program(s) in VR space? Is this a viable method for remote office code reviews? Example working concept [1] would be comparing "old" K&R C / C89 vs. port to "modern" C. aka Virtual chalk board in VR 2 or 3D to support video conference. [1] "Old C code -- how to upgrade it?" https://news.ycombinator.com/item?id=30957273#30962540 Concept example: Given "old" c code line of : (--(char)hash_ptr.parm.v.p) = fpop(sst); A) "traditional method": run it through the compiler/debugger, "compile/debug/pray resolve all issues) B) Advanced method: Assuming the license terms on the working binary allows decompilation; 1) Use a disassembler to psudo C on the original binary and same hardware. 2) Diff the resulting pseudo source code to see where things get interpreted differently.
Read the rest
3) Then use combination of "tree differ" ([2]) and compiler explorer to review the "differences", ([3]) C) Next setup up approach: 1) open source decompile to pseudo-C software: ghidra [4]; retdec [5] compiler ware: gcc -fdump-translation-unit or clang -ast-dump 2) Then use something graphbiz's dotty in conjunction with [6] nicst's tree diff util. D) Current, everything but the kitchen sink approach: Almost verything but the VR aspect, Non-free software for non-vr space ast idea: http://www.semdesigns.com/Products/DMS/DMSToolkit.html Query: Is there an open source interactive VR "full compiler stack" tree visualization, so one can "hand manipulate"/ move in/out of compile AST new code or color code diffs between old/new code and/or versions all in 3d? Resources: [2] ast tree diff utils : https://github.com/syntax-tree/awesome-syntax-tree [3] compiler explorer : https://godbolt.org/z/v4TdvE83b [4] ghidra: ghidra-sre.org [5] retdec: https://github.com/avast/retdec [6] nicst utils : https://github.com/syntax-tree/awesome-syntax-tree
1 points · Open discussion
Assuming the license terms on the working binary allows decompilation; could use a disassembler to psudo C on the original binary and same hardware, new 32 bit compile (ideally with same compiler (gcc/clang/etc) used on original binary) Diff the resulting pseudo source code to see where things get interpreted differently. Then use compiler explorer on the "differences", https://godbolt.org/z/v4TdvE83b open source decompile to pseudo-C: ghidra: ghidra-sre.org retdec: https://github.com/avast/retdec
In Old C code – how to upgrade it?
Think of binary translation as just another kind of compiler. It parses machine code, generates an IR, does things to the IR, and then codegens machine code in a different ISA. (Heck, Rosetta 2 is probably built on LLVM. Why wouldn't it be? Apple already put so much work into it. They could even lean on similar work like https://github.com/avast/retdec .) During the "do things to IR" phase of compilation, you can do static analysis, and use this to inform the rest of the compilation process. The unique pattern of machine-code that must occur in any implementation of JIT, is a jump to a memory address that was computed entirely at runtime, i.e. with a https://en.wikipedia.org/wiki/Use-define_chain for that address value that leads back to a call to mmap(2) or malloc(2). Static analysis of the IR can find and label such instructions; and yo
Read the rest
u can use this to replace them in the IR with more-abstract "enter JITed code" instrinsic ops. Then, in the codegen phase of this compiler, you can have such intrinsics generate a shim of ARM instructions. Conveniently, since this intrinsic appears at the end of the JIT process, the memory at the address passed to the intrinsic will almost certainly contain finalized x86 code, ready to be re-compiled into ARM code. So the shim can just do a (hopefully memoized) call to the Rosetta JIT translator, passing the passed-in address, getting back the address of some ARM code, and jumping to that.
In About the Rosetta Translation Environment

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.