Giter Club home page Giter Club logo

vm_disassembler's Introduction

VM_Disassembler

A recursive disassembler written in Python. Best suitable for VMs in CTFs.

See example.py for a disassembler for https://crackmes.one/crackme/5bc0fe0033c5d4110a29b296.

The VM_Diassembler class should be initialized with four parameters:

vm_dis = VM_Disassembler(vm_code, disassembler, entry_point, look_ahead_len)

Where vm_code is the code to disassemble (a list of integer bytes); disassembler is the disassembler function (see below); entry_point is the offset of the first instruction; look_ahead_len specifies how many bytes to consider when disassembling the current instruction. This can be set to the max length of an instruction. Leave it to 0 if unsure.

The user only needs to write a disassembler() function which disassembles one instruction. The VM_Disassembler will handler all the other stuff.

def disassembler(addr, data):
    # hard work here
    return instr_len, instr_text, possible_next_addrs

disassembler() takes two parameters:

addr: the current address

data: the data to disassemble

It should return three things:

instr_len: the length of the current instruction

instr_text: the disassembly text of the current instruction

possible_next_addrs: a list of possible next addresses after the current instruction

I hope this will be helpful for your next CTF. Issues and PRs are welcome!

vm_disassembler's People

Contributors

jeffli678 avatar

Watchers

James Cloos 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.