at⋅a⋅rax⋅is

Decompiling with Ghidra and Claude

LLMs have gotten surprisingly good at reverse engineering (or so I hear1). Not just pattern-matching, but reasoning about what decompiled code is actually doing. I had just the target for practice, a binary called bounce I’ve had for thirty years. Never had the source.

It was a TCP port forwarder written by Robert Ziegler in 1993, passed around in binary form only — far too dangerous for n00bs, allegedly. We used it in college at UMR to tunnel through campus firewalls: put it on a machine you had shell access to, point it at a blocked host, connect through it. Before SSH existed, this was how you got to things you weren’t supposed to reach. The config was one line per rule:

remotemachine.domain  21  9605

Connect to port 9605 locally, bounce forwarded it to port 21 on remotemachine.domain. Multiple rules, one daemon, live control interface over telnet. It rocked.

SSH eliminated the need for it long ago. ssh -L 9605:remotemachine.domain:21 does the same thing with encryption and no hardcoded relay password. But for a window in the early nineties this was a real tool people actually used.

The binary

Running file on it:

bounce: Linux/i386 demand paged executable (QMAGIC), stripped

QMAGIC2 is the binary format that preceded ELF3 on Linux — used roughly 1993 to 1995 before ELF became standard around kernel 1.2. Finding QMAGIC in the wild is its own timestamp. This binary was from early-days Linux, kernel 0.99 or 1.0 era.4 Statically linked, 176KB, includes libc and the NIS/YP resolver. No debug symbols.

macOS objdump (Apple LLVM) doesn’t know what QMAGIC is. GNU binutils from Homebrew recognizes it as a.out-i386 and can disassemble, but not decompile. You’d end up with 176KB of x86 assembly and a lot of patience.

Ghidra5 handles it. The name is a nod to a three-headed monster — the tool combines a hex editor, disassembler, and decompiler in one.6 Apt, for something analyzing a three-node relay: client, bounce host, destination.

The decompilation

This is where the LLM came in. I didn’t paste Ghidra output into a chat window — Claude Code ran the whole thing. It wrote DecompileAll.java on demand, a headless Ghidra script, then invoked analyzeHeadless with the right Java home and read the output directly. The more common workflow is a human using the Ghidra GUI interactively and sharing excerpts. Doing it headless meant getting all 571 functions at once with no curation, which put the burden of finding the application logic on the model.

Before touching the decompiler output at all, strings on the binary did most of the orientation. The menu text, error messages, and format strings were all there verbatim — which mapped almost one-to-one to function behavior. FUN_00002b88 was the control state machine before I read a line of disassembly, because all six state transitions showed up in the strings. Then Ghidra C, cross-referenced against recognizable libc call shapes — socket(), bind(), select(), crypt() are identifiable by their arguments even when the function is named FUN_00004b68.

Ghidra 12.1 ships an a.out loader that understands QMAGIC. The headless invocation:

JAVA_HOME=/opt/homebrew/opt/openjdk@21/libexec/openjdk.jdk/Contents/Home \
  /opt/homebrew/Cellar/ghidra/12.1/libexec/support/analyzeHeadless \
  /tmp/ghidra_bounce_proj BounceProject \
  -process bounce \
  -scriptPath /tmp/ghidra_scripts \
  -postScript DecompileAll.java \
  -noanalysis

The result: 27,380 lines, 571 functions — most of them statically-linked libc. The application logic was the first ~1,200 lines, maybe 20 functions.

Ghidra names unknown functions FUN_<address>. Mapping them back to real names was mostly mechanical: look at what the function does, what it calls, what calls it.

Ghidra nameActual function
entrymain / argument parsing
FUN_000013b8load_config
FUN_00001608init_sockets
FUN_00001918cleanup / signal handler
FUN_00002b88handle_ctrl_input (state machine)
FUN_00003438main_loop (select loop)
FUN_00003e38daemonize

The control interface turned out to be a six-state telnet state machine: banner → password → menu → (add node / delete node / delete connection). Clean, obvious once you see it. The reconstructed C compiled and ran correctly on the first try, which is not what I expected.

The password tangent

The control password is stored as a DES crypt7 hash.

At this point I had the source code. I could see exactly where the hash was defined and how to change it. The correct move was obvious. Claude enthusiastically wrote four brute forcers in escalating sophistication instead. It exhausted the full printable ASCII charset up through length five before I stopped it.

I replaced the hash and moved on.

The bug

When I connected to the control port and tried to authenticate, it segfaulted.

The call chain was: main_loop (select loop) → dispatch pending input lines → handle_ctrl_input. The problem was in the dispatch section. After calling handle_ctrl_input, the loop read c->input_head to decide whether to process another line — but handle_ctrl_input can call ctrl_conn_close, which frees c. The struct was already gone.

Claude had modeled the happy path but didn’t trace the close-on-wrong-password path back through the caller. Fix was straightforward: capture next and had_more before the call.

struct ctrl_conn *next = c->next;
struct line *l = c->input_head;
c->input_head = l->next;
if (!c->input_head) c->input_tail = NULL;
int had_more = (l->next != NULL);
handle_ctrl_input(c, l->text); /* may free c via ctrl_conn_close */
free(l->text); free(l);
if (had_more) again = 1;
c = next;

There was also a crypt() NULL guard needed on macOS — crypt() can return NULL on some configurations, and the original code (reconstructed faithfully from the binary) called strcmp directly on the result.

C compilers and runtimes have changed enough in thirty years that behavior incidentally safe in 1993 isn’t guaranteed now. The decompilation was faithful; the environment wasn’t.

Why this existed

SSH was released in 1995.8 Before that, the options for getting traffic through a firewall were: work around the firewall policy at the network level (often not possible), use rsh/rlogin9 on trusted hosts (required being trusted), or run something like bounce on an intermediate machine you had shell access to.

The era this was built for had firewalls that operated at the IP layer — layer-4 inspection wasn’t common. Campus firewalls blocked ports, not protocols. If you could get TCP through at all, you could forward anything. The security model was roughly “if you have a shell account on a machine inside the firewall, you’re trusted.”

bounce worked because that model was still intact. It’s a clean solution to a problem that doesn’t exist anymore.

The closest modern equivalent is probably socat10 for quick TCP splicing, or SSH -L/-R/-D for actual tunneling, or WireGuard11 if you want something persistent. None of them need a telnet control interface with a cracked DES password.


Source is at github.com/milesd/bounce if you want the reconstructed C. The original binary is in the repo too — it’s 176KB of history.


  1. Criddle, Cristina. “Anthropic’s Mythos AI model sparks fears of turbocharged hacking.” Ars Technica (via Financial Times), April 20, 2026. https://arstechnica.com/ai/2026/04/anthropics-mythos-ai-model-sparks-fears-of-turbocharged-hacking/ ↩︎

  2. “a.out.” Wikipedia, The Free Encyclopedia. https://en.wikipedia.org/wiki/A.out ↩︎

  3. “Executable and Linkable Format.” Wikipedia, The Free Encyclopedia. https://en.wikipedia.org/wiki/Executable_and_Linkable_Format ↩︎

  4. “Linux Kernel Version History.” Wikipedia, The Free Encyclopedia. https://en.wikipedia.org/wiki/Linux_kernel_version_history ↩︎

  5. Ghidra Software Reverse Engineering Framework. National Security Agency. https://ghidra-sre.org/ ↩︎

  6. “Reverse Engineering UEFI with Ghidra.” Basic Input Output, October 2023. https://www.basicinputoutput.com/2023/10/reverse-engineering-uefi-with-ghidra.html ↩︎

  7. “crypt (Unix).” Wikipedia, The Free Encyclopedia. https://en.wikipedia.org/wiki/Crypt_(Unix) ↩︎

  8. “Secure Shell.” Wikipedia, The Free Encyclopedia. https://en.wikipedia.org/wiki/Secure_Shell#History ↩︎

  9. “Remote Shell.” Wikipedia, The Free Encyclopedia. https://en.wikipedia.org/wiki/Remote_Shell ↩︎

  10. Rieger, Gerhard. socat — Multipurpose Relay. http://www.dest-unreach.org/socat/ ↩︎

  11. WireGuard: Fast, Modern, Secure VPN Tunnel. https://www.wireguard.com/ ↩︎