Exemplo n.º 1
0
 def __init__(self, registers, instruction_pointer, stack_pointer, stack_registers=None):
     self.registers = registers
     self.jcccontext = JccContext()
     self.memory = Memory()
     self.func_calls = {}  # Keeps track of function calls.
     self.executed_instructions = []  # Keeps track of the instructions that have been executed.
     self.memory_copies = collections.defaultdict(list)  # Keeps track of memory moves.
     self.bitness = utils.get_bits()
     self.byteness = self.bitness // 8
     self.stack_registers = stack_registers or []
     self.variables = VariableMap(self)
     self._sp = stack_pointer
     self._ip = instruction_pointer
Exemplo n.º 2
0
    def __init__(self, emulator, registers, instruction_pointer,
                 stack_pointer):
        self.emulator = emulator
        self.registers = registers
        self.jcccontext = JccContext()
        self.memory = Memory()
        self.func_calls = {}  # Keeps track of function calls.
        self.executed_instructions = [
        ]  # Keeps track of the instructions that have been executed.
        self.memory_copies = collections.defaultdict(
            list)  # Keeps track of memory moves.
        self.bitness = utils.get_bits()
        self.byteness = self.bitness // 8
        self.variables = VariableMap(self)
        self.objects = ObjectMap(self)
        self.actions = []  # List of action objects (namedtuples)

        # Function start address of a function we are currently hooking.
        self.hooking_call = None

        self._sp = stack_pointer
        self._ip = instruction_pointer
        self._sp_start = self.sp