All Projects → asmjit → Asmtk

asmjit / Asmtk

Licence: other
Assembler toolkit based on AsmJit

Programming Languages

cpp
1120 projects

Labels

Projects that are alternatives of or similar to Asmtk

Distorm
Powerful Disassembler Library For x86/AMD64
Stars: ✭ 829 (+532.82%)
Mutual labels:  x86, x86-64
Reverse Engineering
This repository contains some of the executables that I've cracked.
Stars: ✭ 29 (-77.86%)
Mutual labels:  x86, x86-64
Beelzebub
The Lord of Flies - A hobby operating system
Stars: ✭ 24 (-81.68%)
Mutual labels:  x86, x86-64
X86 Assembly Cheat
MOVED TO: https://github.com/cirosantilli/linux-kernel-module-cheat#userland-assembly SEE README. x86 IA-32 and x86-64 userland minimal examples tutorial. Hundreds of runnable asserts. Nice GDB setup. IO done with libc, so OS portable in theory. NASM and GAS covered. Tested in Ubuntu 18.04. Containers (ELF), linking, calling conventions. System land cheat at: https://github.com/cirosantilli/x86-bare-metal-examples, ARM cheat at: https://github.com/cirosantilli/arm-assembly-cheat
Stars: ✭ 773 (+490.08%)
Mutual labels:  x86, x86-64
Unisimd Assembler
SIMD macro assembler unified for ARM, MIPS, PPC and x86
Stars: ✭ 63 (-51.91%)
Mutual labels:  x86, x86-64
Rappel
A linux-based assembly REPL for x86, amd64, armv7, and armv8
Stars: ✭ 818 (+524.43%)
Mutual labels:  x86, x86-64
Reko
Reko is a binary decompiler.
Stars: ✭ 942 (+619.08%)
Mutual labels:  x86, x86-64
Rop Tool
A tool to help you write binary exploits
Stars: ✭ 590 (+350.38%)
Mutual labels:  x86, x86-64
Fasmg
flat assembler g - examples library
Stars: ✭ 56 (-57.25%)
Mutual labels:  x86, x86-64
Dennix
Dennix is a unix-like hobbyist operating system written from scratch.
Stars: ✭ 53 (-59.54%)
Mutual labels:  x86, x86-64
Arm now
arm_now is a qemu powered tool that allows instant setup of virtual machines on arm cpu, mips, powerpc, nios2, x86 and more, for reverse, exploit, fuzzing and programming purpose.
Stars: ✭ 719 (+448.85%)
Mutual labels:  x86, x86-64
Keystone
Keystone assembler framework: Core (Arm, Arm64, Hexagon, Mips, PowerPC, Sparc, SystemZ & X86) + bindings
Stars: ✭ 1,654 (+1162.6%)
Mutual labels:  x86, x86-64
Squalr
Squalr Memory Editor - Game Hacking Tool Written in C#
Stars: ✭ 645 (+392.37%)
Mutual labels:  x86, x86-64
X64dbg
An open-source x64/x32 debugger for windows.
Stars: ✭ 37,825 (+28774.05%)
Mutual labels:  x86, x86-64
Remill
Library for lifting of x86, amd64, and aarch64 machine code to LLVM bitcode
Stars: ✭ 633 (+383.21%)
Mutual labels:  x86, x86-64
Keypatch
Multi-architecture assembler for IDA Pro. Powered by Keystone Engine.
Stars: ✭ 939 (+616.79%)
Mutual labels:  x86, x86-64
Capstone
Capstone disassembly/disassembler framework: Core (Arm, Arm64, BPF, EVM, M68K, M680X, MOS65xx, Mips, PPC, RISCV, Sparc, SystemZ, TMS320C64x, Web Assembly, X86, X86_64, XCore) + bindings.
Stars: ✭ 5,374 (+4002.29%)
Mutual labels:  x86, x86-64
The holy book of x86
A simple guide to x86 architecture, assembly, memory management, paging, segmentation, SMM, BIOS....
Stars: ✭ 577 (+340.46%)
Mutual labels:  x86, x86-64
Binary Exploitation
Good to know, easy to forget information about binaries and their exploitation!
Stars: ✭ 47 (-64.12%)
Mutual labels:  x86, x86-64
Neatcc
A small arm/x86(-64) C compiler
Stars: ✭ 86 (-34.35%)
Mutual labels:  x86, x86-64

AsmTK

Assembler toolkit based on AsmJit.

Introduction

AsmTK is a sister project of AsmJit library, which provides concepts that are useful mostly in AOT code-generation.

Features

  • Both X86 and X64 modes are supported and can be selected at runtime (i.e. they not depend on how your application is compiled).
  • Asm parser can parse everything that AsmJit provides (i.e. supports all instruction sets, named labels, etc...).
  • Asm parser can also parse instruction aliases defined by AsmTK (like movsb, cmpsb, sal, ...). AsmJit provides just generic movs, cmps, etc... so these are extras that are handled and recognized by AsmTK.
  • Assembles to any BaseEmitter, which means that you can choose between Assembler and BaseBuilder at runtime, and that the result can be post-processed as well
  • More to be added...

TODO

  • [ ] More aliases to some SIMD instructions (to be added).
  • [ ] Implement asmtk::Linker that will add the possibility to write shared libraries and executables.

AsmParser Usage Guide

Assembler parsing is provided by AsmParser class, which emits to BaseEmitter:

#include <asmtk/asmtk.h>

using namespace asmjit;
using namespace asmtk;

// Used to print binary code as hex.
static void dumpCode(const uint8_t* buf, size_t size) {
  enum { kCharsPerLine = 39 };
  char hex[kCharsPerLine * 2 + 1];

  size_t i = 0;
  while (i < size) {
    size_t j = 0;
    size_t end = size - i < kCharsPerLine ? size - i : size_t(kCharsPerLine);

    end += i;
    while (i < end) {
      uint8_t b0 = buf[i] >> 4;
      uint8_t b1 = buf[i] & 15;

      hex[j++] = b0 < 10 ? '0' + b0 : 'A' + b0 - 10;
      hex[j++] = b1 < 10 ? '0' + b1 : 'A' + b1 - 10;
      i++;
    }

    hex[j] = '\0';
    puts(hex);
  }
}

int main(int argc, char* argv[]) {
  // Setup CodeHolder for X64.
  CodeInfo ci(Environment::kArchX64);
  CodeHolder code;
  code.init(ci);

  // Attach x86::Assembler `code`.
  x86::Assembler a(&code);

  // Create AsmParser that will emit to x86::Assembler.
  AsmParser p(&a);

  // Parse some assembly.
  Error err = p.parse(
    "mov rax, rbx\n"
    "vaddpd zmm0, zmm1, [rax + 128]\n");

  // Error handling (use asmjit::ErrorHandler for more robust error handling).
  if (err) {
    printf("ERROR: %08x (%s)\n", err, DebugUtils::errorAsString(err));
    return 1;
  }

  // Now you can print the code, which is stored in the first section (.text).
  CodeBuffer& buffer = code.sectionById(0)->buffer();
  dumpCode(buffer.data(), buffer.size());

  return 0;
}

You should check out the test directory to see how AsmTK integrates with AsmJit.

Support

Please consider a donation if you use the project and would like to keep it active in the future.

  • BTC: 14dEp5h8jYSxgXB9vcjE8eh78uweD76o7W
  • ETH: 0xd4f0b9424cF31DF5a5359D029CF3A65c500a581E
  • Please contact the author if you would still like to donate through a different channel or use a different crypto-currency.

Authors & Maintainers

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].