Giter Club home page Giter Club logo

pyasm's Introduction

=======
PyAsm
=======
:info: An inline x86 (64bit pending) assembly module for python! (on windows!)
:Author: Amihai Neiderman

About
=====
The PyAsm is a python library intended for the execution of a native x86 assembly code through python code.
The idea came to me one day when I needed a fast way to locate the address of the PEB(Process Environment Block) in a given process using python code. 
Using asm it takes exactly one line of code "mov eax,[fs:30h]" and with ctypes it takes a lot more and require you to
go through a couple of semi-documented nt APIs :\

Installation
============
For now I don't have a real installation...So everything has to be done manually!
1) Download the lastest NASM assembler from http://www.nasm.us
2) Place pyAsm.py in your working dir or your >python[version]\lib folder
3) Open pyAsm.py and edit the NASM__ variable (defualt is NASM__ = r'nasm.exe') to the current location of your nasm.exe assembler
4) Run python!

Examples
========

>>> from pyAsm import *
>>> p = pyAsm(A_32BIT)      #We can alse use A_64BIT and A_16BIT!
>>> p.update('xor eax,eax') #update the executed code
>>> p.update('mov eax,1')
>>> p.update('shl eax,10')
>>> r = p.run()
>>> print 'EAX is:',r.Eax

EAX is: 1024

pyasm's People

Contributors

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