# WinRAR Archives Can Run Bytecode, and One Hacker Built a Toolchain to Program Them

Original title: Fun with Constrained Programming

> Hacker News story 50503492 · language: en · submitted 2026-11-15
> Web version: https://zeli.app/story/50503492
> About this feed: https://zeli.app/llms.txt · Agent guide: https://zeli.app/skill.md

▲ 102 · by [colejohnson66](<https://news.ycombinator.com/user?id=colejohnson66>) · 💬 6
[original](<https://blog.cmpxchg8b.com/2012/09/fun-with-constrained-programming.html>) · [HN discussion](<https://news.ycombinator.com/item?id=50503492>)

## Summary

RAR files can embed bytecode for the RarVM, a small x86-like virtual machine that runs reversible filters to boost compression. WinRAR lets archives define new filters at runtime, but no tool existed to explore this, so the author built an assembler, linker, and documentation. Because WinRAR checks output against a stored CRC, he ported a CRC compensation algorithm to RarVM so programs can produce dynamic output and patch it at runtime to match.

## Key quote

> Needless to say, programming something as ridiculous as WinRAR presents some interesting challenges, but the fact that it's so widely deployed presents some fun possibilities.

## HN discussion (6 comments)

### [hcs](<https://news.ycombinator.com/item?id=50542243>)

> Neat! I've messed with something similar for ZPAQ, didn't realize RAR had it as well. And for a long time, this might need (2012)
>
> In my case I wanted to compress CD subcodes, most of the unpredictability for these is from a CRC16 on every frame, so I made a filter to xor that out and then back in. If anyone finds that amusing: https://gist.github.com/hcs64/84d981f42cc9f3cfb0f4fc8b37d447...

### [lexicality](<https://news.ycombinator.com/item?id=50543776>)

> I remember hearing rumours in the 2010s about rar files being dangerous because they could execute code when you unrar'd them, but never any actual details.
>
> I wonder how secure that VM actually is? Presumably you could use a filter to encrypt your malware payload on disk to hide from passive virus scanners, but can you detect how/what is running the decryption and provide different files for virustotal vs the actual user's computer?

### [lgas](<https://news.ycombinator.com/item?id=50543175>)

> Wow, never would've thought the RAR format had a whole VM built into it.

---

## Cite

- Page: https://zeli.app/story/50503492
- Date: 2026-11-15
- Source: blog.cmpxchg8b.com (https://blog.cmpxchg8b.com/2012/09/fun-with-constrained-programming.html)
- Hacker News: https://news.ycombinator.com/item?id=50503492

## Other languages

- zh: https://zeli.app/zh/story/50503492 · markdown: https://zeli.app/zh/story/50503492.md
- ja: https://zeli.app/ja/story/50503492 · markdown: https://zeli.app/ja/story/50503492.md
- ko: https://zeli.app/ko/story/50503492 · markdown: https://zeli.app/ko/story/50503492.md
- de: https://zeli.app/de/story/50503492 · markdown: https://zeli.app/de/story/50503492.md
- es: https://zeli.app/es/story/50503492 · markdown: https://zeli.app/es/story/50503492.md
- ru: https://zeli.app/ru/story/50503492 · markdown: https://zeli.app/ru/story/50503492.md
