Categorygithub.com/For-ACGN/go-keystone
modulepackage
1.0.5
Repository: https://github.com/for-acgn/go-keystone.git
Documentation: pkg.go.dev

# README

go-keystone

WASM based bindings for the Keystone assembler.

Features

Since Keystone is compiled into a wasm module and a pure go-implemented wasm runtime wazero is used, calling the C program is implemented while retaining cross-compilation.

Usage

keystone -arch x86 -mode 32 -src hello.asm -out hello.bin

Development

package main

import (
    "fmt"
    "os"

    "github.com/For-ACGN/go-keystone"
)

func main() {
    engine, err := keystone.NewEngine(keystone.ARCH_X86, keystone.MODE_64)
    checkError(err)
    defer func() { _ = engine.Close() }()

    err = engine.Option(keystone.OPT_SYNTAX, keystone.OPT_SYNTAX_INTEL)
    checkError(err)

    src := ".code64\n"
    src += "xor rax, rax\n"
    src += "ret\n"
    inst, err := engine.Assemble(src, 0)
    checkError(err)

    // [0x48, 0x31, 0xC0, 0xC3]
    fmt.Println(inst)
}

func checkError(err error) {
    if err != nil {
        fmt.Println(err)
        os.Exit(1)
    }
}

# Packages

No description provided by the author

# Functions

NewEngine is used to create keystone engine above wasm interpreter.
StringToArch is used to convert string to arch.
StringToMode is used to convert string to mode.
StringToSyntax is used to convert string to syntax.

# Constants

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Structs

Engine contain wasm runtime and keystone engine.

# Type aliases

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author