Пример #1
0
 def operate_SDIV(self, *values):
     s0, s1 = values[0], values[1]
     sign = -1 if (s0 / s1) < 0 else 1
     computed = sign * (abs(s0) / abs(s1))
     return hlp.get_concrete_int(computed)
Пример #2
0
 def operate_DIV(self, *values):
     if values[1] == 0:
         return 0
     else:
         return hlp.get_concrete_int(UDiv(values[0] / values[1]))
Пример #3
0
 def operate_MOD(self, *values):
     return hlp.get_concrete_int(0 if values[1] == 0 else values[0] %
                                 values[1])
Пример #4
0
 def symbolic_add(self, *values):
     s0 = hlp.convert_to_bitvec(values[0])
     s1 = hlp.convert_to_bitvec(values[1])
     return hlp.get_concrete_int(s0 + s1)
Пример #5
0
 def operate_MUL(self, *values):
     s0 = hlp.convert_to_bitvec(values[0])
     s1 = hlp.convert_to_bitvec(values[1])
     return hlp.get_concrete_int(s0 * s1)
Пример #6
0
 def operate_ISZERO(self, *values):
     return hlp.get_concrete_int(values[0] == 0)
Пример #7
0
 def operate_EQ(self, *values):
     return hlp.get_concrete_int(values[0] == values[1])
Пример #8
0
 def operate_EXP(self, *values):
     base, exponent = values[0], values[1]
     return hlp.get_concrete_int(pow(base, exponent))
Пример #9
0
 def operate_MULMOD(self, *values):
     s0, s1, s2 = values[0], values[1], values[2]
     return hlp.get_concrete_int((s0 * s1) % s2 if s2 else 0)
Пример #10
0
 def operate_SMOD(self, *values):
     sign = -1 if values[0] < 0 else 1
     computed = sign * (abs(values[0]) % abs(values[1]))
     return hlp.get_concrete_int(computed)