Keystone is a lightweight multi-architecture assembler framework originally developed by Nguyen Anh Quynh et al. and released under GPLv2.
To use the Keystone.js in your web application, download and include it with:
or install it through 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 a.option(ks.OPT_SYNTAX, ks.OPT_SYNTAX_INTEL); // Assemble instructions var result = a.asm(assembly); /* result.failed = false; */ /* result.count = 5; */ /* result.mc = new Uint8Array([0x48, 0xFF, 0xC0, 0xE8, ...]); */ // Close encoder a.close();