News for hackers. Stuff that matters.
Re:LLMs can read and write executables byte by byte from a h... by rossy on Saturday November 21, 2026 @11:20AM (#50590724)
Like the weight space stuff, I think there's a small misdirection in how this is presented: Phrases like "write directly in machine code" seem to imply that ordinary LLMs intuitively understand machine code as just another language, like English or JavaScript, that they read from context and write directly as tokens, and that this intuitive understanding means increased efficiency or capabilities if you ask the LLM to just use the bytes rather than asking it to use the tools that human reverse engineers use.

If that's what you assumed, the DeepSeek reasoning trace shatters that illusion. It's just disassembling by hand like what a human reverse engineer would do if you (sadistically?) denied them a disassembler. Yeah, the human reverse engineer would need an excellent memory of the x86_64 instruction reference, but we already know LLMs can recall a breadth of information. What we don't know, that this article also provides no evidence for, is if there's any benefit in using the LLM for this over objdump.

The article seems to intentionally conflate disassembly (computationally cheap) with decompilation (can be computationally expensive) to imply that there's some benefit to asking the LLM to work with machine code (seems impressive to the RE layman) rather than working in assembly (something you probably already assumed LLMs can do,) but the DeepSeek trace has a disassembly in it, and it's hard to imagine that inference will ever be cheaper or more reliable per-token than objdump is at producing the same output.

Re:LLMs can read and write executables byte by byte from a h... by Farmadupe on Saturday November 21, 2026 @03:06PM (#50593114)
Ooh I'm not sure that I would buy into that! I've been experimenting with giving small binaries without strings or other direct clues, and asking them "So tell me what you think this does" in a bare container without disassembly tools.

So I'm actually fairly confident that the ability does come straight from the ability to read the bytes into context (usually as hex bash/perl/python3 is almost always available), and Then to directly interpret what the binary does from the code. And yes, when I do use open models, I can see from their reasoning traces that they do "hand-translate" the hex into assembly, but I kind of suspect that the translation stage into assembly may just be a narration, and the "understanding" of what is going on is actually a pure latent skill. That's just my guess, though.

The reason that I think this is because I've been using minimal implementations of inference engines. And frontier closed-weight models and open-weight models are able to observe a binary with no strings and the weights not attached, and they can infer the exact architecture and model (eg qwen3 0.6b, qwen3.5-0.8b, whatever) from the fixed shape of the inference kernels.

So in effect, over the course of 30 seconds, they go from looking at 500 instructions of x86 code and reply, “I know what this is. It's an inference engine for Qwen 3 0.6B!”

And I'm fairly sure that 30 seconds or not, it's a skill that no single human has.

Re:LLMs can read and write executables byte by byte from a h... by bananaboy on Saturday November 21, 2026 @05:00PM (#50594072)
I’m seeing the conflation between disassemble and decompile in other posts here too. I don’t know why you’d waste time and money using an LLM to disassemble an executable when it’s been trivial to do that with existing (free) tools for years!
Re:LLMs can read and write executables byte by byte from a h... by WalterBright on Saturday November 21, 2026 @08:06PM (#50595222)
I wrote my own disassembler for object files. They're easy to write. Doing it for executables is even easier, though I haven't needed to do them.
Re:LLMs can read and write executables byte by byte from a h... by dado3212 on Saturday November 21, 2026 @08:24PM (#50595318)
I've found the decompiled code from LLM's to be much more similar to human-written code (and therefore easier for me to understand) than standard Ghidra/other decompiler output. Plus LLM's for this kind of work are pretty cheap.
Re:LLMs can read and write executables byte by byte from a h... by push0ret on Saturday November 21, 2026 @09:17PM (#50595566)
The parent comment was making the point that disassembling and decompiling are not the same. There is no room for interpretation on disassembling, it's purely mechanical.
Re:LLMs can read and write executables byte by byte from a h... by kragen on Sunday November 22, 2026 @12:48AM (#50596675)
There's a little room for interpretation in disassembling. You can choose label names, and in instruction sets like amd64, you have to guess where the instructions begin. Also ideally you won't disassemble ARM literal pools as instructions, even though it's possible to branch, call, or return into them by computing their addresses at runtime.
Re:LLMs can read and write executables byte by byte from a h... by lxgr on Sunday November 22, 2026 @06:05AM (#50598485)
> in instruction sets like amd64, you have to guess where the instructions begin

Can't you just trace through all reachable instructions starting from a complete binary's entry point(s), as long as the code doesn't do unusual things like jumping into the middle of instructions, i.e. intentionally exploiting variable-length instruction ambiguity?

Re:LLMs can read and write executables byte by byte from a h... by kragen on Sunday November 22, 2026 @09:53AM (#50600248)
Not necessarily, because there is often code that is only accessible through function pointers; for example, C++ virtual methods. (In theory you can compute function pointers dynamically at runtime, too, which is less common.)

In https://canonical.org/~kragen/sw/dev3/qfitzah.s a lot of the function calls are conditionally compiled by the macro `do` (search for `.macro do`) to index into a table of function pointers pointed to by EBP, because that makes the call instructions 3 bytes instead of 5 bytes. Here I've disassembled one of the functions from the parser code from an unstripped version that has debugging symbols:

    080482b7 <read_term>:
     80482b7: ff 55 08              call   DWORD PTR [ebp+0x8]
     80482ba: 75 10                 jne    80482cc <read_term+0x15>
     80482bc: 50                    push   eax
     80482bd: e8 f5 ff ff ff        call   80482b7 <read_term>
     80482c2: 50                    push   eax
     80482c3: ff 55 04              call   DWORD PTR [ebp+0x4]
     80482c6: 59                    pop    ecx
     80482c7: 58                    pop    eax
     80482c8: ff 55 00              call   DWORD PTR [ebp+0x0]
     80482cb: c3                    ret
     80482cc: 31 c0                 xor    eax,eax
     80482ce: 40                    inc    eax
     80482cf: c3                    ret
The actual source code to that subroutine looks like this:

    proc read_term
            do read_factor
            jnz 1f                  # if it failed, skip ahead
            push %eax               # save returned term
            do read_term            # recursive call for tail of term
            push %eax
            do skip_whitespace
            pop %ecx
            pop %eax
            do cons                 # XXX tail call
            ret
    1:      setnil %eax             # return nil if no factor found
            ret
I didn't do this to make it harder to disassemble, but it does have that drawback.

In 32-bit ARM code you have the additional problem that you have to know whether the T bit is intended to be set when the CPU is decoding a particular subroutine. The low bit of the branch destination tells you — which is fine if it's statically reachable, but you may have to guess if it's only dynamically reachable.

Re:LLMs can read and write executables byte by byte from a h... by tancop on Sunday November 22, 2026 @02:31PM (#50603044)
These unusual things are pretty common in malware and DRM protected games, aka the main use cases for AI reverse engineering. You can also find functions that are passed to external code as a pointer and never called directly.
Re:LLMs can read and write executables byte by byte from a h... by kragen on Monday November 23, 2026 @08:17AM (#50611166)
> malware and DRM protected games

You seem to be repeating yourself.

(I agree.)

Re:LLMs can read and write executables byte by byte from a h... by MiroslavPokorny on Sunday November 22, 2026 @12:46AM (#50596662)
Thats because those authors dont know the difference between the two terms, which is precisely the problem.
Re:LLMs can read and write executables byte by byte from a h... by xyzsparetimexyz on Saturday November 21, 2026 @06:07PM (#50594543)
Matching decompilation is very tricky, but the decompiled output that ghidra spits out is good enough for many cases and is not significantly more computationally than getting a disassembly.
Re:LLMs can read and write executables byte by byte from a h... by userbinator on Saturday November 21, 2026 @10:25PM (#50595922)
disassembly (computationally cheap)

Only if you do "straight line" disassembly. On the other hand, code/data separation is extremely intensive, especially when indirect branches are involved, and approaches a decompiler in computational effort.

Re:LLMs can read and write executables byte by byte from a h... by Jaxan on Sunday November 22, 2026 @04:03AM (#50597646)
IIRC even disassembly is undecidable. The hardness indeed comes from jumps, you don’t know where instructions start (they don’t all have the same number of bytes).
Re:LLMs can read and write executables byte by byte from a h... by solyin on Sunday November 22, 2026 @09:29AM (#50600038)
Not all ISAs are variable-length.
Re:LLMs can read and write executables byte by byte from a h... by pigpag on Saturday November 21, 2026 @10:50PM (#50596045)
Assembly code is almost just machine code, which itself is nothing magical. Human cannot work with machine code because of the logical complexity, not because it's hex.