Package bap :: Module arm
[hide private]
[frames] | no frames]

Source Code for Module bap.arm

  1  #!/usr/bin/env python 
  2   
  3  """Lifted ARM instruction""" 
  4   
  5  from .adt import * 
  6  from .asm import * 
  7  from .bil import * 
  8   
9 -class Reg(ADT) : pass
10 -class Nil(Reg) : pass
11 -class GPR(Reg) : pass
12 -class CCR(Reg) : pass
13
14 -class R0(GPR) : pass
15 -class R1(GPR) : pass
16 -class R2(GPR) : pass
17 -class R3(GPR) : pass
18 -class R4(GPR) : pass
19 -class R5(GPR) : pass
20 -class R6(GPR) : pass
21 -class R7(GPR) : pass
22 -class R8(GPR) : pass
23 -class R9(GPR) : pass
24 -class R10(GPR) : pass
25 -class R11(GPR) : pass
26 -class R12(GPR) : pass
27 -class LR(GPR) : pass
28 -class PC(GPR) : pass
29 -class SP(GPR) : pass
30
31 -class CPSR(CCR) : pass
32 -class SPSR(CCR) : pass
33 -class ITSTATE(CCR) : pass
34
35 -class Insn(ADT) : pass
36 -class Move(Insn) : pass
37 -class Bits(Insn) : pass
38 -class Mult(Insn) : pass
39 -class Mem(Insn) : pass
40 -class Branch(Insn) : pass
41 -class Special(Insn) : pass
42
43 -class ADCri(Move) : pass
44 -class ADCrr(Move) : pass
45 -class ADCrsi(Move) : pass
46 -class ADCrsr(Move) : pass
47 -class ADDri(Move) : pass
48 -class ADDrr(Move) : pass
49 -class ADDrsi(Move) : pass
50 -class ADDrsr(Move) : pass
51 -class ANDri(Move) : pass
52 -class ANDrr(Move) : pass
53 -class ANDrsi(Move) : pass
54 -class ANDrsr(Move) : pass
55 -class BICri(Move) : pass
56 -class BICrr(Move) : pass
57 -class BICrsi(Move) : pass
58 -class BICrsr(Move) : pass
59 -class CMNri(Move) : pass
60 -class CMNzrr(Move) : pass
61 -class CMNzrsi(Move) : pass
62 -class CMNzrsr(Move) : pass
63 -class CMPri(Move) : pass
64 -class CMPrr(Move) : pass
65 -class CMPrsi(Move) : pass
66 -class CMPrsr(Move) : pass
67 -class EORri(Move) : pass
68 -class EORrr(Move) : pass
69 -class EORrsi(Move) : pass
70 -class EORrsr(Move) : pass
71 -class MOVTi16(Move) : pass
72 -class MOVi(Move) : pass
73 -class MOVi16(Move) : pass
74 -class MOVr(Move) : pass
75 -class MOVsi(Move) : pass
76 -class MOVsr(Move) : pass
77 -class MOVPCLR(Move) : pass
78 -class MVNi(Move) : pass
79 -class MVNr(Move) : pass
80 -class MVNsi(Move) : pass
81 -class MVNsr(Move) : pass
82 -class ORRri(Move) : pass
83 -class ORRrr(Move) : pass
84 -class ORRrsi(Move) : pass
85 -class ORRrsr(Move) : pass
86 -class RSBri(Move) : pass
87 -class RSBrr(Move) : pass
88 -class RSBrsi(Move) : pass
89 -class RSBrsr(Move) : pass
90 -class RSCri(Move) : pass
91 -class RSCrr(Move) : pass
92 -class RSCrsi(Move) : pass
93 -class RSCrsr(Move) : pass
94 -class SBCri(Move) : pass
95 -class SBCrr(Move) : pass
96 -class SBCrsi(Move) : pass
97 -class SBCrsr(Move) : pass
98 -class SUBri(Move) : pass
99 -class SUBrr(Move) : pass
100 -class SUBrsi(Move) : pass
101 -class SUBrsr(Move) : pass
102 -class TEQri(Move) : pass
103 -class TEQrr(Move) : pass
104 -class TEQrsi(Move) : pass
105 -class TEQrsr(Move) : pass
106 -class TSTri(Move) : pass
107 -class TSTrr(Move) : pass
108 -class TSTrsi(Move) : pass
109 -class TSTrsr(Move) : pass
110
111 -class BFC(Bits) : pass
112 -class BFI(Bits) : pass
113 -class PKHTB(Bits) : pass
114 -class RBIT(Bits) : pass
115 -class SBFX(Bits) : pass
116 -class SWPB(Bits) : pass
117 -class SXTAB(Bits) : pass
118 -class SXTAH(Bits) : pass
119 -class SXTB(Bits) : pass
120 -class SXTH(Bits) : pass
121 -class UBFX(Bits) : pass
122 -class UXTAB(Bits) : pass
123 -class UXTAH(Bits) : pass
124 -class UXTB(Bits) : pass
125 -class UXTH(Bits) : pass
126 -class REV(Bits) : pass
127 -class REV16(Bits) : pass
128 -class CLZ(Bits) : pass
129 130
131 -class MLA(Mult) : pass
132 -class MLS(Mult) : pass
133 -class MUL(Mult) : pass
134 -class SMLABB(Mult) : pass
135 -class SMLAD(Mult) : pass
136 -class SMLAL(Mult) : pass
137 -class SMLALBT(Mult) : pass
138 -class SMLAWB(Mult) : pass
139 -class SMUAD(Mult) : pass
140 -class SMULBB(Mult) : pass
141 -class SMULL(Mult) : pass
142 -class SMULTB(Mult) : pass
143 -class UMLAL(Mult) : pass
144 -class UMULL(Mult) : pass
145
146 -class LDMDA(Mem) : pass
147 -class LDMDA_UPD(Mem) : pass
148 -class LDMDB(Mem) : pass
149 -class LDMDB_UPD(Mem) : pass
150 -class LDMIA(Mem) : pass
151 -class LDMIA_UPD(Mem) : pass
152 -class LDMIB(Mem) : pass
153 -class LDMIB_UPD(Mem) : pass
154 -class STMDA(Mem) : pass
155 -class STMDA_UPD(Mem) : pass
156 -class STMDB(Mem) : pass
157 -class STMDB_UPD(Mem) : pass
158 -class STMIA(Mem) : pass
159 -class STMIA_UPD(Mem) : pass
160 -class STMIB(Mem) : pass
161 -class STMIB_UPD(Mem) : pass
162 -class LDRBT_POST_IMM(Mem) : pass
163 -class LDRBT_POST_REG(Mem) : pass
164 -class LDRB_POST_IMM(Mem) : pass
165 -class LDRB_POST_REG(Mem) : pass
166 -class LDRB_PRE_IMM(Mem) : pass
167 -class LDRB_PRE_REG(Mem) : pass
168 -class LDRBi12(Mem) : pass
169 -class LDRBrs(Mem) : pass
170 -class LDRD(Mem) : pass
171 -class LDRD_POST(Mem) : pass
172 -class LDRD_PRE(Mem) : pass
173 -class LDREX(Mem) : pass
174 -class LDREXB(Mem) : pass
175 -class LDREXD(Mem) : pass
176 -class LDREXH(Mem) : pass
177 -class LDRH(Mem) : pass
178 -class LDRHTr(Mem) : pass
179 -class LDRH_POST(Mem) : pass
180 -class LDRH_PRE(Mem) : pass
181 -class LDRSB(Mem) : pass
182 -class LDRSBTr(Mem) : pass
183 -class LDRSB_POST(Mem) : pass
184 -class LDRSB_PRE(Mem) : pass
185 -class LDRSH(Mem) : pass
186 -class LDRSHTi(Mem) : pass
187 -class LDRSHTr(Mem) : pass
188 -class LDRSH_POST(Mem) : pass
189 -class LDRSH_PRE(Mem) : pass
190 -class LDRT_POST_REG(Mem) : pass
191 -class LDR_POST_IMM(Mem) : pass
192 -class LDR_POST_REG(Mem) : pass
193 -class LDR_PRE_IMM(Mem) : pass
194 -class LDR_PRE_REG(Mem) : pass
195 -class LDRi12(Mem) : pass
196 -class LDRrs(Mem) : pass
197 -class STRBT_POST_IMM(Mem) : pass
198 -class STRBT_POST_REG(Mem) : pass
199 -class STRB_POST_IMM(Mem) : pass
200 -class STRB_POST_REG(Mem) : pass
201 -class STRB_PRE_IMM(Mem) : pass
202 -class STRB_PRE_REG(Mem) : pass
203 -class STRBi12(Mem) : pass
204 -class STRBrs(Mem) : pass
205 -class STRD(Mem) : pass
206 -class STRD_POST(Mem) : pass
207 -class STRD_PRE(Mem) : pass
208 -class STREX(Mem) : pass
209 -class STREXB(Mem) : pass
210 -class STREXD(Mem) : pass
211 -class STREXH(Mem) : pass
212 -class STRH(Mem) : pass
213 -class STRHTr(Mem) : pass
214 -class STRH_POST(Mem) : pass
215 -class STRH_PRE(Mem) : pass
216 -class STRT_POST_REG(Mem) : pass
217 -class STR_POST_IMM(Mem) : pass
218 -class STR_POST_REG(Mem) : pass
219 -class STR_PRE_IMM(Mem) : pass
220 -class STR_PRE_REG(Mem) : pass
221 -class STRi12(Mem) : pass
222 -class STRrs(Mem) : pass
223
224 -class BL(Branch) : pass
225 -class BLX(Branch) : pass
226 -class BLX_pred(Branch) : pass
227 -class BLXi(Branch) : pass
228 -class BL_pred(Branch) : pass
229 -class BX(Branch) : pass
230 -class BX_RET(Branch) : pass
231 -class BX_pred(Branch) : pass
232 -class Bcc(Branch) : pass
233
234 -class CPS2p(Special) : pass
235 -class DMB(Special) : pass
236 -class DSB(Special) : pass
237 -class HINT(Special) : pass
238 -class MRS(Special) : pass
239 -class MSR(Special) : pass
240 -class PLDi12(Special) : pass
241 -class SVC(Special) : pass
242 243
244 -def loads(s):
245 return eval(s)
246