Remix.run Logo
Unicorn – The Ultimate CPU Emulator(unicorn-engine.org)
33 points by tosh 5 hours ago | 10 comments
bmenrigh 2 hours ago | parent | next [-]

I was just looking at Unicorn last week because it's used by unipacker to do automated unpacking of binaries. I built a "toolbox" for gpt-5.5 to do semi-automated malware and exploit reverse engineering and unipacker is sometimes useful for that purpose.

harvie an hour ago | parent | prev | next [-]

"Based on Qemu 5, we built Unicorn2 from scratch"

What?

jsomedon an hour ago | parent | prev [-]

uh.. what is a cpu emulator? or what can I do with it? I am kind of having hard time comprehend this.

hylaride an hour ago | parent | next [-]

Low-level debugging, older games (so many consoles have used everything from MIPS to PowerPC as CPUs), etc.

In the early 2000s, I used a linux-based emulator to virtualize some ancient manufacturing hardware control software that was still running on EOL and very expensive PA-RISC kit. It saved the company tens of thousands of dollars in new hardware, while also running faster (it involved early 1990s-era proprietary vector graphics as part of it was printing on the goods). The HP sales people were not amused and tried very hard to get my 22 year old self fired, but my manager convinced them to use it and the old hardware as a backup for awhile. Last I heard in 2011 it was still being used, though running in linux on VMware.

wavemode an hour ago | parent | prev | next [-]

An emulator is a computer program that executes the machine code of some system. For example, if your computer is x86, you can't natively run ARM machine code. But an emulator can.

QEMU is an emulator that can run entire operating systems, because it emulates hardware devices like hard drives and displays. Unicorn doesn't emulate any of those things, it only emulates the CPU. It's probably mostly useful for compiler development and security research / reverse engineering.

goodmythical an hour ago | parent | prev | next [-]

Well, say all you've got is an x86 device, but you want to develop for ARM. You can write and compile your code, push it to unicorn, and see how it runs.

Or you can use it as a sandbox serving x86 software on an x86 machine.

Or as a "virtual machine" serving say AOSP for ARM on a Windows x86 host.

There's a long list of projects using Unicorn at https://www.unicorn-engine.org/showcase/

giancarlostoro an hour ago | parent [-]

How's this one differ from QEMU?

pdhborges an hour ago | parent [-]

https://www.unicorn-engine.org/docs/beyond_qemu.html

bux93 an hour ago | parent | prev | next [-]

This comparison to qemu gives some idea: https://www.unicorn-engine.org/docs/beyond_qemu.html

The ability to execute and inspect some code without any context (no OS, not even a complete binary) is useful for reverse/security engineering.

stephc_int13 an hour ago | parent | prev [-]

It can be used for many things. But the main use is reverse engineering.