Vibeleaderboard
← All Intel
Intel / article

LLMs can read and write executables byte by byte from a hex dump

Source
sgiannopoulos.github.io
Author
fortran77
Date

Context

George Xenos and Sotiris Giannopoulos report that OpenAI's GPT-6.1 Sol could read, modify and write small x86-64 programs working only from their raw bytes, with no compiler, disassembler or other tool in the loop (blog post). Programs normally reach the processor as machine code that a compiler produces from human-written source, and people who study a compiled file use disassemblers and decompilers to turn its bytes back into something readable. The authors instead pasted a hex dump into the prompt, a listing that writes each byte of the file as two hexadecimal digits, at about 2.4 tokens per byte. A local relay removed every tool from each request and audited what came back, and the model got one reply with no feedback and no second try. The post borrows its questions and format from an MIT CSAIL post in which GPT-6 Astra improved a neural network by editing its weights directly, and asks the same question of compiled code.

Where the results could be checked by running the program, they held up. For each of three programs the authors had written, the model was asked for one new feature as a list of byte edits, each the same length as the bytes it replaced, such as making a word counter also print the length of its longest line, which took 74 changed bytes. It found unused padding in the file, edited the segment headers so that padding could hold executable code, wrote the new code there and changed existing instructions to call it. All three patched programs passed hidden tests in which their output and exit code had to match reference builds from the GCC compiler byte for byte. Given only a written description, the model also wrote all three programs from scratch as complete ELF64 files, the executable format Linux uses, working out every header, jump and call itself; all three matched the reference on every case, and the word counter came to 391 bytes against 5,432 for the GCC build. Reading was not formally scored, but the model identified what each of four programs was, including FreeBSD's ministat statistics tool, which the authors compiled with optimization, stripped of symbols and text, and partly disguised by hiding three of its strings. In ministat's table of statistical constants, it noticed that the option labeled 99.5% confidence uses values for about 99.8%, a bug the authors then confirmed in the original source.

The malware test rests on a single sample, and the authors spell out what their checks did and did not confirm. They gave the model a real 4,608-byte Windows executable without saying it was malicious. Its only visible imported was Sleep; its other Windows functions were hidden behind name hashes, and its strings were built by its instructions on the stack rather than stored as readable text. In 211 seconds the model concluded that it downloads machine code from a hardcoded server, 165.154.205.34 on port 443, and runs it in memory. Comparing afterwards with a public sandbox analysis of the same file from VMRay, the authors found the same address and the same request URL, and they recomputed all 13 function-name hashes the model had decoded. The sandbox did not confirm the model's 10-second retry or the single-byte key it said decodes the download, though public reports on this malware family give the same key. The comparison covers one sample and one run, and the authors note that the rotate-right-13 hashing scheme is common in public tooling, so recognizing it probably helped. A repeat with DeepSeek V4.1 Flash, whose weights are public, reached the same conclusion using about 17 times as many reasoning tokens, named 9 of the 13 hidden functions correctly and misnamed one parameter in the URL. The authors call that preliminary: it ran through a hosted provider whose build of the model they could not identify, under a different harness that recorded no tool calls but skipped their settings for disabling servers and connected one it inherited, and without the relay, so they could not verify which tools, if any, were included in the provider request.

The authors read these results as an early sign that models may come to write machine code directly and that disassemblers may turn out to be optional for a model. That is a forecast; the experiments show something narrower, one attempt per program on programs no larger than 67 KB, with outputs checked by running them where possible. Size is the limit the authors call hard. At about 2.4 tokens per byte, the 67 KB binary took about 163,000 tokens, a 10 MB program would need about 24 million, and they do not know how quality holds up on the way to that limit. They suggest a harness based on Recursive Language Models, which keeps a long input outside the model's and lets the model inspect pieces and call itself on them, as one way forward.

Terms in this piece · Glossary
  • Function — A named block of instructions that takes inputs, called arguments, and hands back a result, called its return value.
  • Model Context Protocol (MCP) — A published agreement for an AI application to discover what a separate program offers and ask it to run one of those offerings.
  • Context and context window — Context is the information available for a generation; the context window is the capacity available to hold it.
  • Large language model — A model trained on large amounts of data to process and generate language.
Read the source sgiannopoulos.github.io
Recommended reads
Comments

Checking sign-in…

Loading comments…