Neural decompilation
PRAMEN

From assembly
back to C.

Pramen is my neural decompiler for Windows and MS-DOS. It takes a single function’s assembly and proposes readable C. I trained it from scratch, on assembly and C alone.

parameters
223 M
ASM → C training pairs
5.26 M
bit · DOS and Windows
16 / 32 / 64
model weights and code
Apache-2.0
01 / Example

One function. Readable again.

An actual saved model output for string length. This variant passed the repository’s tests; this is not live inference in the browser.

Assembly → Cmsvc-x86-O2
Input · assembly
MOV ECX,dword ptr [ESP + 4]
MOV EAX,ECX
CMP byte ptr [ECX],0
JE LAB_1
NOP dword ptr [EAX + EAX]
LAB_2:
INC EAX
CMP byte ptr [EAX],0
JNE LAB_2
LAB_1:
SUB EAX,ECX
RET
Output · Pramen
size_t strlen(const char *str)
{
 const char *p = str;
 while (*p)
  p++;
 return p - str;
}
Tests passed per repositorySaved example · string length ↗

The output is a proposal. Names are invented, types are inferred and the logic needs checking. It does not recover the original source code verbatim.

02 / Targets

From DOS to Windows x64.

Six variants for specific compilers and optimization levels. The included normalizer handles input from dumpbin, wdis or Ghidra.

MSVC 19.36

Windows x64

64-bit code, unoptimized and with /O2.

msvc-x64-Od / msvc-x64-O2
MSVC 19.36

Windows x86

32-bit cdecl code, unoptimized and with /O2.

msvc-x86-Od / msvc-x86-O2
Open Watcom V2

MS-DOS

16-bit real mode: unoptimized small model and large model with far calls and -ox.

dos16-small-od / dos16-large-ox
03 / HumanEval-C

How the model performs.

A task counts as solved when the generated C compiles and passes the original tests. HumanEval-C is recompiled with the same toolchains as the training data.

Greedy decoding, up to 600 new tokens. Optimized code is much harder; common failures include parameter types and invented helper names. The model card does not report a result for msvc-x86-O2.

Methodology and results ↗
Tasks passing the original tests
VariantTasksPass rate
msvc-x64-Od16740.7 %
msvc-x64-O216713.2 %
msvc-x86-Od16732.3 %
dos16-small-od16330.1 %
dos16-large-ox16311.7 %
04 / Training

A small model. A specific task.

A GPT-2-style decoder-only transformer: 16 layers, 16 attention heads, a 4,096-token context and a custom 16,384-token tokenizer.

Training uses 5.26 million assembly → C pairs from ExeBench (2.33 billion tokens), compiled six ways and deduplicated, plus 3.5 billion tokens of C/C++ source code.

Pramen handles one function at a time, up to roughly 3,500 input tokens. Compilers other than MSVC 19.36 and Open Watcom V2 are outside its training distribution. Globals and structs are only visible as addresses and offsets.

Run it locally

Weights, code and examples.

Download the model and start the Python web UI at 127.0.0.1:8780. A GPU is recommended; CPU inference works but is slow.

Documentation on Hugging Face ↗
pip install huggingface_hub
hf download radix16/pramen --local-dir pramen
cd pramen
pip install -r requirements.txt
python -m pramen.web

Use the included Python runtime. The custom tokenizer is not compatible with standard text prompts in llama.cpp / LM Studio.

Source: Pramen model card and examples, as of October 6, 2026. Weights and code: Apache-2.0. Training sources retain their original licenses and include GPL-2.0; see the model repository for details.