from .vex import HeavyVEXMixin, TrackActionsMixin, SimInspectMixin, HeavyResilienceMixin, SuperFastpathMixin
... ...
# The default execution engine # You may remove unused mixins from this default engine to speed up execution classUberEngine( SimEngineFailure, SimEngineSyscall, HooksMixin, SimEngineUnicorn, SuperFastpathMixin, # SuperFastpathMixin(VEXSlicingMixin) TrackActionsMixin, SimInspectMixin, HeavyResilienceMixin, SootMixin, HeavyVEXMixin ): pass
classSuperFastpathMixin(VEXSlicingMixin): """ This mixin implements the superfastpath execution mode, which skips all but the last four instructions. """ defhandle_vex_block(self, irsb): # This option makes us only execute the last four instructions if o.SUPER_FASTPATH in self.state.options: imark_counter = 0 for i inrange(len(irsb.statements) - 1, -1, -1): iftype(irsb.statements[i]) is pyvex.IRStmt.IMark: imark_counter += 1 if imark_counter >= 4: self._skip_stmts = max(self._skip_stmts, i) break
classSimInspectMixin(VEXMixin): # open question: what should be done about the BP_AFTER breakpoints in cases where the engine uses exceptional control flow? ... ... defhandle_vex_block(self, irsb): self.state._inspect('irsb', BP_BEFORE, address=irsb.addr) super().handle_vex_block(irsb) self.state._inspect('instruction', BP_AFTER) self.state._inspect('irsb', BP_AFTER, address=irsb.addr)
classIRStmt(VEXObject): """ IR statements in VEX represents operations with side-effects. """ ... ...
classNoOp(IRStmt): """ A no-operation statement. It is usually the result of an IR optimization. """ ... ...
classIMark(IRStmt): """ An instruction mark. It marks the start of the statements that represent a single machine instruction (the end of those statements is marked by the next IMark or the end of the IRSB). Contains the address and length of the instruction. 一个指示标记。 它标记代表单个机器指令的语句的开始(这些语句的结束由下一个 IMark 或 IRSB 的结束标记)。 包含指令的地址和长度。 """ ... ...
classPut(IRStmt): """ Write to a guest register, at a fixed offset in the guest state. """