コード例 #1
0
 def testBasicITETaint(self):
     a = BitVecConstant(size=32, value=100, taint=("SOURCE1",))
     b = BitVecConstant(size=32, value=200, taint=("SOURCE2",))
     c = BitVecConstant(size=32, value=300, taint=("SOURCE3",))
     d = BitVecConstant(size=32, value=400, taint=("SOURCE4",))
     x = Operators.ITEBV(32, a > b, c, d)
     self.assertTrue("SOURCE1" in x.taint)
     self.assertTrue("SOURCE2" in x.taint)
     self.assertTrue("SOURCE3" in x.taint)
     self.assertTrue("SOURCE4" in x.taint)
コード例 #2
0
ファイル: test_smtlibv2.py プロジェクト: freemanZYQ/manticore
 def testBasicITETaint(self):
     a = BitVecConstant(32, 100, taint=('SOURCE1', ))
     b = BitVecConstant(32, 200, taint=('SOURCE2', ))
     c = BitVecConstant(32, 300, taint=('SOURCE3', ))
     d = BitVecConstant(32, 400, taint=('SOURCE4', ))
     x = Operators.ITEBV(32, a > b, c, d)
     self.assertTrue('SOURCE1' in x.taint)
     self.assertTrue('SOURCE2' in x.taint)
     self.assertTrue('SOURCE3' in x.taint)
     self.assertTrue('SOURCE4' in x.taint)
コード例 #3
0
ファイル: test_smtlibv2.py プロジェクト: freemanZYQ/manticore
    def test_ITEBV_2(self):
        cs = ConstraintSet()
        a = cs.new_bitvec(8)
        b = cs.new_bitvec(8)
        c = cs.new_bitvec(8)

        cs.add(b == 0x44)
        cs.add(c == 0x44)
        cs.add(a == Operators.ITEBV(8, b == c, b, c))

        self.assertTrue(solver.check(cs))
        self.assertEqual(solver.get_value(cs, a), 0x44)