Git Product home page Git Product logo

tdiss's Introduction

TDiss is a disassembler for x86 / x86-64 (AMD64)

Initially built to power runtime hooking and analysis (checking for hooks)

Features

  • Supports X86 / x86-64
  • Support for most extensions (MMX,SSE1,SSE2,SSE3,SSE4.1,SSE4.1,3DNOW)
  • Zero allocations
  • Thread safe (no internal state)
  • Fast (around ~50MB/s)
  • No dependencies other than stdlib (could be removed)
  • Can be built as 32bit or 64bit (both support decoding 32bit or 64bit instructions)
  • Can handle / skip invalid bytes
  • Large set of tests
  • Tested with MSVC (Windows), GCC, Clang

Projects

The disassembler is contained within the TDiss folder, everything else is either a meta tool, tests or benchmarks.

Example

// Destination for decoded instructions
Instruction instructions[0x8];
size_t instructionCount;

// Bytes from a file or read from a running process via ReadProcessMemory, ...
const uint8_t byteCode[0x9 + 0x8] = {
		0x67, 0x0F, 0xAE, 0x3C, 0x45, 0x56, 0x04, 0x00, 0x00,  // CLFLUSH [eax*2+ 0x456]
		0x0F, 0xAE, 0x3C, 0x45, 0x56, 0x04, 0x00, 0x00	       // CLFLUSH [rax*2+ 0x456]
};

// Create a view over the bytes
CodeStream strm(0, byteCode, sizeof(byteCode), DisOptions::STOP_ON_FLOW, CodeType::CODE_64BIT);

// disassemble
DisResult::Enum result = Diss::disassemble(strm, instructions, 0x8, &instructionCount);

const Instruction& inst0 = instructions[0x0];
// inst0.opcode == InstructionID::CLFLUSH;
// inst0.size == 0x9;
// inst0.displacement == 0x456;
// ...

A more idiomatic c++ overload is also provided.

std::vector<Instruction> instructions;
DisResult::Enum result = Diss::disassemble(strm, instructions);

Building

The libary can be built as a static or shared lib.

See building.md for details.

tdiss's People

Contributors

atomicnibble avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.