1
2
3 """Disassembled instuctions"""
4
5 from adt import ADT
6
7 -class Kind(ADT) : pass
10 -class Branch(Affecting_control) : pass
14 -class Return(Affecting_control) : pass
15 -class Call(Affecting_control) : pass
16 -class Barrier(Affecting_control) : pass
19 -class May_load(Having_side_effects) : pass
22
23
25 if isinstance(s, ADT):
26 return s
27 else:
28 return eval(s)
29
30
33
34
35
37 - def __init__(self, name, addr, size, asm, kinds, operands, target=None, bil=None, **kw):
47
49 return exists(self.kinds, lambda x: isinstance(x,k))
50
52 return 'Insn("{name}", {addr:#010x}, {size}, "{asm}", {kinds}, {operands})'.\
53 format(**self.__dict__)
54
59
60
62 try:
63 r = (x for x in cont if f(x)).next()
64 return True
65 except StopIteration:
66 return False
67