summaryrefslogtreecommitdiff
path: root/src/arch/dalvik/instruction-def.h
blob: 38df061c796da1d95cff326439ddd899ddde43ee (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244

/* OpenIDA - Outil d'analyse de fichiers binaires
 * instruction-def.h - définition interne des identifiants d'instructions Dalvik
 *
 * Copyright (C) 2011 Cyrille Bagard
 *
 *  This file is part of OpenIDA.
 *
 *  OpenIDA is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  OpenIDA is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with Foobar.  If not, see <http://www.gnu.org/licenses/>.
 */


#ifndef _ARCH_DALVIK_INSTRUCTION_DEF_H
#define _ARCH_DALVIK_INSTRUCTION_DEF_H



/* Enumération de tous les opcodes */
typedef enum _DalvikOpcodes
{
    DOP_NOP,                                /* nop (0x00)                  */
    DOP_MOVE,                               /* move (0x01)                 */
    DOP_MOVE_FROM_16,                       /* move/from16 (0x02)          */

    DOP_MOVE_WIDE_FROM_16,                  /* move-wide/from16 (0x05)     */

    DOP_MOVE_OBJECT,                        /* move-object (0x07)          */
    DOP_MOVE_OBJECT_FROM_16,                /* move-object/from16 (0x08)   */

    DOP_MOVE_RESULT,                        /* move-result (0x0a)          */
    DOP_MOVE_RESULT_WIDE,                   /* move-result-wide (0x0b)     */
    DOP_MOVE_RESULT_OBJECT,                 /* move-result-object (0x0c)   */
    DOP_MOVE_EXCEPTION,                     /* move-exception (0x0d)       */
    DOP_RETURN_VOID,                        /* return-void (0x0e)          */
    DOP_RETURN,                             /* return (0x0f)               */
    DOP_RETURN_WIDE,                        /* return-wide (0x10)          */
    DOP_RETURN_OBJECT,                      /* return-object (0x11)        */
    DOP_CONST_4,                            /* const/4 (0x12)              */
    DOP_CONST_16,                           /* const/16 (0x13)             */
    DOP_CONST,                              /* const (0x14)                */
    DOP_CONST_HIGH16,                       /* const/high16 (0x15)         */
    DOP_CONST_WIDE_16,                      /* const-wide/16 (0x16)        */
    DOP_CONST_WIDE_32,                      /* const-wide/32 (0x17)        */
    DOP_CONST_WIDE,                         /* const-wide (0x18)           */
    DOP_CONST_WIDE_HIGH16,                  /* const-wide/high16 (0x19)    */
    DOP_CONST_STRING,                       /* const-string (0x1a)         */
    DOP_CONST_STRING_JUMBO,                 /* const-string/jumbo (0x1b)   */
    DOP_CONST_CLASS,                        /* const-class (0x1c)          */


    DOP_CHECK_CAST,                         /* check-cast (0x1f)           */

    DOP_ARRAY_LENGTH,                       /* array-length (0x21)         */
    DOP_NEW_INSTANCE,                       /* new-instance (0x22)         */
    DOP_NEW_ARRAY,                          /* new-array (0x23)            */

    DOP_FILL_ARRAY_DATA,                    /* fill-array-data (0x26)      */

    DOP_GOTO,                               /* goto (0x28)                 */
    DOP_GOTO_16,                            /* goto/16 (0x29)              */
    DOP_GOTO_32,                            /* goto/32 (0x2a)              */
    DOP_PACKED_SWITCH,                      /* packed-switch (0x2b)        */
    DOP_SPARSE_SWITCH,                      /* sparse-switch (0x2c)        */
    DOP_CMPL_FLOAT,                         /* cmp-long (0x2d)             */
    DOP_CMPG_FLOAT,                         /* cmpg-float (0x2e)           */
    DOP_CMPL_DOUBLE,                        /* cmpl-double (0x2f)          */
    DOP_CMPG_DOUBLE,                        /* cmpg-double (0x30)          */
    DOP_CMP_LONG,                           /* cmp-long (0x31)             */
    DOP_IF_EQ,                              /* if-eq (0x32)                */
    DOP_IF_NE,                              /* if-ne (0x33)                */
    DOP_IF_LT,                              /* if-lt (0x34)                */
    DOP_IF_GE,                              /* if-ge (0x35)                */
    DOP_IF_GT,                              /* if-gt (0x36)                */
    DOP_IF_LE,                              /* if-le (0x37)                */
    DOP_IF_EQZ,                             /* if-eqz (0x38)               */
    DOP_IF_NEZ,                             /* if-nez (0x39)               */
    DOP_IF_LTZ,                             /* if-ltz (0x3a)               */
    DOP_IF_GEZ,                             /* if-gez (0x3b)               */
    DOP_IF_GTZ,                             /* if-gtz (0x3c)               */
    DOP_IF_LEZ,                             /* if-lez (0x3d)               */



    DOP_AGET,                               /* aget (0x44)                 */
    DOP_AGET_WIDE,                          /* aget-wide (0x45)            */
    DOP_AGET_OBJECT,                        /* aget-object (0x46)          */
    DOP_AGET_BOOLEAN,                       /* aget-boolean (0x47)         */
    DOP_AGET_BYTE,                          /* aget-byte (0x48)            */
    DOP_AGET_CHAR,                          /* aget-char (0x49)            */
    DOP_AGET_SHORT,                         /* aget-short (0x4a)           */
    DOP_APUT,                               /* aput (0x4b)                 */
    DOP_APUT_WIDE,                          /* aput-wide (0x4c)            */
    DOP_APUT_OBJECT,                        /* aput-object (0x4d)          */
    DOP_APUT_BOOLEAN,                       /* aput-boolean (0x4e)         */
    DOP_APUT_BYTE,                          /* aput-byte (0x4f)            */
    DOP_APUT_CHAR,                          /* aput-char (0x50)            */
    DOP_APUT_SHORT,                         /* aput-short (0x51)           */
    DOP_IGET,                               /* iget (0x52)                 */
    DOP_IGET_WIDE,                          /* iget-wide (0x53)            */
    DOP_IGET_OBJECT,                        /* iget-object (0x54)          */
    DOP_IGET_BOOLEAN,                       /* iget-boolean (0x55)         */
    DOP_IGET_BYTE,                          /* iget-byte (0x56)            */
    DOP_IGET_CHAR,                          /* iget-char (0x57)            */
    DOP_IGET_SHORT,                         /* iget-short (0x58)           */
    DOP_IPUT,                               /* iput (0x59)                 */
    DOP_IPUT_WIDE,                          /* iput-wide (0x5a)            */
    DOP_IPUT_OBJECT,                        /* iput-object (0x5b)          */
    DOP_IPUT_BOOLEAN,                       /* iput-boolean (0x5c)         */
    DOP_IPUT_BYTE,                          /* iput-byte (0x5d)            */
    DOP_IPUT_CHAR,                          /* iput-char (0x5e)            */
    DOP_IPUT_SHORT,                         /* iput-short (0x5f)           */
    DOP_SGET,                               /* sget (0x60)                 */
    DOP_SGET_WIDE,                          /* sget-wide (0x61)            */
    DOP_SGET_OBJECT,                        /* sget-object (0x62)          */
    DOP_SGET_BOOLEAN,                       /* sget-boolean (0x63)         */
    DOP_SGET_BYTE,                          /* sget-byte (0x64)            */
    DOP_SGET_CHAR,                          /* sget-char (0x65)            */
    DOP_SGET_SHORT,                         /* sget-short (0x66)           */
    DOP_SPUT,                               /* sput (0x67)                 */
    DOP_SPUT_WIDE,                          /* sput-wide (0x68)            */
    DOP_SPUT_OBJECT,                        /* sput-object (0x69)          */
    DOP_SPUT_BOOLEAN,                       /* sput-boolean (0x6a)         */
    DOP_SPUT_BYTE,                          /* sput-byte (0x6b)            */
    DOP_SPUT_CHAR,                          /* sput-char (0x6c)            */
    DOP_SPUT_SHORT,                         /* sput-short (0x6d)           */
    DOP_INVOKE_VIRTUAL,                     /* invoke-virtual (0x6e)       */
    DOP_INVOKE_SUPER,                       /* invoke-super (0x6f)         */
    DOP_INVOKE_DIRECT,                      /* invoke-direct (0x70)        */
    DOP_INVOKE_STATIC,                      /* invoke-static (0x71)        */
    DOP_INVOKE_INTERFACE,                   /* invoke-interface (0x72)     */

    DOP_INVOKE_VIRTUAL_RANGE,               /* invoke-virtual/range (0x74) */
    DOP_INVOKE_SUPER_RANGE,                 /* invoke-super/range (0x75)   */
    DOP_INVOKE_DIRECT_RANGE,                /* invoke-direct/range (0x76)  */
    DOP_INVOKE_STATIC_RANGE,                /* invoke-static/range (0x77)  */
    DOP_INVOKE_INTERFACE_RANGE,             /* invoke-interface/rg. (0x78) */

    DOP_TO_INT_LONG,                        /* int-to-long (0x81)          */
    DOP_TO_INT_FLOAT,                       /* int-to-float (0x82)         */
    DOP_TO_INT_DOUBLE,                      /* int-to-double (0x83)        */
    DOP_TO_LONG_INT,                        /* long-to-int (0x84)          */
    DOP_TO_LONG_FLOAT,                      /* long-to-float (0x85)        */
    DOP_TO_LONG_DOUBLE,                     /* long-to-double (0x86)       */
    DOP_TO_FLOAT_INT,                       /* float-to-int (0x87)         */
    DOP_TO_FLOAT_LONG,                      /* float-to-long (0x88)        */
    DOP_TO_FLOAT_DOUBLE,                    /* float-to-double (0x89)      */
    DOP_TO_DOUBLE_INT,                      /* double-to-int (0x8a)        */
    DOP_TO_DOUBLE_LONG,                     /* double-to-long (0x8b)       */
    DOP_TO_DOUBLE_FLOAT,                    /* double-to-float (0x8c)      */
    DOP_TO_INT_BYTE,                        /* int-to-byte (0x8d)          */
    DOP_TO_INT_CHAR,                        /* int-to-char (0x8e)          */
    DOP_TO_INT_SHORT,                       /* int-to-short (0x8f)         */
    DOP_ADD_INT,                            /* add-int (0x90)              */
    DOP_SUB_INT,                            /* sub-int (0x91)              */
    DOP_MUL_INT,                            /* mul-int (0x92)              */
    DOP_DIV_INT,                            /* div-int (0x93)              */
    DOP_REM_INT,                            /* rem-int (0x94)              */
    DOP_AND_INT,                            /* and-int (0x95)              */
    DOP_OR_INT,                             /* or-int (0x96)               */
    DOP_XOR_INT,                            /* xor-int (0x97)              */
    DOP_SHL_INT,                            /* shl-int (0x98)              */
    DOP_SHR_INT,                            /* shr-int (0x99)              */
    DOP_USHR_INT,                           /* ushr-int (0x9a)             */


    DOP_MUL_LONG,                           /* mul-long (0x9d)             */
    DOP_DIV_LONG,                           /* div-long (0x9e)             */


    DOP_SHL_LONG,                           /* shl-long (0xa3)             */
    DOP_SHR_LONG,                           /* shr-long (0xa4)             */
    DOP_USHR_LONG,                          /* ushr-long (0xa5)            */


    DOP_ADD_INT_2ADDR,                      /* add-int/2addr (0xb0)        */

    DOP_MUL_INT_2ADDR,                      /* mul-int/2addr (0xb2)        */
    DOP_DIV_INT_2ADDR,                      /* div-int/2addr (0xb3)        */
    DOP_REM_INT_2ADDR,                      /* rem-int/2addr (0xb4)        */
    DOP_AND_INT_2ADDR,                      /* and-int/2addr (0xb5)        */
    DOP_OR_INT_2ADDR,                       /* or-int/2addr (0xb6)         */
    DOP_XOR_INT_2ADDR,                      /* xor-int/2addr (0xb7)        */
    DOP_SHL_INT_2ADDR,                      /* shl-int/2addr (0xb8)        */
    DOP_SHR_INT_2ADDR,                      /* shr-int/2addr (0xb9)        */
    DOP_USHR_INT_2ADDR,                     /* ushr-int/2addr (0xba)       */
    DOP_ADD_LONG_2ADDR,                     /* add-long/2addr (0xbb)       */



    DOP_SHL_LONG_2ADDR,                     /* shl-long/2addr (0xc3)       */
    DOP_SHR_LONG_2ADDR,                     /* shr-long/2addr (0xc4)       */
    DOP_USHR_LONG_2ADDR,                    /* ushr-long/2addr (0xc5)      */


    DOP_MUL_DOUBLE_2ADDR,                   /* mul-double/2addr (0xcd)     */

    DOP_ADD_INT_LIT16,                      /* add-int/lit16 (0xd0)        */
    DOP_RSUB_INT,                           /* rsub-int (0xd1)             */
    DOP_MUL_INT_LIT16,                      /* mul-int/lit16 (0xd2)        */
    DOP_DIV_INT_LIT16,                      /* div-int/lit16 (0xd3)        */
    DOP_REM_INT_LIT16,                      /* rem-int/lit16 (0xd4)        */
    DOP_AND_INT_LIT16,                      /* and-int/lit16 (0xd5)        */
    DOP_OR_INT_LIT16,                       /* or-int/lit16 (0xd6)         */
    DOP_XOR_INT_LIT16,                      /* xor-int/lit16 (0xd7)        */
    DOP_ADD_INT_LIT8,                       /* add-int/lit8 (0xd8)         */
    DOP_RSUB_INT_LIT8,                      /* rsub-int/lit8 (0xd9)        */
    DOP_MUL_INT_LIT8,                       /* mul-int/lit8 (0xda)         */
    DOP_DIV_INT_LIT8,                       /* div-int/lit8 (0xdb)         */
    DOP_REM_INT_LIT8,                       /* rem-int/lit8 (0xdc)         */
    DOP_AND_INT_LIT8,                       /* and-int/lit8 (0xdd)         */
    DOP_OR_INT_LIT8,                        /* or-int/lit8 (0xde)          */
    DOP_XOR_INT_LIT8,                       /* xor-int/lit8 (0xdf)         */
    DOP_SHL_INT_LIT8,                       /* shl-int/lit8 (0xe0)         */
    DOP_SHR_INT_LIT8,                       /* shr-int/lit8 (0xe1)         */
    DOP_USHR_INT_LIT8,                      /* ushr-int/lit8 (0xe2)        */

    DOP_COUNT

} DalvikOpcodes;


/* Enumération de tous les pseudo-opcodes */
typedef enum _DalvikPseudoOpcodes
{
    DPO_PACKED_SWITCH   = 0x0100,           /* Switch aux clefs compactes  */
    DPO_SPARSE_SWITCH   = 0x0200,           /* Switch aux clefs éclatées   */
    DPO_FILL_ARRAY_DATA = 0x0300            /* Contenu de tableau          */

} DalvikPseudoOpcodes;



#endif  /* _ARCH_DALVIK_INSTRUCTION_DEF_H */