No description
Find a file
2021-10-01 07:42:55 +07:00
.github Create FUNDING.yml 2021-10-01 07:42:55 +07:00
src bump version, add distorm's headers to incude path 2021-09-04 18:32:15 +07:00
tests Update distorm to version 3.5.2b 2021-09-04 18:20:15 +07:00
.gitignore Initial commit 2020-05-13 00:12:45 +07:00
.gitmodules initial commit 2020-05-13 00:14:46 +07:00
distorm3.nimble update readme 2021-09-04 20:56:02 +07:00
LICENSE Initial commit 2020-05-13 00:12:45 +07:00
README.md add ci 2021-09-05 11:07:55 +07:00

distorm3

Build Status (github) made-with-python

distorm3 disassembler wrapper for Nim

Installation

# nimble install distorm3

Usage

import distorm3

var
  decodedInstructionsCount = 0'u32
  decodedInsts: array[10, DInst]
  buf = [byte 0xe9, 0x51, 0x34, 0x12, 0x00]
  ci = CodeInfo(
    codeOffset: 0x0,
    code: addr buf,
    codeLen: sizeof(buf),
    dt: Decode64Bits,
    features: DF_STOP_ON_RET
  )
let res = distorm_decompose(addr ci, addr decodedInsts[0], sizeof(dInsts).uint32, addr decodedInstructionsCount)
assert res == DECRES_SUCCESS
for i in 0..<decodedInstructionsCount:
  echo decodedInsts[i].opcode