Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
55 lines (41 sloc) 2.08 KB


Port of the Keystone assembler framework for JavaScript. Powered by Emscripten.

Notes: Keystone is a lightweight multi-architecture assembler framework originally developed by Nguyen Anh Quynh et al. and released under a dual license GPLv2 and the possibility of its commercial usage. More information about contributors and license terms can be found in the files AUTHORS.TXT, CREDITS.TXT and the files mentioned by the License section in inside the keystone submodule in this repository.


To add Keystone.js to your web application, include it with:

<script src="keystone.min.js"></script>

or install it with the Bower command:

bower install keystonejs


// Input: Assembly
var assembly = `
  inc   rax;
  call  0x10040;
  mov   rax, qword ptr[rdx + 4];
  sub   esp, 0x100;
  pop   rbx;

// Initialize the encoder
var a = new ks.Keystone(ks.ARCH_X86, ks.MODE_64);

// Choose preferred syntax

// Assemble instructions
var result = a.asm(assembly);
/* result.failed = false; */
/* result.count = 5; */
/* = new Uint8Array([0x48, 0xFF, 0xC0, 0xE8, ...]); */

// Close encoder


To build the Keystone.js library, clone the master branch of this repository, and do the following:

  1. Initialize the original Keystone submodule: git submodule update --init.

  2. Install the latest Python 2.x (64-bit), CMake and the Emscripten SDK. Follow the respective instructions and make sure all environment variables are configured correctly. Under Windows MinGW (specifically mingw32-make) is required.

  3. Install the development dependencies with: npm install.

  4. Finally, build the source with: grunt build.