NewsCrawler.org

LLMs read, patch and write machine code byte by byte, with no tools

The author tested whether a general-purpose LLM can read, patch and write executables from raw bytes, without a compiler, a disassembler[1] or running the program. From hex dumps alone, the model Sol 6.1 identified three programs the author wrote and FreeBSD's ministat, and found a bug in ministat: the option labeled 99.5% confidence uses critical values for about 99.8%. The author confirmed the bug in the source code using Claude. For three programs, the model returned lists of byte edits, and all three patched versions passed the hidden tests.

The model also wrote three complete ELF64[2] programs from a written spec, and all three ran and matched the reference on every case. On a 4,608-byte PE32+[3] malware sample, Sol 6.1 concluded in 211 seconds that the file downloads machine code and runs it in memory, and named the server 165.154.205.34 on port 443. A public VMRay analysis of the same file confirmed that address and request, but not the 10-second retry or the XOR key itself. This comparison covers one sample and one run.

The main limit is context size: a hex dump costs about 2.4 tokens per byte, so the 67 KB binary took about 163,000 tokens. The authors suggest a harness based on Recursive Language Models[4] as a way forward. A repeat with DeepSeek V4.1 Flash, whose weights are public under an MIT license, reached a similar result using about 17 times as many reasoning tokens.

Read the original sgiannopoulos.github.ioDiscussion

Discussion

Commenters are mostly skeptical that LLMs should write machine code directly: they say compilers and decompilers are still needed, and that hex dumps waste context. Others report that models already help with binaries when debugging, and one raises the possibility of prompt injection through an executable.

Sources

Published: First seen: Читать по-русски

Open as a page