Code Monkey home page Code Monkey logo

zydis-pascal's Introduction

Zydis Pascal Bindings

License: MIT

Pascal language bindings for the Zydis library, a fast and lightweight x86/x86-64 disassembler.

TODO

This repo still in development


Example

{
  Zydis DisassembleSimple Example By Coldzer0
}
program DisassembleSimple;

uses
  SysUtils,
  Zydis,
  Zydis.enums,
  Zydis.types,
  Zydis.Status,
  Zydis.Disassembler;

var
  offset : ZyanUSize;
  runtime_address: ZyanU64;
  instruction : TZydisDisassembledInstruction;
  Data: array[0..24] of ZyanU8 = ($51, $8D, $45, $FF, $50, $FF,
    $75, $0C, $FF, $75, $08, $FF, $15, $A0, $A5, $48, $76, $85, $C0,
    $0F, $88, $FC, $DA, $02, $00);

{$R *.res}

begin
  offset := 0;
  runtime_address := $007FFFFFFF400000;

  Initialize(instruction);
  // Loop over the instructions in our buffer.
  while ZYAN_SUCCESS(ZydisDisassembleIntel(ZYDIS_MACHINE_MODE_LONG_64,
      runtime_address, @data[offset], SizeOf(data) - offset, instruction)) do
  begin
    WriteLn(Format('%.16X  %s', [runtime_address, UTF8ToString(instruction.text)]));
    offset += instruction.info.length;
    runtime_address += instruction.info.length;
  end;

  ReadLn;
end.

Output

007FFFFFFF400000  push rcx
007FFFFFFF400001  lea eax, [rbp-0x01]
007FFFFFFF400004  push rax
007FFFFFFF400005  push [rbp+0x0C]
007FFFFFFF400008  push [rbp+0x08]
007FFFFFFF40000B  call [0x008000007588A5B1]
007FFFFFFF400011  test eax, eax
007FFFFFFF400013  js 0x007FFFFFFF42DB15

License

The Zydis Pascal Bindings are licensed under the MIT License.

With ❤️ From Home.

zydis-pascal's People

Contributors

coldzer0 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.