Skip to content

Cheatron/cheatron-keystone

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

@cheatron/keystone

TypeScript/FFI bindings for the Keystone assembler engine with full OOP support.

Features

  • Full Keystone APIks_open, ks_asm, ks_close, ks_option and more
  • OOP WrapperKeystone base class and KeystoneX86 for x86/x64
  • Type-safe Enums — Auto-generated from keystone.h (ks_arch, ks_mode, ks_err, ks_opt_type, etc.)
  • Auto CleanupFinalizationRegistry + explicit close() for deterministic resource management
  • Dynamic DLL Resolutionkeystone.dll bundled in deps/, resolved via import.meta.url

Install

bun add @cheatron/keystone

Usage

import { KeystoneX86 } from '@cheatron/keystone';

const ks = new KeystoneX86(); // defaults to 64-bit mode

const bytes = ks.asm('MOV RAX, RBX');
console.log(bytes); // [0x48, 0x89, 0xD8]

// Multi-line assembly
const prologue = ks.asm('push rbp; mov rbp, rsp; sub rsp, 0x20');
console.log(prologue);

// With base address
const code = ks.asm('jmp 0x1000', 0xff0n);

ks.close();

License

MIT

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors