Git Product home page Git Product logo

pymsasid3's Introduction

Pymsasid3

Pymsasid3 is a pure Python disassembly library. It's a maintenance-style development of the original Pymsasid library, which was a port of udis86 to Python.

Pymsasid3 is compatible with Python3 and should be compatible with Python2.7. Various instruction decoding issues were fixed comparing to the original.

Trivia: "msasid" is "disasm" reversed.

Quick example

(Copied from the original README, not up to date.)

>>> import pymsasid as pyms
>>> prog = pyms.Pymsasid(hook=pyms.PEFileHook, source='./xcopy.exe')
>>> inst = prog.disassemble(prog.pc); print(inst)
call 0x100291c
>>> print inst.operator
call
>>> print inst.operand
[0x100291c]
>>> branch = inst.branch(); map(hex, branch)
['0x1002912', '0x100291c']
>>> inst = prog.disassemble(branch[1]); print(inst)
mov edi edi
>>> branch = inst.branch()
>>> while len(branch) == 1:
...   s = '[' + hex(prog.pc) + '] '
...   inst = prog.disassemble(branch[0])
...   print (s + str(inst))
...   branch = inst.branch()
... 
[0x100291c] push rbp
[0x100291e] mov ebp, esp
[0x100291f] sub esp, 0x10
[0x1002921] mov rax, [0x1009000]
[0x1002924] and [bp-0x8], 0x0
[0x1002929] and [bp-0x4], 0x0
[0x100292d] push rdi
[0x1002931] mov rdi, 0xbb40e64e
[0x1002932] cmp eax, edi
[0x1002937] jnz 0x10057a6
>>> map(hex, branch)
['0x100293f', '0x10057a6']

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.