Пример #1
0
 def div_(self, global_state):
     op0, op1 = util.pop_bitvec(global_state.mstate), util.pop_bitvec(global_state.mstate)
     if op1 == 0:
         global_state.mstate.stack.append(BitVecVal(0, 256))
     else:
         global_state.mstate.stack.append(UDiv(op0, op1))
     return [global_state]
Пример #2
0
def choose_op(a1, a2, op):
    r = If(op == 0,
            a2 + a1,
            If(op == 1,
                a1 - a2,
                If(op == 2,
                    a2 * a1,
                    If(op == 3 and a2 != 0,
                        UDiv(a1, a2),
                        False
                    )
                )
            )
    )
    return r
Пример #3
0
 def div_(self, global_state):
     global_state.mstate.stack.append(
         UDiv(util.pop_bitvec(global_state.mstate),
              util.pop_bitvec(global_state.mstate)))
     return [global_state]
Пример #4
0
 def operate_DIV(self, *values):
     if values[1] == 0:
         return 0
     else:
         return hlp.get_concrete_int(UDiv(values[0] / values[1]))
Пример #5
0
def DIV(x, y):
	return If(y == 0, 0, UDiv(x, y))