PyContext.py: A module containing a class for defining a context to pass between modules in the emulator
PyCPU.py: The CPU class implements each instruction and is responsible for executing and maintaining state
PyDebug.py: A simple class to ease some debugging tasks
PyEmu.py: The user facing class that implements the public methods available for use. Also is responsible for initiating the memory and cpu classes
PyInstruction.py: A helper class for providing abstracted access to the pydasm instruction structures
PyMemory.py: A module containing the memory managers responsible for fetching and storing memory
PyOS.py: A rough implementation of needed OS specific structures for process creation and control.
lib/
pefile.py: Ero Carrera's pefile implementation
pydasm.pyd: Ero Carrera's libdasm python wrapper
ctypes/_ctypes.pyd: Ctypes library needed for PyOS.py
#!/usr/bin/env python
########################################################################
#
# PyEmu: scriptable x86 emulator
#
#
# License: None
#
########################################################################
sys.path.append(r'C:\Program Files\IDA\python')
from PyCPU import PyCPU
from PyContext import PyContext
from PyMemory import *
from PyOS import *
'''
PyEmu:
The main emulator class. This class implements the public methods
for controlling the emulator. This includes handlers, and initialization.
'''
class PyEmu:
DEBUG = 0
def __init__(self):
#
# raise_exception: This method gets called when an exception happens
#
def raise_exception(self, exception, address):
#
# debug: A public method for setting global debug levels
#
def debug(self, level):
#
# execute: A public method for executing instructions
#
def execute(self, steps=1, start=0x0, end=0x0):
#
# get_register: A public method to retrieve a register for the user
def get_register(self, register):
#
# set_register: A public method for setting a registers value
#
def set_register(self, register, value, name=""):
#
# get_stack_variable: A public method for setting stack local variables
#
def get_stack_variable(self, offset, size=0):
#
# set_stack_variable: A public method for setting a local stack variable
#
def set_stack_variable(self, offset, value, size=0, name=""):
#
# get_stack_argument: A public method to get a functions stack argument
#
def get_stack_argument(self, offset, size=0):
#
# set_stack_argument: A public method to set up a stack argument
#
def set_st
1542




被折叠的 条评论
为什么被折叠?



