• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python ut_helpers_ir.exec_instruction函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: test_sub

    def test_sub(self):
        """Test SUB execution"""

        # SUB Rn,Rm
        exec_instruction("SUB R1, R2",
                         [(ExprId("R1", 32), ExprInt(0x28, 32)),
                          (ExprId("R2", 32), ExprInt(0x7, 32))],
                         [(ExprId("R1", 32), ExprInt(0x21, 32))])
开发者ID:cea-sec,项目名称:miasm,代码行数:8,代码来源:test_arithmetic.py


示例17: test_bnotm

    def test_bnotm(self):
        """Test BNOTM execution"""

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


示例18: test_sl2ad3

    def test_sl2ad3(self):
        """Test SL2AD3 execution"""

        # SL2AD3 R0,Rn,Rm
        exec_instruction("SL2AD3 R0, R1, R2",
                         [(ExprId("R1", 32), ExprInt(0x2, 32)),
                          (ExprId("R2", 32), ExprInt(0x20, 32))],
                         [(ExprId("R0", 32), ExprInt(0x28, 32))])
开发者ID:cea-sec,项目名称:miasm,代码行数:8,代码来源:test_arithmetic.py


示例19: test_erepeat

    def test_erepeat(self):
        """Test EREPEAT execution"""

        # EREPEAT disp17.align2
        exec_instruction("EREPEAT 0x42",
                         [(ExprId("PC", 32), ExprInt(0, 32))],
                         [(ExprId("RPB", 32), ExprInt(4, 32)),
                          (ExprId("RPE", 32), ExprInt(0x43, 32))])
开发者ID:commial,项目名称:miasm,代码行数:8,代码来源:test_repeat.py


示例20: test_jsr

    def test_jsr(self):
        """Test JSR execution"""

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



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python uthread.new函数代码示例发布时间:2022-05-27
下一篇:
Python ut_helpers_asm.check_instruction函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap