当前位置: 首页>>代码示例>>Python>>正文


Python ut_helpers_ir.exec_instruction函数代码示例

本文整理汇总了Python中ut_helpers_ir.exec_instruction函数的典型用法代码示例。如果您正苦于以下问题:Python exec_instruction函数的具体用法?Python exec_instruction怎么用?Python exec_instruction使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了exec_instruction函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_di

    def test_di(self):
        """Test DI execution"""

        # DI
        exec_instruction("DI",
                         [(ExprId("PSW", 32), ExprInt(1, 32))],
                         [(ExprId("PSW", 32), ExprInt(0, 32))])
开发者ID:cea-sec,项目名称:miasm,代码行数:7,代码来源:test_control.py

示例2: test_ldc

    def test_ldc(self):
        """Test LDC execution"""

        # LDC Rn,imm5
        exec_instruction("LDC R1, SAR",
                         [(ExprId("SAR", 32), ExprInt(0x28, 32))],
                         [(ExprId("R1", 32), ExprInt(0x28, 32))])
开发者ID:cea-sec,项目名称:miasm,代码行数:7,代码来源:test_control.py

示例3: test_ei

    def test_ei(self):
        """Test EI execution"""

        # EI
        exec_instruction("EI",
                         [(ExprId("PSW", 32), ExprInt(0, 32))],
                         [(ExprId("PSW", 32), ExprInt(1, 32))])
开发者ID:cea-sec,项目名称:miasm,代码行数:7,代码来源:test_control.py

示例4: test_stc

    def test_stc(self):
        """Test STC execution"""

        # STC Rn,imm5
        exec_instruction("STC R1, SAR",
                         [(ExprId("R1", 32), ExprInt(0x28, 32))],
                         [(ExprId("SAR", 32), ExprInt(0x28, 32))])
开发者ID:cea-sec,项目名称:miasm,代码行数:7,代码来源:test_control.py

示例5: test_xor

    def test_xor(self):
        """Test XOR execution"""

        # XOR Rn, Rm
        exec_instruction("XOR R1, R2",
                         [(ExprId("R1", 32), ExprInt(1, 32)), (ExprId("R2", 32), ExprInt(0, 32))],
                         [(ExprId("R1", 32), ExprInt(1, 32))])
开发者ID:cea-sec,项目名称:miasm,代码行数:7,代码来源:test_logical.py

示例6: test_lw

    def test_lw(self):
        """Test SW execution"""

        # LW Rn,(Rm)
        exec_instruction("LW R1, (R2)",
                         [(ExprId("R2", 32), ExprInt(0x10, 32)),
                          (ExprMem(ExprInt(0x10, 32), 32), ExprInt(0xABCD, 32))],
                         [(ExprId("R1", 32), ExprInt(0xABCD, 32))])

        #  LW Rn,disp7.align4(SP)
        exec_instruction("LW R1, 0x18(SP)",
                         [(ExprId("SP", 32), ExprInt(0x10, 32)),
                          (ExprMem(ExprInt(0x28, 32), 32), ExprInt(0x01234567, 32))],
                         [(ExprId("R1", 32), ExprInt(0x01234567, 32))])

        # LW Rn[0-7],disp7.align4(TP)
        exec_instruction("LW R1, 0x18(TP)",
                         [(ExprId("TP", 32), ExprInt(0x10, 32)),
                          (ExprMem(ExprInt(0x28, 32), 32), ExprInt(0x1010, 32))],
                         [(ExprId("R1", 32), ExprInt(0x1010, 32))])

        # LW Rn,disp16(Rm)
        exec_instruction("LW R9, 0xF000(R2)",
                         [(ExprId("R2", 32), ExprInt(0x42, 32)),
                          (ExprMem(ExprInt(0xFFFFF040, 32), 32), ExprInt(0x10, 32))],
                         [(ExprId("R9", 32), ExprInt(0x10, 32))])

        # LW Rn,(abs24.align4)
        exec_instruction("LW R10, (0x1010)",
                         [(ExprMem(ExprInt(0x1010, 32), 32), ExprInt(0xABC7, 32))],
                         [(ExprId("R10", 32), ExprInt(0xABC7, 32))])
开发者ID:commial,项目名称:miasm,代码行数:31,代码来源:test_loadstore.py

示例7: test_xor3

    def test_xor3(self):
        """Test XOR3 execution"""

        # XOR3 Rn,Rm,imm16
        exec_instruction("XOR3 R1, R2, 1",
                         [(ExprId("R2", 32), ExprInt(0, 32))],
                         [(ExprId("R1", 32), ExprInt(1, 32))])
开发者ID:cea-sec,项目名称:miasm,代码行数:7,代码来源:test_logical.py

示例8: test_nor

    def test_nor(self):
        """Test NOR execution"""

        # NOR Rn, Rm
        exec_instruction("NOR R1, R2",
                         [(ExprId("R1", 32), ExprInt(1, 32)), (ExprId("R2", 32), ExprInt(0, 32))],
                         [(ExprId("R1", 32), ExprInt(0xFFFFFFFE, 32))])
开发者ID:cea-sec,项目名称:miasm,代码行数:7,代码来源:test_logical.py

示例9: test_and3

    def test_and3(self):
        """Test AND3 execution"""

        # AND3 Rn,Rm,imm16
        exec_instruction("AND3 R1, R2, 0",
                         [(ExprId("R2", 32), ExprInt(1, 32))],
                         [(ExprId("R1", 32), ExprInt(0, 32))])
开发者ID:cea-sec,项目名称:miasm,代码行数:7,代码来源:test_logical.py

示例10: test_sw

    def test_sw(self):
        """Test SW execution"""

        # SW Rn,(Rm)
        exec_instruction("SW R1, (R2)",
                         [(ExprId("R1", 32), ExprInt(0x28071010, 32)),
                          (ExprId("R2", 32), ExprInt(0x10, 32))],
                         [(ExprMem(ExprInt(0x10, 32), 32), ExprInt(0x28071010, 32))])

        # SW Rn,disp7.align4(SP)
        exec_instruction("SW R1, 4(SP)",
                         [(ExprId("R1", 32), ExprInt(0x28071010, 32)),
                          (ExprId("SP", 32), ExprInt(0x10, 32))],
                         [(ExprMem(ExprInt(0x14, 32), 32), ExprInt(0x28071010, 32))])

        # SW Rn,disp7.align4(TP)
        exec_instruction("SW R1, 12(TP)",
                         [(ExprId("R1", 32), ExprInt(0x28071010, 32)),
                          (ExprId("TP", 32), ExprInt(0x10, 32))],
                         [(ExprMem(ExprInt(0x1c, 32), 32), ExprInt(0x28071010, 32))])

        # SW Rn,disp16(Rm)
        exec_instruction("SW R10, 0xF800(R2)",
                         [(ExprId("R10", 32), ExprInt(0xABC7, 32)),
                          (ExprId("R2", 32), ExprInt(0x10, 32))],
                         [(ExprMem(ExprInt(0xFFFFF810, 32), 32), ExprInt(0xABC7, 32))])

        # SW Rn,(abs24.align4)
        exec_instruction("SW R10, (0x1010)",
                         [(ExprId("R10", 32), ExprInt(0xABC7, 32))],
                         [(ExprMem(ExprInt(0x1010, 32), 32), ExprInt(0xABC7, 32))])
开发者ID:commial,项目名称:miasm,代码行数:31,代码来源:test_loadstore.py

示例11: test_and

    def test_and(self):
        """Test AND  execution"""

        # AND Rn, Rm
        exec_instruction("AND R1, R2",
                         [(ExprId("R1", 32), ExprInt(1, 32)), (ExprId("R2", 32), ExprInt(0, 32))],
                         [(ExprId("R1", 32), ExprInt(0, 32))])
开发者ID:cea-sec,项目名称:miasm,代码行数:7,代码来源:test_logical.py

示例12: test_ret

    def test_ret(self):
        """Test RET execution"""

        # RET
        exec_instruction("RET",
                         [(ExprId("LP", 32), ExprInt(0x28, 32))],
                         [(ExprId("PC", 32), ExprInt(0x28, 32))])
开发者ID:cea-sec,项目名称:miasm,代码行数:7,代码来源:test_branchjump.py

示例13: test_sbvck3

    def test_sbvck3(self):
        """Test SBVCK3 execution"""

        # SBVCK3 R0,Rn,Rm
        exec_instruction("SBVCK3 R0, R1, R2",
                         [(ExprId("R1", 32), ExprInt(2, 32)),
                          (ExprId("R2", 32), ExprInt(1, 32))],
                         [(ExprId("R0", 32), ExprCond(ExprOp(">",
                                                             ExprInt(3, 32),
                                                             ExprCond(ExprOp(">", ExprInt(0x2, 32), ExprInt(0x1, 32)),
                                                                      ExprInt(0x2, 32),
                                                                      ExprInt(0x1, 32))),
                                                      ExprInt(1, 32),
                                                      ExprInt(0, 32)))])

        exec_instruction("SBVCK3 R0, R1, R2",
                         [(ExprId("R1", 32), ExprInt(0, 32)),
                          (ExprId("R2", 32), ExprInt(1, 32))],
                         [(ExprId("R0", 32), ExprCond(ExprOp(">",
                                                             ExprInt(1, 32),
                                                             ExprCond(ExprOp(">", ExprInt(0, 32), ExprInt(1, 32)),
                                                                      ExprInt(0, 32),
                                                                      ExprInt(1, 32))),
                                                      ExprInt(1, 32),
                                                      ExprInt(0, 32)))])
开发者ID:cea-sec,项目名称:miasm,代码行数:25,代码来源:test_arithmetic.py

示例14: test_dbreak

    def test_dbreak(self):
        """Test DBREAK execution"""

        # DBREAK
        exec_instruction("DBREAK",
                         [(ExprId("DBG", 32), ExprInt(0, 32))],
                         [(ExprId("DBG", 32), ExprInt(0b10, 32))])
开发者ID:cea-sec,项目名称:miasm,代码行数:7,代码来源:test_debug.py

示例15: test_btstm

    def test_btstm(self):
        """Test BTSTM execution"""

        # BTSTM R0,(Rm),imm3
        exec_instruction("BTSTM R0, (R1), 1",
                         [(ExprId("R1", 32), ExprInt(0x28, 32)),
                          (ExprMem(ExprInt(0x28, 32), 8), ExprInt(0x2, 8))],
                         [(ExprId("R0", 32), ExprInt(0x2, 32))])
开发者ID:cea-sec,项目名称:miasm,代码行数:8,代码来源:test_bitmanipulation.py


注:本文中的ut_helpers_ir.exec_instruction函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。