univdreams

A universal compiler and decompiler suite.

Given a compiled binary B, produce source S such that compiling S reproduces B byte for byte.

Try it in your browser →

The headline property

lower_to_elf(parse(decompile_to_text(elf)))  ==  elf-bytes

Most decompilers paraphrase. They lose the choices a compiler made — register allocation, instruction encoding, instruction order, padding, jump-table layout — and a recompile of their output is structurally similar but not identical. univdreams treats those choices as first-class information in the source language: they live in attributes and directives that pin the compiler back to the same shape on the way out.

What works today

What it looks like

A decompiled function in .ud form — structured statements alongside pinned bytes that guarantee the recompile is identical:

@addr(0x2456)
fn sub_2856() #[abi="stdcall", autogen] {
    let arg_8: u32;
    let edi: u32 @reg;
    let esi: u32 @reg;
    let ebx: u32 @reg;

    IsBadWritePtr(arg_8, 24h, edi, esi) [0x8b, 0x5d, 0x08, 0x56, 0x57, ...]
    if (eax != 0) return 0; [0x85, 0xc0, 0x75, 0x31]
    IsBadReadPtr(arg_8, 24h) [0x6a, 0x24, 0x53, 0xff, 0x15, ...]
    if (eax != 0) return 0; [0x85, 0xc0, 0x75, 0x24]
    @epilogue("saves-imm", saves: [edi, esi, ebx], pop_frame, ret_imm: 0x4)
}

Try it

The browser playground runs the full pipeline in WebAssembly. Upload an ELF, PE, Mach-O, or 6502 raw image — it decompiles to .ud. Edit the source — it recompiles to bytes you can download. Same code path as the ud CLI; same round-trip guarantee.