Post #1825659
2026-04-23 02:43 UTC
One of the (private) responses I got to my post about Theseus was someone asking if it can handle packed executables. It can't, of course, because they unpack more code at runtime.
But they totally nerd sniped me because for a one-time unpack I could just as well run two phases: first use Theseus to run the unpacker, modified to write out an executable, then run Theseus again on that.
In fact, there's a cooler variation I thought of, which I implemented!
Replies (1)
-
@evmar@inuh.net 2026-04-23 02:45
The variation is: first run Theseus on the packed executable, producing a program that unpacks and then jumps to a dynamic address (the address of the unpacked code, which Theseus didn't see to translate). Then modify that program to implement that address, and implement it by a function that calls back into the Theseus compiler to generate source code directly. No intermediate exe serialization needed! The unpacker has the unpacked data in memory, so I can codegen directly from there.