HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
lunixbochs
usercorn
Go2015–2017
lunixbochs / usercorn

usercorn

dynamic binary analysis via platform emulation

4Distinct people
7Mentions
0Explicit recommenders
908GitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

dynamic binary analysis via platform emulation

GitHub

Where it is used

No documented product use has been verified yet.

What people are saying

No recommendation phrase was found in the indexed comments.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

No other repository is repeatedly linked in the same discussions.

This week on Hacker News

Nov 7–Nov 14 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/14/2026, 5:04:57 PM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by month7 dated mentions

Observed mentions: 2015-08-23 13:45:21 UTC to 2017-01-21 20:31:57 UTC.

0122015-08-01 00:00:00 UTC to 2015-09-01 00:00:00 UTC (exclusive): 1 mentions; 1 submissions, 0 commentsAug 20152015-09-01 00:00:00 UTC to 2015-10-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2015-10-01 00:00:00 UTC to 2015-11-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2015-11-01 00:00:00 UTC to 2015-12-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2015-12-01 00:00:00 UTC to 2016-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2016-01-01 00:00:00 UTC to 2016-02-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2016-02-01 00:00:00 UTC to 2016-03-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2016-03-01 00:00:00 UTC to 2016-04-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2016-04-01 00:00:00 UTC to 2016-05-01 00:00:00 UTC (exclusive): 2 mentions; 1 submissions, 1 commentsApr 20162016-05-01 00:00:00 UTC to 2016-06-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2016-06-01 00:00:00 UTC to 2016-07-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2016-07-01 00:00:00 UTC to 2016-08-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2016-08-01 00:00:00 UTC to 2016-09-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2016-09-01 00:00:00 UTC to 2016-10-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2016-10-01 00:00:00 UTC to 2016-11-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2016-11-01 00:00:00 UTC to 2016-12-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2016-12-01 00:00:00 UTC to 2017-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2017-01-01 00:00:00 UTC to 2017-02-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 commentsJan 2017

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
Aug 20152015-08-01 00:00:00 UTC2015-09-01 00:00:00 UTC110
Sep 20152015-09-01 00:00:00 UTC2015-10-01 00:00:00 UTC000
Oct 20152015-10-01 00:00:00 UTC2015-11-01 00:00:00 UTC000
Nov 20152015-11-01 00:00:00 UTC2015-12-01 00:00:00 UTC000
Dec 20152015-12-01 00:00:00 UTC2016-01-01 00:00:00 UTC000
Jan 20162016-01-01 00:00:00 UTC2016-02-01 00:00:00 UTC000
Feb 20162016-02-01 00:00:00 UTC2016-03-01 00:00:00 UTC101
Mar 20162016-03-01 00:00:00 UTC2016-04-01 00:00:00 UTC000
Apr 20162016-04-01 00:00:00 UTC2016-05-01 00:00:00 UTC211
May 20162016-05-01 00:00:00 UTC2016-06-01 00:00:00 UTC000
Jun 20162016-06-01 00:00:00 UTC2016-07-01 00:00:00 UTC000
Jul 20162016-07-01 00:00:00 UTC2016-08-01 00:00:00 UTC000
Aug 20162016-08-01 00:00:00 UTC2016-09-01 00:00:00 UTC000
Sep 20162016-09-01 00:00:00 UTC2016-10-01 00:00:00 UTC000
Oct 20162016-10-01 00:00:00 UTC2016-11-01 00:00:00 UTC101
Nov 20162016-11-01 00:00:00 UTC2016-12-01 00:00:00 UTC101
Dec 20162016-12-01 00:00:00 UTC2017-01-01 00:00:00 UTC000
Jan 20172017-01-01 00:00:00 UTC2017-02-01 00:00:00 UTC101

What Hacker News says

7 sources
I did something similar for one of my projects (github.com/lunixbochs/usercorn) if you want another perspective. My primary goal was `make` would work out of the box in most environments (on OS X / Linux), even if you did not have Go installed at all. This includes downloading the Go binaries for your platform, building three C libraries, fixing gopath, and automatically determining packages for `go get`. https://github.com/lunixbochs/usercorn/blob/master/Makefile
In Hellogopher – Just “git clone” and “make” any Go project
Good question. Given the well documented and stable x86/x86_64 Linux ABIs, it should be at least as feasible as the Darling project. I've been watching projects like Darling and libhybris (run Android bionic libc binaries on glibc) but I haven't seen any project for running Linux ELFs on macOS specifically. Projects like usercorn are already emulating lots of Linux syscalls on non-Linux hosts. Things are even easier if you can ignore the binary emulation and just focus on melding the two different ABIs and APIs. I used usercorn to try and debug an Android shared lib on macOS. I got some of the SO to correctly execute (full dynamic linking wasn't working) but it did require light patching of usercorn. I would have had less issues if I was emulating a Android guest on Linux host (instead of macOS host) since you're syscall mappings are almo
Read the rest
In Darling – MacOS translation layer for Linux
I have a few semi-active projects that could use some love. I'm struggling with RSI right now and have way more creative energy than I can channel, so I'd also be interested in pair programming on my projects via video or in person (Bay Area). All of these projects are MIT-licensed, and I'm pretty good about filing GitHub issues for things that need to happen. Email/Twitter in profile. - - - Usercorn - https://github.com/lunixbochs/usercorn Skills: Go, C, Syscall ABI Usercorn is a sort of debugging tool, kernel API emulator, and CPU emulator (powered by Unicorn Engine) rolled into one. It's hard to simply explain the vision but it can do things like run a MIPS Linux binary on x86_64 OS X (kinda like a more powerful qemu-user). Plenty of GitHub issues here, but the main work needed right now: Fixing up bugs related to glibc, dyld, and othe
Read the rest
r runtimes. x86_64 Linux is the best supported loader right now, so the rest could use some love. There's progress being made on OS X / iOS + dyld startup right now. Support for issuing signals to the guest CPU (need a signal handler table on a process's kernel structure, a syscall handler for `signal` and `sigaction`, and code that can jump the guest CPU into a signal handler and do a `sigreturn`) More syscall emulation (~50/350 syscalls are implemented for Linux and OS X), but it's pretty easy to add new ones. Support for guest threading and fork/clone (these will likely need a virtual process/thread table, then each thread/process can run on a Goroutine and take advantage of Go's existing scheduler). Virtual filesystem layer, so syscalls like open/read/write don't go directly to the host OS and can be intercepted/overlaid in a more general sense. - - - lib43 - https://github.com/lunixbochs/lib43 Skills: C, ASM, Syscall ABI Yet another libc, created as a result of this blog post: http://ryanhileman.info/posts/lib43 - mostly just has string, memory, number, and basic IO functions right now. Ways to contribute: Pick a man page for any missing libc function and implement it in a simple/readable manner, or dive into an architecture syscall ABI (like ARM/NetBSD) and write the assembly backend for it. https://github.com/lunixbochs/lib43 - - - glshim - https://github.com/lunixbochs/glshim Skills: C, OpenGL This provides desktop OpenGL ~1.5 sans shaders to any mobile device implementing OpenGL ES 1.0. It has been used to port dozens of open and closed-source games to the Pandora and other mobile platforms. It was also used for the Android real-Minecraft launcher (called Boardwalk I think). Current goals include testing/improving the remote rendering (which allows software like emulators to easily serialize and remotely render OpenGL), increasing compatibility (testing games + filing/fixing issues on GitHub), adding WINE support (will be a trial/error process of running WINE, debugging/fixing the thing that prevents initialization, repeat), and writing more feature tests (which are actually pretty easy. You write a simple program to make OpenGL calls and assert which OpenGL ES calls should be emitted from the other end). - - - patchkit - https://github.com/lunixbochs/patchkit Skills: Python, C, ASM This project allows you to reproducibly patch compiled binaries with one or more short Python scripts. It includes an assembler (Keystone), disassembler (Capstone), basic linker, basic static recompilation/code transformation engine, control flow graph, and C compiler integrations... all in about 700 lines of Python. It was mostly created for use in attack-defense Capture The Flag competitions. These are both working patches: def patch(pt): pt.patch(0x800400a, asm='mov eax, 1') def patch(pt): pt.patch(pt.entry, c='void f() { printf("hi\n"); }') It mainly needs glue code written for more architectures, support for PE/MachO formats, and improvements to the C compiler/linker. The provided symbols are mostly specific to Darpa's DECREE environment, so support should be added for yanking/calling symbols from the binary itself as well as integrating something like lib43 to provide a basic libc and syscall support on many platforms. - - - ActualVim - https://github.com/lunixbochs/actualvim Skills: Python This project is a massive hack to sneakily jam a Vim instance into a Sublime Text buffer. This gives you surprisingly good Vim keybinding support, and even works with your Vim plugins, but it totally breaks Sublime Text plugins and commands (as text changes won't be propagated back to Vim). As a result, the project is mostly a joke right now (just a pretty UI around Vim that breaks most interactive Vim plugins). I do think NeoVim is mature enough to take this the rest of the way into being a serious project, and there's a fair bit of interest. The Sublime Text side of the interface works very well, so the main tasks here would be (1) swapping out Vim for NeoVim (which I seem to remember having a very simple remote control API), and a (2) handler to propagate text changes back from Sublime plugins into the NeoVim buffer.
In Ask HN: Who needs contributors? (October 2016)
Author here. Usercorn at a basic level is like qemu-user in that it can load a userspace binary like ELF, MachO, etc into a CPU emulator and provide a syscall emulator interface. It's built as an API that allows instrumentation of the resulting binary. You can hook instructions, basic blocks, syscalls, memory access... You get information like stacktraces in a cross-platform manner. There are helpers to compute and display diffs of memory and registers throughout execution. There are many differences from qemu-user: -- Usercorn attempts to emulate several OS/syscall ABIs all from one binary (Linux, BSD, XNU, CGC, more to come like Redox, maybe weird stuff like Windows and DOS). qemu-user just translates arguments to your host kernel so to run a Linux binary you need a Linux host. qemu-user also has a different binary for each arch, like q
Read the rest
emu-i386 and qemu-arm. The primary usercorn binary can emulate every single supported OS/arch combination and aims automatically detect the correct arch/kernel when you run a program. Usercorn is being built as a framework around the Unicorn Engine. It's not just a way to run a binary on the command line. It can be loaded as a library (`NewUsercorn("binary").Run(args, env)` will run an arbitrary supported app). It allows hooking many things and I've been building a lot of features around static trace/analysis. I'm extremely excited about some of the features and supporting tools I have planned. This twitter thread shows examples of a tool called imgtrace I built with Usercorn. imgtrace can visualize memory writes done by a program. The Hilbert curve view of MD5 is nice, as it makes the memory containing the internal MD5 state as well as the iterators very obvious at a glance: https://twitter.com/lunixbochs/status/717945725024280578 The underlying code of imgtrace is also extremely simple (basically all of it is to create the image data), which shows off the power of Usercorn's simplicity: https://github.com/lunixbochs/usercorn/tree/master/go/cmd/im... Usercorn is much less mature than qemu-user. It supports around ~50/400 Posix syscalls and is missing many architecture-specific features. Some architectures still need work on memory segmentation and thread-local storage. I've split up functionality internally in a way that makes sense, but I'm still building the base functionality and haven't designed the public API at all yet (even though it's possible to use Usercorn from external code, that's just happenstance due to the functions/types I exposed while building it). ---- Architecture support is tied to Unicorn. Usercorn supports x86_64 best, and has various levels of support for ARM, MIPS, sparc, and m68k. It's still very much WIP, but can run many binaries at this point, even Linux binaries dynamically linked to glibc. Host support is best on OS X and Linux. Guest support is best on Linux.
In Usercorn – a versatile kernel+system+userspace emulator
ktrace doesn't exist anymore on OS X as far as I know. You need to use dtrace, which means you need to write dtrace programs. Python's dtrace interface would probably only let you load a dtrace program. It might be possible to implement `maybe` as a dtrace program by instrumenting syscall entry and raising a signal or stopping the program immediately, which you can recover in your debugger (though I'm not sure if this actually stops the syscall). That said, I tried it and OS X doesn't seem to allow "destructive" dtrace actions even as root with SIP disabled: $ sudo dtrace -n 'syscall::open:entry { stop(); }' -c 'cat Makefile' dtrace: could not enable tracing: Destructive actions not allowed $ sudo dtrace -n 'syscall::open:entry { raise(9); }' -c 'cat Makefile' dtrace: could not enable tracing: Destructive actions not allow
Read the rest
ed Alternately you can use dynamorio, intel pin, qemu, or a quick instruction scan/patch for SYSCALL to manually break on syscalls. Either way you almost certainly will not be able to do this with python-ptrace alone. I filed an issue to write a `maybe` tool using Usercorn [1] (which supports OS X) with my VFS overlay work, which means writes could still succeed but be non-destructive. [1] https://github.com/lunixbochs/usercorn/issues/151
In Maybe: run a command, see what it does to your files without actually doing it

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.