63

The unexpected effectiveness of one-shot decompilation with Claude

It's worth noting here that the author came up with a handful of good heuristics to guide Claude and a very specific goal, and the LLM did a good job given those constraints. Most seasoned reverse engineers I know have found similar wins with those in place.

What LLMs are (still?) not good at is one-shot reverse engineering for understanding by a non-expert. If that's your goal, don't blindly use an LLM. People already know that you getting an LLM to write prose or code is bad, but it's worth remembering that doing this for decompilation is even harder :)

an hour agosaagarjha

Are they not performing well because they are trained to be more generic, or is the task too complex? It seems like a cheap problem to fine-tune.

an hour agoph4evers

Sounds like a more agentic pipeline task. Decompile, assess, explain.

21 minutes agopixl97

If you aren't using LLMs for your reverse engineering tasks, you're missing out, big time. Claude kicks ass.

It's good at cleaning up decompiled code, at figuring out what functions do, at uncovering weird assembly tricks and more.

3 hours agoACCount37

The article is a useful resource for setting up automated flows, and Claude is great at assembly. Codex less so, Gemini is also good at assembly. Gemini will happily hand roll x86_64 bytecode. Codex appears optimized for more "mainstream" dev tasks, and excels at that. If only Gemini had a great agent...

an hour agokeepamovin

I've been using Claude for months with Ghidra. It is simply amazing.

an hour agoskerit

Makes sense because LLMs are quite good at translating between natural languages.

Anyway, we're reaching the point where documentation can be generated by LLMs and this is great news for developers.

2 hours agoamelius

Documentation is one place where humans should have input. If an LLM can generate documentation, why would I want you to generate it when I can do so myself (probably with a better, newer model)?

an hour agosaagarjha

I stumbled across a fun trick this week. After making some API changes, I had CC “write a note to the FE team with the changes”.

I then pasted this to another CC instance running the FE app, and it made the counter part.

Yes, I could have CC running against both repos and sometimes do, but I often run separate instances when tasks are complex.

2 hours agojames_marks

Maybe documentation meant for other llms to ingest. Their documentation is like their code, it might work, but I don't want to have to be the one to read it.

Although of course if you don't vibe document but instead just use them as a tool, with significant human input, then yes go ahead.

2 hours agomonsieurbanana

Although with code it's implementing functions that don't exist yet and with documentation, it's describing functions that don't exist yet.

28 minutes agodunham
[deleted]
an hour ago

Makes me wonder if decompilation could eventually become so trivial that everything would become de-facto open source.

2 hours agorlili

When the decompilation like that is trivial, so is recreation without decompilation. It implies the LLM know exactly how thins work.

6 minutes agoAeolun

I wonder when you're never going to run expensive software on your own CPU.

It'll either all be in the cloud, so you never run the code...

Or it'll be on a chip, in a hermetically sealed usb drive, that you plug in to your computer.

24 minutes agoVikingCoder

Yes, I believe it will. What I predict will happen is that most commercial software will be hosted and provided through "trusted" platforms with limited access, making reverse engineering impossible.

24 minutes agojs8

This deserves a discussion

2 hours agoXmd5a

We're very far away from this.

21 minutes agostevemk14ebr

I've used LLMs to help with decompilation since the original release of GPT-4. They're excellent at recognizing the purpose of functions and refactoring IDA or Ghidra pseudo-C into readable code.

an hour agoronsor

How does it do on things that were originally written in assembly?

an hour agogalangalalgol

This is typically easier because the code was written for humans already.

an hour agosaagarjha

Someone please try this on an original (early 1980s) IBM-PC BIOS.

an hour agoeuroderf

I've been experimenting with running Claude in headless mode + a continuous loop to decompile N64 functions and the results have been pretty incredible. (This is despite already using Claude in my decompilation workflow).

I hope that others find this similarly useful.

8 days agoknackers

This sounds interesting! Do you have some good introduction to N64 decompiliation? Would you recommend using Claude right from the start or rather try to get to know the ins and outs of N64 decomp?

2 hours agoplastic-enjoyer

This is super cool! I would be curious to see how Gemini 3 fares… I've found it to be even more effective than Opus 4.5 at technical analysis (in another domain).

an hour agoturnsout

What game are you working on?

3 hours agogarrettjoecox

Last sentence of the first paragraph says it’s Snowboard Kids 2.

3 hours agowk_end

For his defense, it is missing a "Tell HN"

2 hours agorat9988

And it isn't always obvious when the commenter is the submitter (no [S] tag like you see on other sites).

2 hours agodpkirchner

whoops, I did indeed miss that this was OP

44 minutes agogarrettjoecox
[deleted]
2 hours ago

I've been waiting for decompilation to show up in this space.

26 minutes agoVikingCoder

Are there any similar specialized decompilation LLM models available to be used locally?

44 minutes agobutz

This is a refreshingly practical demonstration of an LLM adding value. More of this please.