Rizin
unix-like reverse engineering framework and cli tools
jvm.c File Reference
#include "jvm.h"
#include "const.h"
#include <rz_analysis.h>

Go to the source code of this file.

Macros

#define fail_if_no_enough_buffer_or_set(bytecode, jvm, n)
 
#define load_ut8(bytecode, jvm, t, c)
 
#define load_ut8x2(bytecode, jvm, t0, t1, c0, c1)
 
#define load_ut16(bytecode, jvm, t, c)
 
#define load_ut32(bytecode, jvm, t, c)
 
#define load_ut16_ut8(bytecode, jvm, t0, t1, c0, c1)
 
#define load_ut16x2(bytecode, jvm, t0, t1, c0, c1)
 

Functions

static ut32 align_upper (JavaVM *jvm)
 
static bool decode_lookupswitch (JavaVM *jvm, Bytecode *bytecode)
 
static bool decode_tableswitch (JavaVM *jvm, Bytecode *bytecode)
 
static bool decode_instruction (JavaVM *jvm, Bytecode *bytecode)
 
void bytecode_snprint (RzStrBuf *sb, Bytecode *bytecode)
 
void bytecode_clean (Bytecode *bytecode)
 
bool jvm_init (JavaVM *jvm, const ut8 *buffer, const ut32 size, ut64 pc, ut64 section)
 
bool jvm_fetch (JavaVM *jvm, Bytecode *bytecode)
 

Macro Definition Documentation

◆ fail_if_no_enough_buffer_or_set

#define fail_if_no_enough_buffer_or_set (   bytecode,
  jvm,
  n 
)
Value:
if ((jvm->size - jvm->current) < n) { \
RZ_LOG_DEBUG("java: buffer is not big enough (available: %u, needed: %u)\n", jvm->size - jvm->current, n); \
return false; \
} \
bytecode->size = n
int n
Definition: mipsasm.c:19

Definition at line 8 of file jvm.c.

◆ load_ut16

#define load_ut16 (   bytecode,
  jvm,
  t,
  c 
)
Value:
fail_if_no_enough_buffer_or_set(bytecode, jvm, 3); \
bytecode->args[0] = (c)rz_read_at_be16(jvm->buffer, jvm->current + 1); \
bytecode->type[0] = (t)
#define fail_if_no_enough_buffer_or_set(bytecode, jvm, n)
Definition: jvm.c:8
static ut16 rz_read_at_be16(const void *src, size_t offset)
Definition: rz_endian.h:55
#define c(i)
Definition: sha256.c:43

Definition at line 27 of file jvm.c.

◆ load_ut16_ut8

#define load_ut16_ut8 (   bytecode,
  jvm,
  t0,
  t1,
  c0,
  c1 
)
Value:
fail_if_no_enough_buffer_or_set(bytecode, jvm, 4); \
bytecode->args[0] = (c0)rz_read_at_be16(jvm->buffer, jvm->current + 1); \
bytecode->type[0] = (t0); \
bytecode->args[1] = (c1)rz_read_at_be8(jvm->buffer, jvm->current + 3); \
bytecode->type[1] = (t1)
lsl lsr asr ror lsl lsr asr ror lsl lsl lsr asr ror lsl lsr asr ror lsl lsr asr ror lsl lsr asr ror lsl lsr asr ror lsl lsr asr ror lsl lsr asr ror lsl lsr asr ror lsl lsr asr ror lsl lsr asr ror c1
lsl lsr asr ror lsl lsr asr ror lsl lsl lsr asr ror lsl lsr asr ror lsl lsr asr ror lsl lsr asr ror lsl lsr asr ror lsl lsr asr ror lsl lsr asr ror lsl lsr asr ror lsl lsr asr ror lsl lsr asr ror c0
static ut8 rz_read_at_be8(const void *src, size_t offset)
Definition: rz_endian.h:38

Definition at line 37 of file jvm.c.

◆ load_ut16x2

#define load_ut16x2 (   bytecode,
  jvm,
  t0,
  t1,
  c0,
  c1 
)
Value:
fail_if_no_enough_buffer_or_set(bytecode, jvm, 5); \
bytecode->args[0] = (c0)rz_read_at_be16(jvm->buffer, jvm->current + 1); \
bytecode->type[0] = (t0); \
bytecode->args[1] = (c1)rz_read_at_be16(jvm->buffer, jvm->current + 3); \
bytecode->type[1] = (t1)

Definition at line 44 of file jvm.c.

◆ load_ut32

#define load_ut32 (   bytecode,
  jvm,
  t,
  c 
)
Value:
fail_if_no_enough_buffer_or_set(bytecode, jvm, 5); \
bytecode->args[0] = (c)rz_read_at_be32(jvm->buffer, jvm->current + 1); \
bytecode->type[0] = (t)
static ut32 rz_read_at_be32(const void *src, size_t offset)
Definition: rz_endian.h:93

Definition at line 32 of file jvm.c.

◆ load_ut8

#define load_ut8 (   bytecode,
  jvm,
  t,
  c 
)
Value:
fail_if_no_enough_buffer_or_set(bytecode, jvm, 2); \
bytecode->args[0] = (c)jvm->buffer[jvm->current + 1]; \
bytecode->type[0] = (t)

Definition at line 15 of file jvm.c.

◆ load_ut8x2

#define load_ut8x2 (   bytecode,
  jvm,
  t0,
  t1,
  c0,
  c1 
)
Value:
fail_if_no_enough_buffer_or_set(bytecode, jvm, 3); \
bytecode->args[0] = (c0)jvm->buffer[jvm->current + 1]; \
bytecode->type[0] = (t0); \
bytecode->args[1] = (c1)jvm->buffer[jvm->current + 2]; \
bytecode->type[1] = (t1)

Definition at line 20 of file jvm.c.

Function Documentation

◆ align_upper()

static ut32 align_upper ( JavaVM jvm)
inlinestatic

Definition at line 51 of file jvm.c.

51  {
52  ut64 base = jvm->pc - jvm->section + jvm->current + 1;
53  ut64 mod = base % 4;
54  if (mod != 0) {
55  return 4 - mod;
56  }
57  return 0;
58 }
int mod(int a, int b)
Definition: crypto_rot.c:8
ut64 pc
Definition: jvm.h:14
ut64 section
Definition: jvm.h:15
ut32 current
Definition: jvm.h:13
ut64(WINAPI *w32_GetEnabledXStateFeatures)()

References jvm_t::current, mod(), jvm_t::pc, jvm_t::section, and ut64().

Referenced by decode_lookupswitch(), and decode_tableswitch().

◆ bytecode_clean()

void bytecode_clean ( Bytecode bytecode)

Definition at line 1536 of file jvm.c.

1536  {
1537  rz_return_if_fail(bytecode);
1538  free(bytecode->extra);
1539 }
RZ_API void Ht_() free(HtName_(Ht) *ht)
Definition: ht_inc.c:130
#define rz_return_if_fail(expr)
Definition: rz_assert.h:100
void * extra
Definition: bytecode.h:244

References bytecode_t::extra, free(), and rz_return_if_fail.

Referenced by java_analysis(), and java_disassemble().

◆ bytecode_snprint()

void bytecode_snprint ( RzStrBuf sb,
Bytecode bytecode 
)

Definition at line 1458 of file jvm.c.

1458  {
1459  rz_return_if_fail(sb && bytecode);
1460  ut64 address;
1461  if (bytecode->opcode == BYTECODE_AA_TABLESWITCH) {
1462  rz_return_if_fail(bytecode->extra);
1463  TableSwitch *ts = (TableSwitch *)bytecode->extra;
1464 
1465  address = bytecode->pc + ts->pc_default;
1466  rz_strbuf_setf(sb, "%s default: 0x%" PFMT64x, bytecode->name, address);
1467  } else if (bytecode->opcode == BYTECODE_AB_LOOKUPSWITCH) {
1468  rz_return_if_fail(bytecode->extra);
1469  LookupSwitch *ls = (LookupSwitch *)bytecode->extra;
1470 
1471  address = bytecode->pc + ls->pc_default;
1472  rz_strbuf_setf(sb, "%s default: 0x%" PFMT64x, bytecode->name, address);
1473  } else if (bytecode->type[0] > 0 && !bytecode->type[1]) {
1474  if (bytecode->type[0] == BYTECODE_TYPE_NUMBER) {
1475  rz_strbuf_setf(sb, "%s %d", bytecode->name, bytecode->args[0]);
1476  } else if (bytecode->type[0] == BYTECODE_TYPE_CONST_POOL) {
1477  rz_strbuf_setf(sb, "%s " JAVA_ASM_CONSTANT_POOL_STR "%u", bytecode->name, bytecode->args[0]);
1478  } else if (bytecode->type[0] == BYTECODE_TYPE_ADDRESS) {
1479  address = bytecode->pc + bytecode->args[0];
1480  rz_strbuf_setf(sb, "%s 0x%" PFMT64x, bytecode->name, address);
1481  } else if (bytecode->type[0] == BYTECODE_TYPE_ATYPE) {
1482  const char *type = NULL;
1483  switch (bytecode->args[0]) {
1484  case 4:
1485  type = "bool";
1486  break;
1487  case 5:
1488  type = "char";
1489  break;
1490  case 6:
1491  type = "float";
1492  break;
1493  case 7:
1494  type = "double";
1495  break;
1496  case 8:
1497  type = "byte";
1498  break;
1499  case 9:
1500  type = "short";
1501  break;
1502  case 10:
1503  type = "int";
1504  break;
1505  case 11:
1506  type = "long";
1507  break;
1508  default:
1509  break;
1510  }
1511  if (type) {
1512  rz_strbuf_setf(sb, "%s %s", bytecode->name, type);
1513  } else {
1514  rz_strbuf_setf(sb, "%s unknown_type_%u", bytecode->name, bytecode->args[0]);
1515  }
1516  } else {
1517  rz_strbuf_setf(sb, "%s %u", bytecode->name, bytecode->args[0]);
1519  }
1520  } else if (bytecode->type[0] > 0 && bytecode->type[1] > 0) {
1521  if (bytecode->type[0] == BYTECODE_TYPE_NUMBER &&
1522  bytecode->type[1] == BYTECODE_TYPE_NUMBER) {
1523  rz_strbuf_setf(sb, "%s %d %d", bytecode->name, bytecode->args[0], bytecode->args[1]);
1524  } else if (bytecode->type[0] == BYTECODE_TYPE_CONST_POOL &&
1525  bytecode->type[1] == BYTECODE_TYPE_NUMBER) {
1526  rz_strbuf_setf(sb, "%s " JAVA_ASM_CONSTANT_POOL_STR "%u %d", bytecode->name, bytecode->args[0], bytecode->args[1]);
1527  } else {
1528  rz_strbuf_setf(sb, "%s %d %d", bytecode->name, bytecode->args[0], bytecode->args[1]);
1530  }
1531  } else {
1532  rz_strbuf_setf(sb, "%s", bytecode->name);
1533  }
1534 }
static SblHeader sb
Definition: bin_mbn.c:26
#define BYTECODE_AA_TABLESWITCH
Definition: bytecode.h:178
#define BYTECODE_AB_LOOKUPSWITCH
Definition: bytecode.h:179
@ BYTECODE_TYPE_CONST_POOL
Definition: bytecode.h:217
@ BYTECODE_TYPE_ATYPE
Definition: bytecode.h:219
@ BYTECODE_TYPE_ADDRESS
Definition: bytecode.h:218
@ BYTECODE_TYPE_NUMBER
Definition: bytecode.h:216
#define JAVA_ASM_CONSTANT_POOL_STR
Definition: const.h:7
#define NULL
Definition: cris-opc.c:27
int type
Definition: mipsasm.c:17
#define rz_warn_if_reached()
Definition: rz_assert.h:29
RZ_API const char * rz_strbuf_setf(RzStrBuf *sb, const char *fmt,...) RZ_PRINTF_CHECK(2
#define PFMT64x
Definition: rz_types.h:393
ut64 pc
Definition: bytecode.h:239
char name[32]
Definition: bytecode.h:235
ut16 opcode
Definition: bytecode.h:237
ut32 type[2]
Definition: bytecode.h:241
st32 args[2]
Definition: bytecode.h:240
ut32 pc_default
Definition: bytecode.h:230
ut32 pc_default
Definition: bytecode.h:223

References bytecode_t::args, BYTECODE_AA_TABLESWITCH, BYTECODE_AB_LOOKUPSWITCH, BYTECODE_TYPE_ADDRESS, BYTECODE_TYPE_ATYPE, BYTECODE_TYPE_CONST_POOL, BYTECODE_TYPE_NUMBER, bytecode_t::extra, JAVA_ASM_CONSTANT_POOL_STR, bytecode_t::name, NULL, bytecode_t::opcode, bytecode_t::pc, tableswitch_t::pc_default, lookupswitch_t::pc_default, PFMT64x, rz_return_if_fail, rz_strbuf_setf(), rz_warn_if_reached, sb, bytecode_t::type, type, and ut64().

Referenced by java_disassemble().

◆ decode_instruction()

static bool decode_instruction ( JavaVM jvm,
Bytecode bytecode 
)
static

Definition at line 125 of file jvm.c.

125  {
126  rz_return_val_if_fail((jvm->size - jvm->current) >= 1, false);
127 
128  memset(bytecode, 0, sizeof(Bytecode));
129 
130  const ut8 *buffer = jvm->buffer;
131 
132  ut8 byte = buffer[jvm->current];
133  switch (byte) {
134  case BYTECODE_00_NOP:
135  strcpy(bytecode->name, "nop");
136  bytecode->size = 1;
137  bytecode->atype = RZ_ANALYSIS_OP_TYPE_NOP;
138  break;
140  strcpy(bytecode->name, "aconst_null");
141  bytecode->size = 1;
142  bytecode->stack_output = 1;
143  bytecode->atype = RZ_ANALYSIS_OP_TYPE_PUSH;
144  break;
146  strcpy(bytecode->name, "iconst_m1");
147  bytecode->size = 1;
148  bytecode->stack_output = 1;
149  bytecode->atype = RZ_ANALYSIS_OP_TYPE_PUSH;
150  break;
152  strcpy(bytecode->name, "iconst_0");
153  bytecode->size = 1;
154  bytecode->stack_output = 1;
155  bytecode->atype = RZ_ANALYSIS_OP_TYPE_PUSH;
156  break;
158  strcpy(bytecode->name, "iconst_1");
159  bytecode->size = 1;
160  bytecode->stack_output = 1;
161  bytecode->atype = RZ_ANALYSIS_OP_TYPE_PUSH;
162  break;
164  strcpy(bytecode->name, "iconst_2");
165  bytecode->size = 1;
166  bytecode->stack_output = 1;
167  bytecode->atype = RZ_ANALYSIS_OP_TYPE_PUSH;
168  break;
170  strcpy(bytecode->name, "iconst_3");
171  bytecode->size = 1;
172  bytecode->stack_output = 1;
173  bytecode->atype = RZ_ANALYSIS_OP_TYPE_PUSH;
174  break;
176  strcpy(bytecode->name, "iconst_4");
177  bytecode->size = 1;
178  bytecode->stack_output = 1;
179  bytecode->atype = RZ_ANALYSIS_OP_TYPE_PUSH;
180  break;
182  strcpy(bytecode->name, "iconst_5");
183  bytecode->size = 1;
184  bytecode->stack_output = 1;
185  bytecode->atype = RZ_ANALYSIS_OP_TYPE_PUSH;
186  break;
188  strcpy(bytecode->name, "lconst_0");
189  bytecode->size = 1;
190  bytecode->stack_output = 1;
191  bytecode->atype = RZ_ANALYSIS_OP_TYPE_PUSH;
192  break;
194  strcpy(bytecode->name, "lconst_1");
195  bytecode->size = 1;
196  bytecode->stack_output = 1;
197  bytecode->atype = RZ_ANALYSIS_OP_TYPE_PUSH;
198  break;
200  strcpy(bytecode->name, "fconst_0");
201  bytecode->size = 1;
202  bytecode->stack_output = 1;
203  bytecode->atype = RZ_ANALYSIS_OP_TYPE_PUSH;
204  break;
206  strcpy(bytecode->name, "fconst_1");
207  bytecode->size = 1;
208  bytecode->stack_output = 1;
209  bytecode->atype = RZ_ANALYSIS_OP_TYPE_PUSH;
210  break;
212  strcpy(bytecode->name, "fconst_2");
213  bytecode->size = 1;
214  bytecode->stack_output = 1;
215  bytecode->atype = RZ_ANALYSIS_OP_TYPE_PUSH;
216  break;
218  strcpy(bytecode->name, "dconst_0");
219  bytecode->size = 1;
220  bytecode->stack_output = 1;
221  bytecode->atype = RZ_ANALYSIS_OP_TYPE_PUSH;
222  break;
224  strcpy(bytecode->name, "dconst_1");
225  bytecode->size = 1;
226  bytecode->stack_output = 1;
227  bytecode->atype = RZ_ANALYSIS_OP_TYPE_PUSH;
228  break;
229  case BYTECODE_10_BIPUSH:
230  strcpy(bytecode->name, "bipush");
231  load_ut8(bytecode, jvm, BYTECODE_TYPE_NUMBER, st32);
232  bytecode->stack_output = 1;
233  bytecode->atype = RZ_ANALYSIS_OP_TYPE_PUSH;
234  break;
235  case BYTECODE_11_SIPUSH:
236  strcpy(bytecode->name, "sipush");
237  load_ut16(bytecode, jvm, BYTECODE_TYPE_NUMBER, st32);
238  bytecode->stack_output = 1;
239  bytecode->atype = RZ_ANALYSIS_OP_TYPE_PUSH;
240  break;
241  case BYTECODE_12_LDC:
242  strcpy(bytecode->name, "ldc");
243  load_ut8(bytecode, jvm, BYTECODE_TYPE_CONST_POOL, ut32);
244  bytecode->stack_output = 1;
245  bytecode->atype = RZ_ANALYSIS_OP_TYPE_LOAD;
246  break;
247  case BYTECODE_13_LDC_W:
248  strcpy(bytecode->name, "ldc_w");
249  load_ut16(bytecode, jvm, BYTECODE_TYPE_CONST_POOL, ut32);
250  bytecode->stack_output = 1;
251  bytecode->atype = RZ_ANALYSIS_OP_TYPE_LOAD;
252  break;
253  case BYTECODE_14_LDC2_W:
254  strcpy(bytecode->name, "ldc2_w");
255  load_ut16(bytecode, jvm, BYTECODE_TYPE_CONST_POOL, ut32);
256  bytecode->stack_output = 1;
257  bytecode->atype = RZ_ANALYSIS_OP_TYPE_LOAD;
258  break;
259  case BYTECODE_15_ILOAD:
260  strcpy(bytecode->name, "iload");
261  load_ut8(bytecode, jvm, BYTECODE_TYPE_NUMBER, ut32);
262  bytecode->stack_output = 1;
263  bytecode->atype = RZ_ANALYSIS_OP_TYPE_LOAD;
264  break;
265  case BYTECODE_16_LLOAD:
266  strcpy(bytecode->name, "lload");
267  load_ut8(bytecode, jvm, BYTECODE_TYPE_NUMBER, ut32);
268  bytecode->stack_output = 1;
269  bytecode->atype = RZ_ANALYSIS_OP_TYPE_LOAD;
270  break;
271  case BYTECODE_17_FLOAD:
272  strcpy(bytecode->name, "fload");
273  load_ut8(bytecode, jvm, BYTECODE_TYPE_NUMBER, ut32);
274  bytecode->stack_output = 1;
275  bytecode->atype = RZ_ANALYSIS_OP_TYPE_LOAD;
276  break;
277  case BYTECODE_18_DLOAD:
278  strcpy(bytecode->name, "dload");
279  load_ut8(bytecode, jvm, BYTECODE_TYPE_NUMBER, ut32);
280  bytecode->stack_output = 1;
281  bytecode->atype = RZ_ANALYSIS_OP_TYPE_LOAD;
282  break;
283  case BYTECODE_19_ALOAD:
284  strcpy(bytecode->name, "aload");
285  load_ut8(bytecode, jvm, BYTECODE_TYPE_NUMBER, ut32);
286  bytecode->stack_output = 1;
287  bytecode->atype = RZ_ANALYSIS_OP_TYPE_LOAD;
288  break;
289  case BYTECODE_1A_ILOAD_0:
290  strcpy(bytecode->name, "iload_0");
291  bytecode->stack_output = 1;
292  bytecode->size = 1;
293  bytecode->atype = RZ_ANALYSIS_OP_TYPE_LOAD;
294  break;
295  case BYTECODE_1B_ILOAD_1:
296  strcpy(bytecode->name, "iload_1");
297  bytecode->stack_output = 1;
298  bytecode->size = 1;
299  bytecode->atype = RZ_ANALYSIS_OP_TYPE_LOAD;
300  break;
301  case BYTECODE_1C_ILOAD_2:
302  strcpy(bytecode->name, "iload_2");
303  bytecode->stack_output = 1;
304  bytecode->size = 1;
305  bytecode->atype = RZ_ANALYSIS_OP_TYPE_LOAD;
306  break;
307  case BYTECODE_1D_ILOAD_3:
308  strcpy(bytecode->name, "iload_3");
309  bytecode->stack_output = 1;
310  bytecode->size = 1;
311  bytecode->atype = RZ_ANALYSIS_OP_TYPE_LOAD;
312  break;
313  case BYTECODE_1E_LLOAD_0:
314  strcpy(bytecode->name, "lload_0");
315  bytecode->stack_output = 1;
316  bytecode->size = 1;
317  bytecode->atype = RZ_ANALYSIS_OP_TYPE_LOAD;
318  break;
319  case BYTECODE_1F_LLOAD_1:
320  strcpy(bytecode->name, "lload_1");
321  bytecode->stack_output = 1;
322  bytecode->size = 1;
323  bytecode->atype = RZ_ANALYSIS_OP_TYPE_LOAD;
324  break;
325  case BYTECODE_20_LLOAD_2:
326  strcpy(bytecode->name, "lload_2");
327  bytecode->stack_output = 1;
328  bytecode->size = 1;
329  bytecode->atype = RZ_ANALYSIS_OP_TYPE_LOAD;
330  break;
331  case BYTECODE_21_LLOAD_3:
332  strcpy(bytecode->name, "lload_3");
333  bytecode->stack_output = 1;
334  bytecode->size = 1;
335  bytecode->atype = RZ_ANALYSIS_OP_TYPE_LOAD;
336  break;
337  case BYTECODE_22_FLOAD_0:
338  strcpy(bytecode->name, "fload_0");
339  bytecode->stack_output = 1;
340  bytecode->size = 1;
341  bytecode->atype = RZ_ANALYSIS_OP_TYPE_LOAD;
342  break;
343  case BYTECODE_23_FLOAD_1:
344  strcpy(bytecode->name, "fload_1");
345  bytecode->stack_output = 1;
346  bytecode->size = 1;
347  bytecode->atype = RZ_ANALYSIS_OP_TYPE_LOAD;
348  break;
349  case BYTECODE_24_FLOAD_2:
350  strcpy(bytecode->name, "fload_2");
351  bytecode->stack_output = 1;
352  bytecode->size = 1;
353  bytecode->atype = RZ_ANALYSIS_OP_TYPE_LOAD;
354  break;
355  case BYTECODE_25_FLOAD_3:
356  strcpy(bytecode->name, "fload_3");
357  bytecode->stack_output = 1;
358  bytecode->size = 1;
359  bytecode->atype = RZ_ANALYSIS_OP_TYPE_LOAD;
360  break;
361  case BYTECODE_26_DLOAD_0:
362  strcpy(bytecode->name, "dload_0");
363  bytecode->stack_output = 1;
364  bytecode->size = 1;
365  bytecode->atype = RZ_ANALYSIS_OP_TYPE_LOAD;
366  break;
367  case BYTECODE_27_DLOAD_1:
368  strcpy(bytecode->name, "dload_1");
369  bytecode->stack_output = 1;
370  bytecode->size = 1;
371  bytecode->atype = RZ_ANALYSIS_OP_TYPE_LOAD;
372  break;
373  case BYTECODE_28_DLOAD_2:
374  strcpy(bytecode->name, "dload_2");
375  bytecode->stack_output = 1;
376  bytecode->size = 1;
377  bytecode->atype = RZ_ANALYSIS_OP_TYPE_LOAD;
378  break;
379  case BYTECODE_29_DLOAD_3:
380  strcpy(bytecode->name, "dload_3");
381  bytecode->stack_output = 1;
382  bytecode->size = 1;
383  bytecode->atype = RZ_ANALYSIS_OP_TYPE_LOAD;
384  break;
385  case BYTECODE_2A_ALOAD_0:
386  strcpy(bytecode->name, "aload_0");
387  bytecode->stack_output = 1;
388  bytecode->size = 1;
389  bytecode->atype = RZ_ANALYSIS_OP_TYPE_LOAD;
390  break;
391  case BYTECODE_2B_ALOAD_1:
392  strcpy(bytecode->name, "aload_1");
393  bytecode->stack_output = 1;
394  bytecode->size = 1;
395  bytecode->atype = RZ_ANALYSIS_OP_TYPE_LOAD;
396  break;
397  case BYTECODE_2C_ALOAD_2:
398  strcpy(bytecode->name, "aload_2");
399  bytecode->stack_output = 1;
400  bytecode->size = 1;
401  bytecode->atype = RZ_ANALYSIS_OP_TYPE_LOAD;
402  break;
403  case BYTECODE_2D_ALOAD_3:
404  strcpy(bytecode->name, "aload_3");
405  bytecode->stack_output = 1;
406  bytecode->size = 1;
407  bytecode->atype = RZ_ANALYSIS_OP_TYPE_LOAD;
408  break;
409  case BYTECODE_2E_IALOAD:
410  strcpy(bytecode->name, "iaload");
411  bytecode->stack_input = 2;
412  bytecode->stack_output = 1;
413  bytecode->size = 1;
414  bytecode->atype = RZ_ANALYSIS_OP_TYPE_LOAD;
415  break;
416  case BYTECODE_2F_LALOAD:
417  strcpy(bytecode->name, "laload");
418  bytecode->stack_input = 2;
419  bytecode->stack_output = 1;
420  bytecode->size = 1;
421  bytecode->atype = RZ_ANALYSIS_OP_TYPE_LOAD;
422  break;
423  case BYTECODE_30_FALOAD:
424  strcpy(bytecode->name, "faload");
425  bytecode->stack_input = 2;
426  bytecode->stack_output = 1;
427  bytecode->size = 1;
428  bytecode->atype = RZ_ANALYSIS_OP_TYPE_LOAD;
429  break;
430  case BYTECODE_31_DALOAD:
431  strcpy(bytecode->name, "daload");
432  bytecode->stack_input = 2;
433  bytecode->stack_output = 1;
434  bytecode->size = 1;
435  bytecode->atype = RZ_ANALYSIS_OP_TYPE_LOAD;
436  break;
437  case BYTECODE_32_AALOAD:
438  strcpy(bytecode->name, "aaload");
439  bytecode->size = 1;
440  bytecode->stack_input = 2;
441  bytecode->stack_output = 1;
442  bytecode->atype = RZ_ANALYSIS_OP_TYPE_LOAD;
443  break;
444  case BYTECODE_33_BALOAD:
445  strcpy(bytecode->name, "baload");
446  bytecode->stack_input = 2;
447  bytecode->stack_output = 1;
448  bytecode->size = 1;
449  bytecode->atype = RZ_ANALYSIS_OP_TYPE_LOAD;
450  break;
451  case BYTECODE_34_CALOAD:
452  strcpy(bytecode->name, "caload");
453  bytecode->size = 1;
454  bytecode->stack_input = 2;
455  bytecode->stack_output = 1;
456  bytecode->atype = RZ_ANALYSIS_OP_TYPE_LOAD;
457  break;
458  case BYTECODE_35_SALOAD:
459  strcpy(bytecode->name, "saload");
460  bytecode->stack_input = 2;
461  bytecode->stack_output = 1;
462  bytecode->size = 1;
463  bytecode->atype = RZ_ANALYSIS_OP_TYPE_LOAD;
464  break;
465  case BYTECODE_36_ISTORE:
466  strcpy(bytecode->name, "istore");
467  load_ut8(bytecode, jvm, BYTECODE_TYPE_NUMBER, ut32);
468  bytecode->stack_input = 1;
469  bytecode->atype = RZ_ANALYSIS_OP_TYPE_STORE;
470  break;
471  case BYTECODE_37_LSTORE:
472  strcpy(bytecode->name, "lstore");
473  load_ut8(bytecode, jvm, BYTECODE_TYPE_NUMBER, ut32);
474  bytecode->stack_input = 1;
475  bytecode->atype = RZ_ANALYSIS_OP_TYPE_STORE;
476  break;
477  case BYTECODE_38_FSTORE:
478  strcpy(bytecode->name, "fstore");
479  load_ut8(bytecode, jvm, BYTECODE_TYPE_NUMBER, ut32);
480  bytecode->stack_input = 1;
481  bytecode->atype = RZ_ANALYSIS_OP_TYPE_STORE;
482  break;
483  case BYTECODE_39_DSTORE:
484  strcpy(bytecode->name, "dstore");
485  load_ut8(bytecode, jvm, BYTECODE_TYPE_NUMBER, ut32);
486  bytecode->stack_input = 1;
487  bytecode->atype = RZ_ANALYSIS_OP_TYPE_STORE;
488  break;
489  case BYTECODE_3A_ASTORE:
490  strcpy(bytecode->name, "astore");
491  load_ut8(bytecode, jvm, BYTECODE_TYPE_NUMBER, ut32);
492  bytecode->stack_input = 1;
493  bytecode->atype = RZ_ANALYSIS_OP_TYPE_STORE;
494  break;
496  strcpy(bytecode->name, "istore_0");
497  bytecode->stack_input = 1;
498  bytecode->size = 1;
499  bytecode->atype = RZ_ANALYSIS_OP_TYPE_STORE;
500  break;
502  strcpy(bytecode->name, "istore_1");
503  bytecode->stack_input = 1;
504  bytecode->size = 1;
505  bytecode->atype = RZ_ANALYSIS_OP_TYPE_STORE;
506  break;
508  strcpy(bytecode->name, "istore_2");
509  bytecode->stack_input = 1;
510  bytecode->size = 1;
511  bytecode->atype = RZ_ANALYSIS_OP_TYPE_STORE;
512  break;
514  strcpy(bytecode->name, "istore_3");
515  bytecode->stack_input = 1;
516  bytecode->size = 1;
517  bytecode->atype = RZ_ANALYSIS_OP_TYPE_STORE;
518  break;
520  strcpy(bytecode->name, "lstore_0");
521  bytecode->stack_input = 1;
522  bytecode->size = 1;
523  bytecode->atype = RZ_ANALYSIS_OP_TYPE_STORE;
524  break;
526  strcpy(bytecode->name, "lstore_1");
527  bytecode->stack_input = 1;
528  bytecode->size = 1;
529  bytecode->atype = RZ_ANALYSIS_OP_TYPE_STORE;
530  break;
532  strcpy(bytecode->name, "lstore_2");
533  bytecode->stack_input = 1;
534  bytecode->size = 1;
535  bytecode->atype = RZ_ANALYSIS_OP_TYPE_STORE;
536  break;
538  strcpy(bytecode->name, "lstore_3");
539  bytecode->stack_input = 1;
540  bytecode->size = 1;
541  bytecode->atype = RZ_ANALYSIS_OP_TYPE_STORE;
542  break;
544  strcpy(bytecode->name, "fstore_0");
545  bytecode->stack_input = 1;
546  bytecode->size = 1;
547  bytecode->atype = RZ_ANALYSIS_OP_TYPE_STORE;
548  break;
550  strcpy(bytecode->name, "fstore_1");
551  bytecode->stack_input = 1;
552  bytecode->size = 1;
553  bytecode->atype = RZ_ANALYSIS_OP_TYPE_STORE;
554  break;
556  strcpy(bytecode->name, "fstore_2");
557  bytecode->stack_input = 1;
558  bytecode->size = 1;
559  bytecode->atype = RZ_ANALYSIS_OP_TYPE_STORE;
560  break;
562  strcpy(bytecode->name, "fstore_3");
563  bytecode->stack_input = 1;
564  bytecode->size = 1;
565  bytecode->atype = RZ_ANALYSIS_OP_TYPE_STORE;
566  break;
568  strcpy(bytecode->name, "dstore_0");
569  bytecode->stack_input = 1;
570  bytecode->size = 1;
571  bytecode->atype = RZ_ANALYSIS_OP_TYPE_STORE;
572  break;
574  strcpy(bytecode->name, "dstore_1");
575  bytecode->stack_input = 1;
576  bytecode->size = 1;
577  bytecode->atype = RZ_ANALYSIS_OP_TYPE_STORE;
578  break;
580  strcpy(bytecode->name, "dstore_2");
581  bytecode->stack_input = 1;
582  bytecode->size = 1;
583  bytecode->atype = RZ_ANALYSIS_OP_TYPE_STORE;
584  break;
586  strcpy(bytecode->name, "dstore_3");
587  bytecode->stack_input = 1;
588  bytecode->size = 1;
589  bytecode->atype = RZ_ANALYSIS_OP_TYPE_STORE;
590  break;
592  strcpy(bytecode->name, "astore_0");
593  bytecode->stack_input = 1;
594  bytecode->size = 1;
595  bytecode->atype = RZ_ANALYSIS_OP_TYPE_STORE;
596  break;
598  strcpy(bytecode->name, "astore_1");
599  bytecode->stack_input = 1;
600  bytecode->size = 1;
601  bytecode->atype = RZ_ANALYSIS_OP_TYPE_STORE;
602  break;
604  strcpy(bytecode->name, "astore_2");
605  bytecode->stack_input = 1;
606  bytecode->size = 1;
607  bytecode->atype = RZ_ANALYSIS_OP_TYPE_STORE;
608  break;
610  strcpy(bytecode->name, "astore_3");
611  bytecode->stack_input = 1;
612  bytecode->size = 1;
613  bytecode->atype = RZ_ANALYSIS_OP_TYPE_STORE;
614  break;
615  case BYTECODE_4F_IASTORE:
616  strcpy(bytecode->name, "iastore");
617  bytecode->stack_input = 3;
618  bytecode->size = 1;
619  bytecode->atype = RZ_ANALYSIS_OP_TYPE_STORE;
620  break;
621  case BYTECODE_50_LASTORE:
622  strcpy(bytecode->name, "lastore");
623  bytecode->stack_input = 3;
624  bytecode->size = 1;
625  bytecode->atype = RZ_ANALYSIS_OP_TYPE_STORE;
626  break;
627  case BYTECODE_51_FASTORE:
628  strcpy(bytecode->name, "fastore");
629  bytecode->stack_input = 3;
630  bytecode->size = 1;
631  bytecode->atype = RZ_ANALYSIS_OP_TYPE_STORE;
632  break;
633  case BYTECODE_52_DASTORE:
634  strcpy(bytecode->name, "dastore");
635  bytecode->stack_input = 2;
636  bytecode->stack_output = 1;
637  bytecode->size = 1;
638  bytecode->atype = RZ_ANALYSIS_OP_TYPE_STORE;
639  break;
640  case BYTECODE_53_AASTORE:
641  strcpy(bytecode->name, "aastore");
642  bytecode->size = 1;
643  bytecode->stack_input = 3;
644  bytecode->atype = RZ_ANALYSIS_OP_TYPE_STORE;
645  break;
646  case BYTECODE_54_BASTORE:
647  strcpy(bytecode->name, "bastore");
648  bytecode->stack_input = 3;
649  bytecode->size = 1;
650  bytecode->atype = RZ_ANALYSIS_OP_TYPE_STORE;
651  break;
652  case BYTECODE_55_CASTORE:
653  strcpy(bytecode->name, "castore");
654  bytecode->size = 1;
655  bytecode->stack_input = 3;
656  bytecode->atype = RZ_ANALYSIS_OP_TYPE_STORE;
657  break;
658  case BYTECODE_56_SASTORE:
659  strcpy(bytecode->name, "sastore");
660  bytecode->stack_input = 2;
661  bytecode->stack_output = 1;
662  bytecode->size = 1;
663  bytecode->atype = RZ_ANALYSIS_OP_TYPE_STORE;
664  break;
665  case BYTECODE_57_POP:
666  strcpy(bytecode->name, "pop");
667  bytecode->stack_input = 1;
668  bytecode->size = 1;
669  bytecode->atype = RZ_ANALYSIS_OP_TYPE_POP;
670  break;
671  case BYTECODE_58_POP2:
672  strcpy(bytecode->name, "pop2");
673  bytecode->stack_input = 2;
674  bytecode->size = 1;
675  bytecode->atype = RZ_ANALYSIS_OP_TYPE_POP;
676  break;
677  case BYTECODE_59_DUP:
678  strcpy(bytecode->name, "dup");
679  bytecode->stack_input = 1;
680  bytecode->stack_output = 2;
681  bytecode->size = 1;
682  bytecode->atype = RZ_ANALYSIS_OP_TYPE_PUSH;
683  break;
684  case BYTECODE_5A_DUP_X1:
685  strcpy(bytecode->name, "dup_x1");
686  bytecode->stack_input = 2;
687  bytecode->stack_output = 3;
688  bytecode->size = 1;
689  bytecode->atype = RZ_ANALYSIS_OP_TYPE_PUSH;
690  break;
691  case BYTECODE_5B_DUP_X2:
692  strcpy(bytecode->name, "dup_x2");
693  bytecode->stack_input = 3;
694  bytecode->stack_output = 4;
695  bytecode->size = 1;
696  bytecode->atype = RZ_ANALYSIS_OP_TYPE_PUSH;
697  break;
698  case BYTECODE_5C_DUP2:
699  strcpy(bytecode->name, "dup2");
700  bytecode->stack_input = 2;
701  bytecode->stack_output = 4;
702  bytecode->size = 1;
703  bytecode->atype = RZ_ANALYSIS_OP_TYPE_PUSH;
704  break;
705  case BYTECODE_5D_DUP2_X1:
706  strcpy(bytecode->name, "dup2_x1");
707  bytecode->stack_input = 3;
708  bytecode->stack_output = 5;
709  bytecode->size = 1;
710  bytecode->atype = RZ_ANALYSIS_OP_TYPE_PUSH;
711  break;
712  case BYTECODE_5E_DUP2_X2:
713  strcpy(bytecode->name, "dup2_x2");
714  bytecode->stack_input = 4;
715  bytecode->stack_output = 6;
716  bytecode->size = 1;
717  bytecode->atype = RZ_ANALYSIS_OP_TYPE_PUSH;
718  break;
719  case BYTECODE_5F_SWAP:
720  strcpy(bytecode->name, "swap");
721  bytecode->size = 1;
722  bytecode->stack_input = 2;
723  bytecode->stack_output = 2;
724  bytecode->atype = RZ_ANALYSIS_OP_TYPE_MOV;
725  break;
726  case BYTECODE_60_IADD:
727  strcpy(bytecode->name, "iadd");
728  bytecode->stack_input = 2;
729  bytecode->stack_output = 1;
730  bytecode->size = 1;
731  bytecode->atype = RZ_ANALYSIS_OP_TYPE_ADD;
732  break;
733  case BYTECODE_61_LADD:
734  strcpy(bytecode->name, "ladd");
735  bytecode->stack_input = 2;
736  bytecode->stack_output = 1;
737  bytecode->size = 1;
738  bytecode->atype = RZ_ANALYSIS_OP_TYPE_ADD;
739  break;
740  case BYTECODE_62_FADD:
741  strcpy(bytecode->name, "fadd");
742  bytecode->stack_input = 2;
743  bytecode->stack_output = 1;
744  bytecode->size = 1;
745  bytecode->atype = RZ_ANALYSIS_OP_TYPE_ADD;
746  break;
747  case BYTECODE_63_DADD:
748  strcpy(bytecode->name, "dadd");
749  bytecode->stack_input = 2;
750  bytecode->stack_output = 1;
751  bytecode->size = 1;
752  bytecode->atype = RZ_ANALYSIS_OP_TYPE_ADD;
753  break;
754  case BYTECODE_64_ISUB:
755  strcpy(bytecode->name, "isub");
756  bytecode->stack_input = 2;
757  bytecode->stack_output = 1;
758  bytecode->size = 1;
759  bytecode->atype = RZ_ANALYSIS_OP_TYPE_SUB;
760  break;
761  case BYTECODE_65_LSUB:
762  strcpy(bytecode->name, "lsub");
763  bytecode->stack_input = 2;
764  bytecode->stack_output = 1;
765  bytecode->size = 1;
766  bytecode->atype = RZ_ANALYSIS_OP_TYPE_SUB;
767  break;
768  case BYTECODE_66_FSUB:
769  strcpy(bytecode->name, "fsub");
770  bytecode->stack_input = 2;
771  bytecode->stack_output = 1;
772  bytecode->size = 1;
773  bytecode->atype = RZ_ANALYSIS_OP_TYPE_SUB;
774  break;
775  case BYTECODE_67_DSUB:
776  strcpy(bytecode->name, "dsub");
777  bytecode->stack_input = 2;
778  bytecode->stack_output = 1;
779  bytecode->size = 1;
780  bytecode->atype = RZ_ANALYSIS_OP_TYPE_SUB;
781  break;
782  case BYTECODE_68_IMUL:
783  strcpy(bytecode->name, "imul");
784  bytecode->stack_input = 2;
785  bytecode->stack_output = 1;
786  bytecode->size = 1;
787  bytecode->atype = RZ_ANALYSIS_OP_TYPE_MUL;
788  break;
789  case BYTECODE_69_LMUL:
790  strcpy(bytecode->name, "lmul");
791  bytecode->stack_input = 2;
792  bytecode->stack_output = 1;
793  bytecode->size = 1;
794  bytecode->atype = RZ_ANALYSIS_OP_TYPE_MUL;
795  break;
796  case BYTECODE_6A_FMUL:
797  strcpy(bytecode->name, "fmul");
798  bytecode->stack_input = 2;
799  bytecode->stack_output = 1;
800  bytecode->size = 1;
801  bytecode->atype = RZ_ANALYSIS_OP_TYPE_MUL;
802  break;
803  case BYTECODE_6B_DMUL:
804  strcpy(bytecode->name, "dmul");
805  bytecode->stack_input = 2;
806  bytecode->stack_output = 1;
807  bytecode->size = 1;
808  bytecode->atype = RZ_ANALYSIS_OP_TYPE_MUL;
809  break;
810  case BYTECODE_6C_IDIV:
811  strcpy(bytecode->name, "idiv");
812  bytecode->stack_input = 2;
813  bytecode->stack_output = 1;
814  bytecode->size = 1;
815  bytecode->atype = RZ_ANALYSIS_OP_TYPE_DIV;
816  break;
817  case BYTECODE_6D_LDIV:
818  strcpy(bytecode->name, "ldiv");
819  bytecode->stack_input = 2;
820  bytecode->stack_output = 1;
821  bytecode->size = 1;
822  bytecode->atype = RZ_ANALYSIS_OP_TYPE_DIV;
823  break;
824  case BYTECODE_6E_FDIV:
825  strcpy(bytecode->name, "fdiv");
826  bytecode->stack_input = 2;
827  bytecode->stack_output = 1;
828  bytecode->size = 1;
829  bytecode->atype = RZ_ANALYSIS_OP_TYPE_DIV;
830  break;
831  case BYTECODE_6F_DDIV:
832  strcpy(bytecode->name, "ddiv");
833  bytecode->stack_input = 2;
834  bytecode->stack_output = 1;
835  bytecode->size = 1;
836  bytecode->atype = RZ_ANALYSIS_OP_TYPE_DIV;
837  break;
838  case BYTECODE_70_IREM:
839  strcpy(bytecode->name, "irem");
840  bytecode->stack_input = 2;
841  bytecode->stack_output = 1;
842  bytecode->size = 1;
843  bytecode->atype = RZ_ANALYSIS_OP_TYPE_MOD;
844  break;
845  case BYTECODE_71_LREM:
846  strcpy(bytecode->name, "lrem");
847  bytecode->stack_input = 2;
848  bytecode->stack_output = 1;
849  bytecode->size = 1;
850  bytecode->atype = RZ_ANALYSIS_OP_TYPE_MOD;
851  break;
852  case BYTECODE_72_FREM:
853  strcpy(bytecode->name, "frem");
854  bytecode->stack_input = 2;
855  bytecode->stack_output = 1;
856  bytecode->size = 1;
857  bytecode->atype = RZ_ANALYSIS_OP_TYPE_MOD;
858  break;
859  case BYTECODE_73_DREM:
860  strcpy(bytecode->name, "drem");
861  bytecode->stack_input = 2;
862  bytecode->stack_output = 1;
863  bytecode->size = 1;
864  bytecode->atype = RZ_ANALYSIS_OP_TYPE_MOD;
865  break;
866  case BYTECODE_74_INEG:
867  strcpy(bytecode->name, "ineg");
868  bytecode->stack_input = 1;
869  bytecode->stack_output = 1;
870  bytecode->size = 1;
871  bytecode->atype = RZ_ANALYSIS_OP_TYPE_SUB;
872  break;
873  case BYTECODE_75_LNEG:
874  strcpy(bytecode->name, "lneg");
875  bytecode->stack_input = 1;
876  bytecode->stack_output = 1;
877  bytecode->size = 1;
878  bytecode->atype = RZ_ANALYSIS_OP_TYPE_SUB;
879  break;
880  case BYTECODE_76_FNEG:
881  strcpy(bytecode->name, "fneg");
882  bytecode->stack_input = 1;
883  bytecode->stack_output = 1;
884  bytecode->size = 1;
885  bytecode->atype = RZ_ANALYSIS_OP_TYPE_SUB;
886  break;
887  case BYTECODE_77_DNEG:
888  strcpy(bytecode->name, "dneg");
889  bytecode->stack_input = 1;
890  bytecode->stack_output = 1;
891  bytecode->size = 1;
892  bytecode->atype = RZ_ANALYSIS_OP_TYPE_SUB;
893  break;
894  case BYTECODE_78_ISHL:
895  strcpy(bytecode->name, "ishl");
896  bytecode->stack_input = 2;
897  bytecode->stack_output = 1;
898  bytecode->size = 1;
899  bytecode->atype = RZ_ANALYSIS_OP_TYPE_SHL;
900  break;
901  case BYTECODE_79_LSHL:
902  strcpy(bytecode->name, "lshl");
903  bytecode->stack_input = 2;
904  bytecode->stack_output = 1;
905  bytecode->size = 1;
906  bytecode->atype = RZ_ANALYSIS_OP_TYPE_SHL;
907  break;
908  case BYTECODE_7A_ISHR:
909  strcpy(bytecode->name, "ishr");
910  bytecode->stack_input = 2;
911  bytecode->stack_output = 1;
912  bytecode->size = 1;
913  bytecode->atype = RZ_ANALYSIS_OP_TYPE_SHR;
914  break;
915  case BYTECODE_7B_LSHR:
916  strcpy(bytecode->name, "lshr");
917  bytecode->stack_input = 2;
918  bytecode->stack_output = 1;
919  bytecode->size = 1;
920  bytecode->atype = RZ_ANALYSIS_OP_TYPE_SHR;
921  break;
922  case BYTECODE_7C_IUSHR:
923  strcpy(bytecode->name, "iushr");
924  bytecode->stack_input = 2;
925  bytecode->stack_output = 1;
926  bytecode->size = 1;
927  bytecode->atype = RZ_ANALYSIS_OP_TYPE_SHR;
928  break;
929  case BYTECODE_7D_LUSHR:
930  strcpy(bytecode->name, "lushr");
931  bytecode->stack_input = 2;
932  bytecode->stack_output = 1;
933  bytecode->size = 1;
934  bytecode->atype = RZ_ANALYSIS_OP_TYPE_SHR;
935  break;
936  case BYTECODE_7E_IAND:
937  strcpy(bytecode->name, "iand");
938  bytecode->stack_input = 2;
939  bytecode->stack_output = 1;
940  bytecode->size = 1;
941  bytecode->atype = RZ_ANALYSIS_OP_TYPE_AND;
942  break;
943  case BYTECODE_7F_LAND:
944  strcpy(bytecode->name, "land");
945  bytecode->stack_input = 2;
946  bytecode->stack_output = 1;
947  bytecode->size = 1;
948  bytecode->atype = RZ_ANALYSIS_OP_TYPE_AND;
949  break;
950  case BYTECODE_80_IOR:
951  strcpy(bytecode->name, "ior");
952  bytecode->stack_input = 2;
953  bytecode->stack_output = 1;
954  bytecode->size = 1;
955  bytecode->atype = RZ_ANALYSIS_OP_TYPE_OR;
956  break;
957  case BYTECODE_81_LOR:
958  strcpy(bytecode->name, "lor");
959  bytecode->stack_input = 2;
960  bytecode->stack_output = 1;
961  bytecode->size = 1;
962  bytecode->atype = RZ_ANALYSIS_OP_TYPE_OR;
963  break;
964  case BYTECODE_82_IXOR:
965  strcpy(bytecode->name, "ixor");
966  bytecode->stack_input = 2;
967  bytecode->stack_output = 1;
968  bytecode->size = 1;
969  bytecode->atype = RZ_ANALYSIS_OP_TYPE_XOR;
970  break;
971  case BYTECODE_83_LXOR:
972  strcpy(bytecode->name, "lxor");
973  bytecode->stack_input = 2;
974  bytecode->stack_output = 1;
975  bytecode->size = 1;
976  bytecode->atype = RZ_ANALYSIS_OP_TYPE_XOR;
977  break;
978  case BYTECODE_84_IINC:
979  strcpy(bytecode->name, "iinc");
981  bytecode->atype = RZ_ANALYSIS_OP_TYPE_ADD;
982  break;
983  case BYTECODE_85_I2L:
984  strcpy(bytecode->name, "i2l");
985  bytecode->stack_input = 1;
986  bytecode->stack_output = 1;
987  bytecode->size = 1;
988  bytecode->atype = RZ_ANALYSIS_OP_TYPE_CAST;
989  break;
990  case BYTECODE_86_I2F:
991  strcpy(bytecode->name, "i2f");
992  bytecode->stack_input = 1;
993  bytecode->stack_output = 1;
994  bytecode->size = 1;
995  bytecode->atype = RZ_ANALYSIS_OP_TYPE_CAST;
996  break;
997  case BYTECODE_87_I2D:
998  strcpy(bytecode->name, "i2d");
999  bytecode->stack_input = 1;
1000  bytecode->stack_output = 1;
1001  bytecode->size = 1;
1002  bytecode->atype = RZ_ANALYSIS_OP_TYPE_CAST;
1003  break;
1004  case BYTECODE_88_L2I:
1005  strcpy(bytecode->name, "l2i");
1006  bytecode->stack_input = 1;
1007  bytecode->stack_output = 1;
1008  bytecode->size = 1;
1009  bytecode->atype = RZ_ANALYSIS_OP_TYPE_CAST;
1010  break;
1011  case BYTECODE_89_L2F:
1012  strcpy(bytecode->name, "l2f");
1013  bytecode->stack_input = 1;
1014  bytecode->stack_output = 1;
1015  bytecode->size = 1;
1016  bytecode->atype = RZ_ANALYSIS_OP_TYPE_CAST;
1017  break;
1018  case BYTECODE_8A_L2D:
1019  strcpy(bytecode->name, "l2d");
1020  bytecode->stack_input = 1;
1021  bytecode->stack_output = 1;
1022  bytecode->size = 1;
1023  bytecode->atype = RZ_ANALYSIS_OP_TYPE_CAST;
1024  break;
1025  case BYTECODE_8B_F2I:
1026  strcpy(bytecode->name, "f2i");
1027  bytecode->stack_input = 1;
1028  bytecode->stack_output = 1;
1029  bytecode->size = 1;
1030  bytecode->atype = RZ_ANALYSIS_OP_TYPE_CAST;
1031  break;
1032  case BYTECODE_8C_F2L:
1033  strcpy(bytecode->name, "f2l");
1034  bytecode->stack_input = 1;
1035  bytecode->stack_output = 1;
1036  bytecode->size = 1;
1037  bytecode->atype = RZ_ANALYSIS_OP_TYPE_CAST;
1038  break;
1039  case BYTECODE_8D_F2D:
1040  strcpy(bytecode->name, "f2d");
1041  bytecode->stack_input = 1;
1042  bytecode->stack_output = 1;
1043  bytecode->size = 1;
1044  bytecode->atype = RZ_ANALYSIS_OP_TYPE_CAST;
1045  break;
1046  case BYTECODE_8E_D2I:
1047  strcpy(bytecode->name, "d2i");
1048  bytecode->stack_input = 1;
1049  bytecode->stack_output = 1;
1050  bytecode->size = 1;
1051  bytecode->atype = RZ_ANALYSIS_OP_TYPE_CAST;
1052  break;
1053  case BYTECODE_8F_D2L:
1054  strcpy(bytecode->name, "d2l");
1055  bytecode->stack_input = 1;
1056  bytecode->stack_output = 1;
1057  bytecode->size = 1;
1058  bytecode->atype = RZ_ANALYSIS_OP_TYPE_CAST;
1059  break;
1060  case BYTECODE_90_D2F:
1061  strcpy(bytecode->name, "d2f");
1062  bytecode->stack_input = 1;
1063  bytecode->stack_output = 1;
1064  bytecode->size = 1;
1065  bytecode->atype = RZ_ANALYSIS_OP_TYPE_CAST;
1066  break;
1067  case BYTECODE_91_I2B:
1068  strcpy(bytecode->name, "i2b");
1069  bytecode->stack_input = 1;
1070  bytecode->stack_output = 1;
1071  bytecode->size = 1;
1072  bytecode->atype = RZ_ANALYSIS_OP_TYPE_CAST;
1073  break;
1074  case BYTECODE_92_I2C:
1075  strcpy(bytecode->name, "i2c");
1076  bytecode->stack_input = 1;
1077  bytecode->stack_output = 1;
1078  bytecode->size = 1;
1079  bytecode->atype = RZ_ANALYSIS_OP_TYPE_CAST;
1080  break;
1081  case BYTECODE_93_I2S:
1082  strcpy(bytecode->name, "i2s");
1083  bytecode->stack_input = 1;
1084  bytecode->stack_output = 1;
1085  bytecode->size = 1;
1086  bytecode->atype = RZ_ANALYSIS_OP_TYPE_CAST;
1087  break;
1088  case BYTECODE_94_LCMP:
1089  strcpy(bytecode->name, "lcmp");
1090  bytecode->stack_input = 2;
1091  bytecode->stack_output = 1;
1092  bytecode->size = 1;
1093  bytecode->atype = RZ_ANALYSIS_OP_TYPE_CMP;
1094  break;
1095  case BYTECODE_95_FCMPL:
1096  strcpy(bytecode->name, "fcmpl");
1097  bytecode->stack_input = 2;
1098  bytecode->stack_output = 1;
1099  bytecode->size = 1;
1100  bytecode->atype = RZ_ANALYSIS_OP_TYPE_CMP;
1101  break;
1102  case BYTECODE_96_FCMPG:
1103  strcpy(bytecode->name, "fcmpg");
1104  bytecode->stack_input = 2;
1105  bytecode->stack_output = 1;
1106  bytecode->size = 1;
1107  bytecode->atype = RZ_ANALYSIS_OP_TYPE_CMP;
1108  break;
1109  case BYTECODE_97_DCMPL:
1110  strcpy(bytecode->name, "dcmpl");
1111  bytecode->stack_input = 2;
1112  bytecode->stack_output = 1;
1113  bytecode->size = 1;
1114  bytecode->atype = RZ_ANALYSIS_OP_TYPE_CMP;
1115  break;
1116  case BYTECODE_98_DCMPG:
1117  strcpy(bytecode->name, "dcmpg");
1118  bytecode->stack_input = 2;
1119  bytecode->stack_output = 1;
1120  bytecode->size = 1;
1121  bytecode->atype = RZ_ANALYSIS_OP_TYPE_CMP;
1122  break;
1123  case BYTECODE_99_IFEQ:
1124  strcpy(bytecode->name, "ifeq");
1125  load_ut16(bytecode, jvm, BYTECODE_TYPE_ADDRESS, st16);
1126  bytecode->stack_input = 1;
1127  bytecode->atype = RZ_ANALYSIS_OP_TYPE_CJMP;
1128  break;
1129  case BYTECODE_9A_IFNE:
1130  strcpy(bytecode->name, "ifne");
1131  load_ut16(bytecode, jvm, BYTECODE_TYPE_ADDRESS, st16);
1132  bytecode->stack_input = 1;
1133  bytecode->atype = RZ_ANALYSIS_OP_TYPE_CJMP;
1134  break;
1135  case BYTECODE_9B_IFLT:
1136  strcpy(bytecode->name, "iflt");
1137  load_ut16(bytecode, jvm, BYTECODE_TYPE_ADDRESS, st16);
1138  bytecode->stack_input = 1;
1139  bytecode->atype = RZ_ANALYSIS_OP_TYPE_CJMP;
1140  break;
1141  case BYTECODE_9C_IFGE:
1142  strcpy(bytecode->name, "ifge");
1143  load_ut16(bytecode, jvm, BYTECODE_TYPE_ADDRESS, st16);
1144  bytecode->stack_input = 1;
1145  bytecode->atype = RZ_ANALYSIS_OP_TYPE_CJMP;
1146  break;
1147  case BYTECODE_9D_IFGT:
1148  strcpy(bytecode->name, "ifgt");
1149  load_ut16(bytecode, jvm, BYTECODE_TYPE_ADDRESS, st16);
1150  bytecode->stack_input = 1;
1151  bytecode->atype = RZ_ANALYSIS_OP_TYPE_CJMP;
1152  break;
1153  case BYTECODE_9E_IFLE:
1154  strcpy(bytecode->name, "ifle");
1155  load_ut16(bytecode, jvm, BYTECODE_TYPE_ADDRESS, st16);
1156  bytecode->stack_input = 1;
1157  bytecode->atype = RZ_ANALYSIS_OP_TYPE_CJMP;
1158  break;
1159  case BYTECODE_9F_IF_ICMPEQ:
1160  strcpy(bytecode->name, "if_icmpeq");
1161  load_ut16(bytecode, jvm, BYTECODE_TYPE_ADDRESS, st16);
1162  bytecode->stack_input = 2;
1163  bytecode->atype = RZ_ANALYSIS_OP_TYPE_CJMP;
1164  break;
1165  case BYTECODE_A0_IF_ICMPNE:
1166  strcpy(bytecode->name, "if_icmpne");
1167  load_ut16(bytecode, jvm, BYTECODE_TYPE_ADDRESS, st16);
1168  bytecode->stack_input = 2;
1169  bytecode->atype = RZ_ANALYSIS_OP_TYPE_CJMP;
1170  break;
1171  case BYTECODE_A1_IF_ICMPLT:
1172  strcpy(bytecode->name, "if_icmplt");
1173  load_ut16(bytecode, jvm, BYTECODE_TYPE_ADDRESS, st16);
1174  bytecode->stack_input = 2;
1175  bytecode->atype = RZ_ANALYSIS_OP_TYPE_CJMP;
1176  break;
1177  case BYTECODE_A2_IF_ICMPGE:
1178  strcpy(bytecode->name, "if_icmpge");
1179  load_ut16(bytecode, jvm, BYTECODE_TYPE_ADDRESS, st16);
1180  bytecode->stack_input = 2;
1181  bytecode->atype = RZ_ANALYSIS_OP_TYPE_CJMP;
1182  break;
1183  case BYTECODE_A3_IF_ICMPGT:
1184  strcpy(bytecode->name, "if_icmpgt");
1185  load_ut16(bytecode, jvm, BYTECODE_TYPE_ADDRESS, st16);
1186  bytecode->stack_input = 2;
1187  bytecode->atype = RZ_ANALYSIS_OP_TYPE_CJMP;
1188  break;
1189  case BYTECODE_A4_IF_ICMPLE:
1190  strcpy(bytecode->name, "if_icmple");
1191  load_ut16(bytecode, jvm, BYTECODE_TYPE_ADDRESS, st16);
1192  bytecode->stack_input = 2;
1193  bytecode->atype = RZ_ANALYSIS_OP_TYPE_CJMP;
1194  break;
1195  case BYTECODE_A5_IF_ACMPEQ:
1196  strcpy(bytecode->name, "if_acmpeq");
1197  load_ut16(bytecode, jvm, BYTECODE_TYPE_ADDRESS, st16);
1198  bytecode->stack_input = 2;
1199  bytecode->atype = RZ_ANALYSIS_OP_TYPE_CJMP;
1200  break;
1201  case BYTECODE_A6_IF_ACMPNE:
1202  strcpy(bytecode->name, "if_acmpne");
1203  load_ut16(bytecode, jvm, BYTECODE_TYPE_ADDRESS, st16);
1204  bytecode->stack_input = 2;
1205  bytecode->atype = RZ_ANALYSIS_OP_TYPE_CJMP;
1206  break;
1207  case BYTECODE_A7_GOTO:
1208  strcpy(bytecode->name, "goto");
1209  load_ut16(bytecode, jvm, BYTECODE_TYPE_ADDRESS, st16);
1210  bytecode->atype = RZ_ANALYSIS_OP_TYPE_JMP;
1211  break;
1212  case BYTECODE_A8_JSR:
1213  strcpy(bytecode->name, "jsr");
1214  load_ut16(bytecode, jvm, BYTECODE_TYPE_ADDRESS, st16);
1215  bytecode->stack_output = 2;
1216  bytecode->atype = RZ_ANALYSIS_OP_TYPE_CALL;
1217  break;
1218  case BYTECODE_A9_RET:
1219  strcpy(bytecode->name, "ret");
1220  load_ut8(bytecode, jvm, BYTECODE_TYPE_NUMBER, ut32);
1221  bytecode->size = 2;
1222  bytecode->atype = RZ_ANALYSIS_OP_TYPE_RET;
1223  break;
1225  strcpy(bytecode->name, "tableswitch");
1226  if (!decode_tableswitch(jvm, bytecode)) {
1228  return false;
1229  }
1230  bytecode->atype = RZ_ANALYSIS_OP_TYPE_CJMP;
1231  bytecode->stack_input = 1;
1232  break;
1234  strcpy(bytecode->name, "lookupswitch");
1235  if (!decode_lookupswitch(jvm, bytecode)) {
1237  return false;
1238  }
1239  bytecode->atype = RZ_ANALYSIS_OP_TYPE_CJMP;
1240  bytecode->stack_input = 1;
1241  break;
1242  case BYTECODE_AC_IRETURN:
1243  strcpy(bytecode->name, "ireturn");
1244  bytecode->stack_input = 1;
1245  bytecode->size = 1;
1246  bytecode->atype = RZ_ANALYSIS_OP_TYPE_RET;
1247  break;
1248  case BYTECODE_AD_LRETURN:
1249  strcpy(bytecode->name, "lreturn");
1250  bytecode->stack_input = 1;
1251  bytecode->size = 1;
1252  bytecode->atype = RZ_ANALYSIS_OP_TYPE_RET;
1253  break;
1254  case BYTECODE_AE_FRETURN:
1255  strcpy(bytecode->name, "freturn");
1256  bytecode->stack_input = 1;
1257  bytecode->size = 1;
1258  bytecode->atype = RZ_ANALYSIS_OP_TYPE_RET;
1259  break;
1260  case BYTECODE_AF_DRETURN:
1261  strcpy(bytecode->name, "dreturn");
1262  bytecode->stack_input = 1;
1263  bytecode->size = 1;
1264  bytecode->atype = RZ_ANALYSIS_OP_TYPE_RET;
1265  break;
1266  case BYTECODE_B0_ARETURN:
1267  strcpy(bytecode->name, "areturn");
1268  bytecode->stack_input = 1;
1269  bytecode->size = 1;
1270  bytecode->atype = RZ_ANALYSIS_OP_TYPE_RET;
1271  break;
1272  case BYTECODE_B1_RETURN:
1273  strcpy(bytecode->name, "return");
1274  bytecode->size = 1;
1275  bytecode->atype = RZ_ANALYSIS_OP_TYPE_RET;
1276  break;
1277  case BYTECODE_B2_GETSTATIC:
1278  strcpy(bytecode->name, "getstatic");
1279  load_ut16(bytecode, jvm, BYTECODE_TYPE_CONST_POOL, ut32);
1280  bytecode->stack_output = 1;
1281  bytecode->atype = RZ_ANALYSIS_OP_TYPE_PUSH;
1282  break;
1283  case BYTECODE_B3_PUTSTATIC:
1284  strcpy(bytecode->name, "putstatic");
1285  load_ut16(bytecode, jvm, BYTECODE_TYPE_CONST_POOL, ut32);
1286  bytecode->stack_input = 1;
1287  bytecode->atype = RZ_ANALYSIS_OP_TYPE_POP;
1288  break;
1289  case BYTECODE_B4_GETFIELD:
1290  strcpy(bytecode->name, "getfield");
1291  load_ut16(bytecode, jvm, BYTECODE_TYPE_CONST_POOL, ut32);
1292  bytecode->stack_input = 1;
1293  bytecode->stack_output = 1;
1294  bytecode->atype = RZ_ANALYSIS_OP_TYPE_PUSH;
1295  break;
1296  case BYTECODE_B5_PUTFIELD:
1297  strcpy(bytecode->name, "putfield");
1298  load_ut16(bytecode, jvm, BYTECODE_TYPE_CONST_POOL, ut32);
1299  bytecode->stack_input = 2;
1300  bytecode->atype = RZ_ANALYSIS_OP_TYPE_POP;
1301  break;
1303  strcpy(bytecode->name, "invokevirtual");
1304  load_ut16(bytecode, jvm, BYTECODE_TYPE_CONST_POOL, ut32);
1305  bytecode->stack_input = 1;
1306  bytecode->atype = RZ_ANALYSIS_OP_TYPE_UCALL;
1307  break;
1309  strcpy(bytecode->name, "invokespecial");
1310  load_ut16(bytecode, jvm, BYTECODE_TYPE_CONST_POOL, ut32);
1311  bytecode->stack_input = 1;
1312  bytecode->atype = RZ_ANALYSIS_OP_TYPE_UCALL;
1313  break;
1315  strcpy(bytecode->name, "invokestatic");
1316  load_ut16(bytecode, jvm, BYTECODE_TYPE_CONST_POOL, ut32);
1317  bytecode->atype = RZ_ANALYSIS_OP_TYPE_UCALL;
1318  break;
1320  strcpy(bytecode->name, "invokeinterface");
1322  bytecode->stack_input = 1;
1323  bytecode->size = 5; // not an error
1324  bytecode->atype = RZ_ANALYSIS_OP_TYPE_UCALL;
1325  break;
1327  strcpy(bytecode->name, "invokedynamic");
1329  bytecode->size = 5; // not an error
1330  bytecode->atype = RZ_ANALYSIS_OP_TYPE_UCALL;
1331  break;
1332  case BYTECODE_BB_NEW:
1333  strcpy(bytecode->name, "new");
1334  load_ut16(bytecode, jvm, BYTECODE_TYPE_CONST_POOL, ut32);
1335  bytecode->stack_output = 1;
1336  bytecode->atype = RZ_ANALYSIS_OP_TYPE_NEW;
1337  break;
1338  case BYTECODE_BC_NEWARRAY:
1339  /* bool 4, char 5, float 6, double 7, byte 8, short 9, int 10, long 11 */
1340  strcpy(bytecode->name, "newarray");
1341  load_ut8(bytecode, jvm, BYTECODE_TYPE_ATYPE, ut32);
1342  bytecode->stack_input = 1;
1343  bytecode->stack_output = 1;
1344  bytecode->atype = RZ_ANALYSIS_OP_TYPE_NEW;
1345  break;
1346  case BYTECODE_BD_ANEWARRAY:
1347  strcpy(bytecode->name, "anewarray");
1348  load_ut16(bytecode, jvm, BYTECODE_TYPE_CONST_POOL, ut32);
1349  bytecode->stack_input = 1;
1350  bytecode->stack_output = 1;
1351  bytecode->atype = RZ_ANALYSIS_OP_TYPE_NEW;
1352  break;
1354  strcpy(bytecode->name, "arraylength");
1355  bytecode->stack_input = 1;
1356  bytecode->stack_output = 1;
1357  bytecode->size = 1;
1358  bytecode->atype = RZ_ANALYSIS_OP_TYPE_LENGTH;
1359  break;
1360  case BYTECODE_BF_ATHROW:
1361  strcpy(bytecode->name, "athrow");
1362  bytecode->stack_input = 1;
1363  bytecode->stack_output = 1;
1364  bytecode->size = 1;
1365  bytecode->atype = RZ_ANALYSIS_OP_TYPE_SWI;
1366  break;
1367  case BYTECODE_C0_CHECKCAST:
1368  strcpy(bytecode->name, "checkcast");
1369  load_ut16(bytecode, jvm, BYTECODE_TYPE_CONST_POOL, ut32);
1370  bytecode->stack_input = 1;
1371  bytecode->stack_output = 1;
1372  bytecode->atype = RZ_ANALYSIS_OP_TYPE_UCJMP;
1373  break;
1375  strcpy(bytecode->name, "instanceof");
1376  load_ut16(bytecode, jvm, BYTECODE_TYPE_CONST_POOL, ut32);
1377  bytecode->stack_input = 1;
1378  bytecode->stack_output = 1;
1379  bytecode->atype = RZ_ANALYSIS_OP_TYPE_CMP;
1380  break;
1382  strcpy(bytecode->name, "monitorenter");
1383  bytecode->stack_input = 1;
1384  bytecode->size = 1;
1385  bytecode->atype = RZ_ANALYSIS_OP_TYPE_SYNC;
1386  break;
1388  strcpy(bytecode->name, "monitorexit");
1389  bytecode->stack_input = 1;
1390  bytecode->size = 1;
1391  bytecode->atype = RZ_ANALYSIS_OP_TYPE_SYNC;
1392  break;
1393  case BYTECODE_C4_WIDE:
1394  strcpy(bytecode->name, "wide");
1395  bytecode->size = 1;
1396  break;
1398  strcpy(bytecode->name, "multianewarray");
1400  bytecode->stack_input = 1;
1401  bytecode->stack_output = 1;
1402  break;
1403  case BYTECODE_C6_IFNULL:
1404  strcpy(bytecode->name, "ifnull");
1405  load_ut16(bytecode, jvm, BYTECODE_TYPE_ADDRESS, st16);
1406  bytecode->atype = RZ_ANALYSIS_OP_TYPE_CJMP;
1407  bytecode->stack_input = 1;
1408  break;
1409  case BYTECODE_C7_IFNONNULL:
1410  strcpy(bytecode->name, "ifnonnull");
1411  load_ut16(bytecode, jvm, BYTECODE_TYPE_ADDRESS, st16);
1412  bytecode->atype = RZ_ANALYSIS_OP_TYPE_CJMP;
1413  bytecode->stack_input = 1;
1414  break;
1415  case BYTECODE_C8_GOTO_W:
1416  strcpy(bytecode->name, "goto_w");
1417  load_ut32(bytecode, jvm, BYTECODE_TYPE_ADDRESS, st32);
1418  bytecode->stack_output = 1;
1419  bytecode->atype = RZ_ANALYSIS_OP_TYPE_JMP;
1420  break;
1421  case BYTECODE_C9_JSR_W:
1422  strcpy(bytecode->name, "jsr_w");
1423  load_ut32(bytecode, jvm, BYTECODE_TYPE_ADDRESS, st32);
1424  bytecode->stack_output = 1;
1425  bytecode->atype = RZ_ANALYSIS_OP_TYPE_CALL;
1426  break;
1428  strcpy(bytecode->name, "breakpoint");
1429  bytecode->size = 1;
1430  bytecode->atype = RZ_ANALYSIS_OP_TYPE_SWI;
1431  break;
1432  case BYTECODE_FE_IMPDEP1:
1433  strcpy(bytecode->name, "impdep1");
1434  bytecode->size = 1;
1435  bytecode->atype = RZ_ANALYSIS_OP_TYPE_SWI;
1436  break;
1437  case BYTECODE_FF_IMPDEP2:
1438  strcpy(bytecode->name, "impdep2");
1439  bytecode->size = 1;
1440  bytecode->atype = RZ_ANALYSIS_OP_TYPE_SWI;
1441  break;
1442  default:
1443  strcpy(bytecode->name, "illegal");
1444  bytecode->size = 1;
1445  bytecode->atype = RZ_ANALYSIS_OP_TYPE_ILL;
1446  jvm->current++;
1447  return true;
1448  }
1449  if (!bytecode->atype) {
1450  bytecode->atype = RZ_ANALYSIS_OP_TYPE_UNK;
1451  }
1452  bytecode->opcode = byte;
1453  bytecode->pc = jvm->pc + jvm->current;
1454  jvm->current += bytecode->size;
1455  return true;
1456 }
#define BYTECODE_C7_IFNONNULL
Definition: bytecode.h:207
#define BYTECODE_9A_IFNE
Definition: bytecode.h:162
#define BYTECODE_C8_GOTO_W
Definition: bytecode.h:208
#define BYTECODE_33_BALOAD
Definition: bytecode.h:59
#define BYTECODE_C3_MONITOREXIT
Definition: bytecode.h:203
#define BYTECODE_35_SALOAD
Definition: bytecode.h:61
#define BYTECODE_36_ISTORE
Definition: bytecode.h:62
#define BYTECODE_69_LMUL
Definition: bytecode.h:113
#define BYTECODE_76_FNEG
Definition: bytecode.h:126
#define BYTECODE_3E_ISTORE_3
Definition: bytecode.h:70
#define BYTECODE_17_FLOAD
Definition: bytecode.h:31
#define BYTECODE_BF_ATHROW
Definition: bytecode.h:199
#define BYTECODE_FE_IMPDEP1
Definition: bytecode.h:211
#define BYTECODE_78_ISHL
Definition: bytecode.h:128
#define BYTECODE_31_DALOAD
Definition: bytecode.h:57
#define BYTECODE_56_SASTORE
Definition: bytecode.h:94
#define BYTECODE_53_AASTORE
Definition: bytecode.h:91
#define BYTECODE_8C_F2L
Definition: bytecode.h:148
#define BYTECODE_09_LCONST_0
Definition: bytecode.h:17
#define BYTECODE_86_I2F
Definition: bytecode.h:142
#define BYTECODE_00_NOP
Definition: bytecode.h:8
#define BYTECODE_1C_ILOAD_2
Definition: bytecode.h:36
#define BYTECODE_90_D2F
Definition: bytecode.h:152
#define BYTECODE_85_I2L
Definition: bytecode.h:141
#define BYTECODE_66_FSUB
Definition: bytecode.h:110
#define BYTECODE_BB_NEW
Definition: bytecode.h:195
#define BYTECODE_73_DREM
Definition: bytecode.h:123
#define BYTECODE_A3_IF_ICMPGT
Definition: bytecode.h:171
#define BYTECODE_98_DCMPG
Definition: bytecode.h:160
#define BYTECODE_C5_MULTIANEWARRAY
Definition: bytecode.h:205
#define BYTECODE_5A_DUP_X1
Definition: bytecode.h:98
#define BYTECODE_A0_IF_ICMPNE
Definition: bytecode.h:168
#define BYTECODE_3B_ISTORE_0
Definition: bytecode.h:67
#define BYTECODE_93_I2S
Definition: bytecode.h:155
#define BYTECODE_6D_LDIV
Definition: bytecode.h:117
#define BYTECODE_06_ICONST_3
Definition: bytecode.h:14
#define BYTECODE_B9_INVOKEINTERFACE
Definition: bytecode.h:193
#define BYTECODE_45_FSTORE_2
Definition: bytecode.h:77
#define BYTECODE_B0_ARETURN
Definition: bytecode.h:184
#define BYTECODE_08_ICONST_5
Definition: bytecode.h:16
#define BYTECODE_70_IREM
Definition: bytecode.h:120
#define BYTECODE_82_IXOR
Definition: bytecode.h:138
#define BYTECODE_68_IMUL
Definition: bytecode.h:112
#define BYTECODE_19_ALOAD
Definition: bytecode.h:33
#define BYTECODE_07_ICONST_4
Definition: bytecode.h:15
#define BYTECODE_40_LSTORE_1
Definition: bytecode.h:72
#define BYTECODE_C6_IFNULL
Definition: bytecode.h:206
#define BYTECODE_3D_ISTORE_2
Definition: bytecode.h:69
#define BYTECODE_51_FASTORE
Definition: bytecode.h:89
#define BYTECODE_38_FSTORE
Definition: bytecode.h:64
#define BYTECODE_10_BIPUSH
Definition: bytecode.h:24
#define BYTECODE_72_FREM
Definition: bytecode.h:122
#define BYTECODE_4A_DSTORE_3
Definition: bytecode.h:82
#define BYTECODE_6C_IDIV
Definition: bytecode.h:116
#define BYTECODE_AE_FRETURN
Definition: bytecode.h:182
#define BYTECODE_25_FLOAD_3
Definition: bytecode.h:45
#define BYTECODE_89_L2F
Definition: bytecode.h:145
#define BYTECODE_50_LASTORE
Definition: bytecode.h:88
#define BYTECODE_8D_F2D
Definition: bytecode.h:149
#define BYTECODE_8A_L2D
Definition: bytecode.h:146
#define BYTECODE_3F_LSTORE_0
Definition: bytecode.h:71
#define BYTECODE_97_DCMPL
Definition: bytecode.h:159
#define BYTECODE_4F_IASTORE
Definition: bytecode.h:87
#define BYTECODE_29_DLOAD_3
Definition: bytecode.h:49
#define BYTECODE_A2_IF_ICMPGE
Definition: bytecode.h:170
#define BYTECODE_5B_DUP_X2
Definition: bytecode.h:99
#define BYTECODE_11_SIPUSH
Definition: bytecode.h:25
#define BYTECODE_B2_GETSTATIC
Definition: bytecode.h:186
#define BYTECODE_7D_LUSHR
Definition: bytecode.h:133
#define BYTECODE_26_DLOAD_0
Definition: bytecode.h:46
#define BYTECODE_59_DUP
Definition: bytecode.h:97
#define BYTECODE_94_LCMP
Definition: bytecode.h:156
#define BYTECODE_28_DLOAD_2
Definition: bytecode.h:48
#define BYTECODE_7E_IAND
Definition: bytecode.h:134
#define BYTECODE_B8_INVOKESTATIC
Definition: bytecode.h:192
#define BYTECODE_CA_BREAKPOINT
Definition: bytecode.h:210
#define BYTECODE_02_ICONST_M1
Definition: bytecode.h:10
#define BYTECODE_4B_ASTORE_0
Definition: bytecode.h:83
#define BYTECODE_42_LSTORE_3
Definition: bytecode.h:74
#define BYTECODE_44_FSTORE_1
Definition: bytecode.h:76
#define BYTECODE_BE_ARRAYLENGTH
Definition: bytecode.h:198
#define BYTECODE_4C_ASTORE_1
Definition: bytecode.h:84
#define BYTECODE_AC_IRETURN
Definition: bytecode.h:180
#define BYTECODE_92_I2C
Definition: bytecode.h:154
#define BYTECODE_0A_LCONST_1
Definition: bytecode.h:18
#define BYTECODE_83_LXOR
Definition: bytecode.h:139
#define BYTECODE_B4_GETFIELD
Definition: bytecode.h:188
#define BYTECODE_AF_DRETURN
Definition: bytecode.h:183
#define BYTECODE_BC_NEWARRAY
Definition: bytecode.h:196
#define BYTECODE_AD_LRETURN
Definition: bytecode.h:181
#define BYTECODE_24_FLOAD_2
Definition: bytecode.h:44
#define BYTECODE_46_FSTORE_3
Definition: bytecode.h:78
#define BYTECODE_12_LDC
Definition: bytecode.h:26
#define BYTECODE_8E_D2I
Definition: bytecode.h:150
#define BYTECODE_1D_ILOAD_3
Definition: bytecode.h:37
#define BYTECODE_52_DASTORE
Definition: bytecode.h:90
#define BYTECODE_04_ICONST_1
Definition: bytecode.h:12
#define BYTECODE_61_LADD
Definition: bytecode.h:105
#define BYTECODE_96_FCMPG
Definition: bytecode.h:158
#define BYTECODE_80_IOR
Definition: bytecode.h:136
#define BYTECODE_74_INEG
Definition: bytecode.h:124
#define BYTECODE_C1_INSTANCEOF
Definition: bytecode.h:201
#define BYTECODE_6F_DDIV
Definition: bytecode.h:119
#define BYTECODE_63_DADD
Definition: bytecode.h:107
#define BYTECODE_0B_FCONST_0
Definition: bytecode.h:19
#define BYTECODE_87_I2D
Definition: bytecode.h:143
#define BYTECODE_6B_DMUL
Definition: bytecode.h:115
#define BYTECODE_0E_DCONST_0
Definition: bytecode.h:22
#define BYTECODE_A7_GOTO
Definition: bytecode.h:175
#define BYTECODE_03_ICONST_0
Definition: bytecode.h:11
#define BYTECODE_2A_ALOAD_0
Definition: bytecode.h:50
#define BYTECODE_43_FSTORE_0
Definition: bytecode.h:75
#define BYTECODE_13_LDC_W
Definition: bytecode.h:27
#define BYTECODE_7A_ISHR
Definition: bytecode.h:130
#define BYTECODE_71_LREM
Definition: bytecode.h:121
#define BYTECODE_9E_IFLE
Definition: bytecode.h:166
#define BYTECODE_99_IFEQ
Definition: bytecode.h:161
#define BYTECODE_C4_WIDE
Definition: bytecode.h:204
#define BYTECODE_6E_FDIV
Definition: bytecode.h:118
#define BYTECODE_B7_INVOKESPECIAL
Definition: bytecode.h:191
#define BYTECODE_C9_JSR_W
Definition: bytecode.h:209
#define BYTECODE_30_FALOAD
Definition: bytecode.h:56
#define BYTECODE_1A_ILOAD_0
Definition: bytecode.h:34
#define BYTECODE_27_DLOAD_1
Definition: bytecode.h:47
#define BYTECODE_5C_DUP2
Definition: bytecode.h:100
#define BYTECODE_4D_ASTORE_2
Definition: bytecode.h:85
#define BYTECODE_79_LSHL
Definition: bytecode.h:129
#define BYTECODE_22_FLOAD_0
Definition: bytecode.h:42
#define BYTECODE_32_AALOAD
Definition: bytecode.h:58
#define BYTECODE_84_IINC
Definition: bytecode.h:140
#define BYTECODE_8F_D2L
Definition: bytecode.h:151
#define BYTECODE_A6_IF_ACMPNE
Definition: bytecode.h:174
#define BYTECODE_9B_IFLT
Definition: bytecode.h:163
#define BYTECODE_9D_IFGT
Definition: bytecode.h:165
#define BYTECODE_FF_IMPDEP2
Definition: bytecode.h:212
#define BYTECODE_5E_DUP2_X2
Definition: bytecode.h:102
#define BYTECODE_2F_LALOAD
Definition: bytecode.h:55
#define BYTECODE_49_DSTORE_2
Definition: bytecode.h:81
#define BYTECODE_58_POP2
Definition: bytecode.h:96
#define BYTECODE_81_LOR
Definition: bytecode.h:137
#define BYTECODE_0F_DCONST_1
Definition: bytecode.h:23
#define BYTECODE_21_LLOAD_3
Definition: bytecode.h:41
#define BYTECODE_77_DNEG
Definition: bytecode.h:127
#define BYTECODE_62_FADD
Definition: bytecode.h:106
#define BYTECODE_9F_IF_ICMPEQ
Definition: bytecode.h:167
#define BYTECODE_54_BASTORE
Definition: bytecode.h:92
#define BYTECODE_1E_LLOAD_0
Definition: bytecode.h:38
#define BYTECODE_6A_FMUL
Definition: bytecode.h:114
#define BYTECODE_88_L2I
Definition: bytecode.h:144
#define BYTECODE_05_ICONST_2
Definition: bytecode.h:13
#define BYTECODE_2C_ALOAD_2
Definition: bytecode.h:52
#define BYTECODE_15_ILOAD
Definition: bytecode.h:29
#define BYTECODE_BA_INVOKEDYNAMIC
Definition: bytecode.h:194
#define BYTECODE_47_DSTORE_0
Definition: bytecode.h:79
#define BYTECODE_7C_IUSHR
Definition: bytecode.h:132
#define BYTECODE_39_DSTORE
Definition: bytecode.h:65
#define BYTECODE_01_ACONST_NULL
Definition: bytecode.h:9
#define BYTECODE_B3_PUTSTATIC
Definition: bytecode.h:187
#define BYTECODE_A4_IF_ICMPLE
Definition: bytecode.h:172
#define BYTECODE_1B_ILOAD_1
Definition: bytecode.h:35
#define BYTECODE_B5_PUTFIELD
Definition: bytecode.h:189
#define BYTECODE_A1_IF_ICMPLT
Definition: bytecode.h:169
#define BYTECODE_0C_FCONST_1
Definition: bytecode.h:20
#define BYTECODE_4E_ASTORE_3
Definition: bytecode.h:86
#define BYTECODE_57_POP
Definition: bytecode.h:95
#define BYTECODE_20_LLOAD_2
Definition: bytecode.h:40
#define BYTECODE_A8_JSR
Definition: bytecode.h:176
#define BYTECODE_7F_LAND
Definition: bytecode.h:135
#define BYTECODE_1F_LLOAD_1
Definition: bytecode.h:39
#define BYTECODE_48_DSTORE_1
Definition: bytecode.h:80
#define BYTECODE_23_FLOAD_1
Definition: bytecode.h:43
#define BYTECODE_0D_FCONST_2
Definition: bytecode.h:21
#define BYTECODE_5D_DUP2_X1
Definition: bytecode.h:101
#define BYTECODE_3A_ASTORE
Definition: bytecode.h:66
#define BYTECODE_C0_CHECKCAST
Definition: bytecode.h:200
#define BYTECODE_41_LSTORE_2
Definition: bytecode.h:73
#define BYTECODE_95_FCMPL
Definition: bytecode.h:157
#define BYTECODE_B1_RETURN
Definition: bytecode.h:185
#define BYTECODE_18_DLOAD
Definition: bytecode.h:32
#define BYTECODE_3C_ISTORE_1
Definition: bytecode.h:68
#define BYTECODE_7B_LSHR
Definition: bytecode.h:131
#define BYTECODE_A9_RET
Definition: bytecode.h:177
#define BYTECODE_2D_ALOAD_3
Definition: bytecode.h:53
#define BYTECODE_8B_F2I
Definition: bytecode.h:147
#define BYTECODE_60_IADD
Definition: bytecode.h:104
#define BYTECODE_BD_ANEWARRAY
Definition: bytecode.h:197
#define BYTECODE_14_LDC2_W
Definition: bytecode.h:28
#define BYTECODE_67_DSUB
Definition: bytecode.h:111
#define BYTECODE_91_I2B
Definition: bytecode.h:153
#define BYTECODE_5F_SWAP
Definition: bytecode.h:103
#define BYTECODE_34_CALOAD
Definition: bytecode.h:60
#define BYTECODE_2B_ALOAD_1
Definition: bytecode.h:51
#define BYTECODE_75_LNEG
Definition: bytecode.h:125
#define BYTECODE_9C_IFGE
Definition: bytecode.h:164
#define BYTECODE_37_LSTORE
Definition: bytecode.h:63
#define BYTECODE_A5_IF_ACMPEQ
Definition: bytecode.h:173
#define BYTECODE_16_LLOAD
Definition: bytecode.h:30
#define BYTECODE_55_CASTORE
Definition: bytecode.h:93
#define BYTECODE_C2_MONITORENTER
Definition: bytecode.h:202
#define BYTECODE_64_ISUB
Definition: bytecode.h:108
#define BYTECODE_65_LSUB
Definition: bytecode.h:109
#define BYTECODE_B6_INVOKEVIRTUAL
Definition: bytecode.h:190
#define BYTECODE_2E_IALOAD
Definition: bytecode.h:54
uint32_t ut32
#define load_ut16(bytecode, jvm, t, c)
Definition: jvm.c:27
static bool decode_tableswitch(JavaVM *jvm, Bytecode *bytecode)
Definition: jvm.c:88
#define load_ut16_ut8(bytecode, jvm, t0, t1, c0, c1)
Definition: jvm.c:37
#define load_ut8x2(bytecode, jvm, t0, t1, c0, c1)
Definition: jvm.c:20
#define load_ut8(bytecode, jvm, t, c)
Definition: jvm.c:15
#define load_ut32(bytecode, jvm, t, c)
Definition: jvm.c:32
static bool decode_lookupswitch(JavaVM *jvm, Bytecode *bytecode)
Definition: jvm.c:60
uint8_t ut8
Definition: lh5801.h:11
return memset(p, 0, total)
@ RZ_ANALYSIS_OP_TYPE_CMP
Definition: rz_analysis.h:399
@ RZ_ANALYSIS_OP_TYPE_SUB
Definition: rz_analysis.h:402
@ RZ_ANALYSIS_OP_TYPE_LOAD
Definition: rz_analysis.h:416
@ RZ_ANALYSIS_OP_TYPE_UNK
Definition: rz_analysis.h:388
@ RZ_ANALYSIS_OP_TYPE_MUL
Definition: rz_analysis.h:404
@ RZ_ANALYSIS_OP_TYPE_JMP
Definition: rz_analysis.h:368
@ RZ_ANALYSIS_OP_TYPE_AND
Definition: rz_analysis.h:411
@ RZ_ANALYSIS_OP_TYPE_SYNC
Definition: rz_analysis.h:431
@ RZ_ANALYSIS_OP_TYPE_MOD
Definition: rz_analysis.h:422
@ RZ_ANALYSIS_OP_TYPE_SWI
Definition: rz_analysis.h:393
@ RZ_ANALYSIS_OP_TYPE_CALL
Definition: rz_analysis.h:378
@ RZ_ANALYSIS_OP_TYPE_ADD
Definition: rz_analysis.h:401
@ RZ_ANALYSIS_OP_TYPE_OR
Definition: rz_analysis.h:410
@ RZ_ANALYSIS_OP_TYPE_STORE
Definition: rz_analysis.h:415
@ RZ_ANALYSIS_OP_TYPE_PUSH
Definition: rz_analysis.h:397
@ RZ_ANALYSIS_OP_TYPE_SHR
Definition: rz_analysis.h:406
@ RZ_ANALYSIS_OP_TYPE_POP
Definition: rz_analysis.h:398
@ RZ_ANALYSIS_OP_TYPE_CJMP
Definition: rz_analysis.h:373
@ RZ_ANALYSIS_OP_TYPE_DIV
Definition: rz_analysis.h:405
@ RZ_ANALYSIS_OP_TYPE_CAST
Definition: rz_analysis.h:426
@ RZ_ANALYSIS_OP_TYPE_UCJMP
Definition: rz_analysis.h:377
@ RZ_ANALYSIS_OP_TYPE_MOV
Definition: rz_analysis.h:390
@ RZ_ANALYSIS_OP_TYPE_SHL
Definition: rz_analysis.h:407
@ RZ_ANALYSIS_OP_TYPE_ILL
Definition: rz_analysis.h:387
@ RZ_ANALYSIS_OP_TYPE_UCALL
Definition: rz_analysis.h:379
@ RZ_ANALYSIS_OP_TYPE_RET
Definition: rz_analysis.h:385
@ RZ_ANALYSIS_OP_TYPE_NOP
Definition: rz_analysis.h:389
@ RZ_ANALYSIS_OP_TYPE_XOR
Definition: rz_analysis.h:412
@ RZ_ANALYSIS_OP_TYPE_NEW
Definition: rz_analysis.h:427
@ RZ_ANALYSIS_OP_TYPE_LENGTH
Definition: rz_analysis.h:425
#define rz_return_val_if_fail(expr, val)
Definition: rz_assert.h:108
#define st16
Definition: rz_types_base.h:14
#define st32
Definition: rz_types_base.h:12
Definition: buffer.h:15
ut64 atype
Definition: bytecode.h:236
st32 stack_output
Definition: bytecode.h:243
ut16 size
Definition: bytecode.h:238
st32 stack_input
Definition: bytecode.h:242
const ut8 * buffer
Definition: jvm.h:11
ut32 size
Definition: jvm.h:12

References bytecode_t::atype, jvm_t::buffer, BYTECODE_00_NOP, BYTECODE_01_ACONST_NULL, BYTECODE_02_ICONST_M1, BYTECODE_03_ICONST_0, BYTECODE_04_ICONST_1, BYTECODE_05_ICONST_2, BYTECODE_06_ICONST_3, BYTECODE_07_ICONST_4, BYTECODE_08_ICONST_5, BYTECODE_09_LCONST_0, BYTECODE_0A_LCONST_1, BYTECODE_0B_FCONST_0, BYTECODE_0C_FCONST_1, BYTECODE_0D_FCONST_2, BYTECODE_0E_DCONST_0, BYTECODE_0F_DCONST_1, BYTECODE_10_BIPUSH, BYTECODE_11_SIPUSH, BYTECODE_12_LDC, BYTECODE_13_LDC_W, BYTECODE_14_LDC2_W, BYTECODE_15_ILOAD, BYTECODE_16_LLOAD, BYTECODE_17_FLOAD, BYTECODE_18_DLOAD, BYTECODE_19_ALOAD, BYTECODE_1A_ILOAD_0, BYTECODE_1B_ILOAD_1, BYTECODE_1C_ILOAD_2, BYTECODE_1D_ILOAD_3, BYTECODE_1E_LLOAD_0, BYTECODE_1F_LLOAD_1, BYTECODE_20_LLOAD_2, BYTECODE_21_LLOAD_3, BYTECODE_22_FLOAD_0, BYTECODE_23_FLOAD_1, BYTECODE_24_FLOAD_2, BYTECODE_25_FLOAD_3, BYTECODE_26_DLOAD_0, BYTECODE_27_DLOAD_1, BYTECODE_28_DLOAD_2, BYTECODE_29_DLOAD_3, BYTECODE_2A_ALOAD_0, BYTECODE_2B_ALOAD_1, BYTECODE_2C_ALOAD_2, BYTECODE_2D_ALOAD_3, BYTECODE_2E_IALOAD, BYTECODE_2F_LALOAD, BYTECODE_30_FALOAD, BYTECODE_31_DALOAD, BYTECODE_32_AALOAD, BYTECODE_33_BALOAD, BYTECODE_34_CALOAD, BYTECODE_35_SALOAD, BYTECODE_36_ISTORE, BYTECODE_37_LSTORE, BYTECODE_38_FSTORE, BYTECODE_39_DSTORE, BYTECODE_3A_ASTORE, BYTECODE_3B_ISTORE_0, BYTECODE_3C_ISTORE_1, BYTECODE_3D_ISTORE_2, BYTECODE_3E_ISTORE_3, BYTECODE_3F_LSTORE_0, BYTECODE_40_LSTORE_1, BYTECODE_41_LSTORE_2, BYTECODE_42_LSTORE_3, BYTECODE_43_FSTORE_0, BYTECODE_44_FSTORE_1, BYTECODE_45_FSTORE_2, BYTECODE_46_FSTORE_3, BYTECODE_47_DSTORE_0, BYTECODE_48_DSTORE_1, BYTECODE_49_DSTORE_2, BYTECODE_4A_DSTORE_3, BYTECODE_4B_ASTORE_0, BYTECODE_4C_ASTORE_1, BYTECODE_4D_ASTORE_2, BYTECODE_4E_ASTORE_3, BYTECODE_4F_IASTORE, BYTECODE_50_LASTORE, BYTECODE_51_FASTORE, BYTECODE_52_DASTORE, BYTECODE_53_AASTORE, BYTECODE_54_BASTORE, BYTECODE_55_CASTORE, BYTECODE_56_SASTORE, BYTECODE_57_POP, BYTECODE_58_POP2, BYTECODE_59_DUP, BYTECODE_5A_DUP_X1, BYTECODE_5B_DUP_X2, BYTECODE_5C_DUP2, BYTECODE_5D_DUP2_X1, BYTECODE_5E_DUP2_X2, BYTECODE_5F_SWAP, BYTECODE_60_IADD, BYTECODE_61_LADD, BYTECODE_62_FADD, BYTECODE_63_DADD, BYTECODE_64_ISUB, BYTECODE_65_LSUB, BYTECODE_66_FSUB, BYTECODE_67_DSUB, BYTECODE_68_IMUL, BYTECODE_69_LMUL, BYTECODE_6A_FMUL, BYTECODE_6B_DMUL, BYTECODE_6C_IDIV, BYTECODE_6D_LDIV, BYTECODE_6E_FDIV, BYTECODE_6F_DDIV, BYTECODE_70_IREM, BYTECODE_71_LREM, BYTECODE_72_FREM, BYTECODE_73_DREM, BYTECODE_74_INEG, BYTECODE_75_LNEG, BYTECODE_76_FNEG, BYTECODE_77_DNEG, BYTECODE_78_ISHL, BYTECODE_79_LSHL, BYTECODE_7A_ISHR, BYTECODE_7B_LSHR, BYTECODE_7C_IUSHR, BYTECODE_7D_LUSHR, BYTECODE_7E_IAND, BYTECODE_7F_LAND, BYTECODE_80_IOR, BYTECODE_81_LOR, BYTECODE_82_IXOR, BYTECODE_83_LXOR, BYTECODE_84_IINC, BYTECODE_85_I2L, BYTECODE_86_I2F, BYTECODE_87_I2D, BYTECODE_88_L2I, BYTECODE_89_L2F, BYTECODE_8A_L2D, BYTECODE_8B_F2I, BYTECODE_8C_F2L, BYTECODE_8D_F2D, BYTECODE_8E_D2I, BYTECODE_8F_D2L, BYTECODE_90_D2F, BYTECODE_91_I2B, BYTECODE_92_I2C, BYTECODE_93_I2S, BYTECODE_94_LCMP, BYTECODE_95_FCMPL, BYTECODE_96_FCMPG, BYTECODE_97_DCMPL, BYTECODE_98_DCMPG, BYTECODE_99_IFEQ, BYTECODE_9A_IFNE, BYTECODE_9B_IFLT, BYTECODE_9C_IFGE, BYTECODE_9D_IFGT, BYTECODE_9E_IFLE, BYTECODE_9F_IF_ICMPEQ, BYTECODE_A0_IF_ICMPNE, BYTECODE_A1_IF_ICMPLT, BYTECODE_A2_IF_ICMPGE, BYTECODE_A3_IF_ICMPGT, BYTECODE_A4_IF_ICMPLE, BYTECODE_A5_IF_ACMPEQ, BYTECODE_A6_IF_ACMPNE, BYTECODE_A7_GOTO, BYTECODE_A8_JSR, BYTECODE_A9_RET, BYTECODE_AA_TABLESWITCH, BYTECODE_AB_LOOKUPSWITCH, BYTECODE_AC_IRETURN, BYTECODE_AD_LRETURN, BYTECODE_AE_FRETURN, BYTECODE_AF_DRETURN, BYTECODE_B0_ARETURN, BYTECODE_B1_RETURN, BYTECODE_B2_GETSTATIC, BYTECODE_B3_PUTSTATIC, BYTECODE_B4_GETFIELD, BYTECODE_B5_PUTFIELD, BYTECODE_B6_INVOKEVIRTUAL, BYTECODE_B7_INVOKESPECIAL, BYTECODE_B8_INVOKESTATIC, BYTECODE_B9_INVOKEINTERFACE, BYTECODE_BA_INVOKEDYNAMIC, BYTECODE_BB_NEW, BYTECODE_BC_NEWARRAY, BYTECODE_BD_ANEWARRAY, BYTECODE_BE_ARRAYLENGTH, BYTECODE_BF_ATHROW, BYTECODE_C0_CHECKCAST, BYTECODE_C1_INSTANCEOF, BYTECODE_C2_MONITORENTER, BYTECODE_C3_MONITOREXIT, BYTECODE_C4_WIDE, BYTECODE_C5_MULTIANEWARRAY, BYTECODE_C6_IFNULL, BYTECODE_C7_IFNONNULL, BYTECODE_C8_GOTO_W, BYTECODE_C9_JSR_W, BYTECODE_CA_BREAKPOINT, BYTECODE_FE_IMPDEP1, BYTECODE_FF_IMPDEP2, BYTECODE_TYPE_ADDRESS, BYTECODE_TYPE_ATYPE, BYTECODE_TYPE_CONST_POOL, BYTECODE_TYPE_NUMBER, jvm_t::current, decode_lookupswitch(), decode_tableswitch(), load_ut16, load_ut16_ut8, load_ut32, load_ut8, load_ut8x2, memset(), bytecode_t::name, bytecode_t::opcode, bytecode_t::pc, jvm_t::pc, RZ_ANALYSIS_OP_TYPE_ADD, RZ_ANALYSIS_OP_TYPE_AND, RZ_ANALYSIS_OP_TYPE_CALL, RZ_ANALYSIS_OP_TYPE_CAST, RZ_ANALYSIS_OP_TYPE_CJMP, RZ_ANALYSIS_OP_TYPE_CMP, RZ_ANALYSIS_OP_TYPE_DIV, RZ_ANALYSIS_OP_TYPE_ILL, RZ_ANALYSIS_OP_TYPE_JMP, RZ_ANALYSIS_OP_TYPE_LENGTH, RZ_ANALYSIS_OP_TYPE_LOAD, RZ_ANALYSIS_OP_TYPE_MOD, RZ_ANALYSIS_OP_TYPE_MOV, RZ_ANALYSIS_OP_TYPE_MUL, RZ_ANALYSIS_OP_TYPE_NEW, RZ_ANALYSIS_OP_TYPE_NOP, RZ_ANALYSIS_OP_TYPE_OR, RZ_ANALYSIS_OP_TYPE_POP, RZ_ANALYSIS_OP_TYPE_PUSH, RZ_ANALYSIS_OP_TYPE_RET, RZ_ANALYSIS_OP_TYPE_SHL, RZ_ANALYSIS_OP_TYPE_SHR, RZ_ANALYSIS_OP_TYPE_STORE, RZ_ANALYSIS_OP_TYPE_SUB, RZ_ANALYSIS_OP_TYPE_SWI, RZ_ANALYSIS_OP_TYPE_SYNC, RZ_ANALYSIS_OP_TYPE_UCALL, RZ_ANALYSIS_OP_TYPE_UCJMP, RZ_ANALYSIS_OP_TYPE_UNK, RZ_ANALYSIS_OP_TYPE_XOR, rz_return_val_if_fail, rz_warn_if_reached, bytecode_t::size, jvm_t::size, st16, st32, bytecode_t::stack_input, and bytecode_t::stack_output.

Referenced by jvm_fetch().

◆ decode_lookupswitch()

static bool decode_lookupswitch ( JavaVM jvm,
Bytecode bytecode 
)
static

Definition at line 60 of file jvm.c.

60  {
61  ut32 offset = jvm->current + align_upper(jvm);
62 
63  if ((jvm->size - offset) < 8) {
64  return false;
65  }
66  ut32 pc_default = rz_read_at_be32(jvm->buffer, offset);
67  offset += sizeof(ut32);
68 
69  ut32 npairs = rz_read_at_be32(jvm->buffer, offset);
70  offset += sizeof(ut32);
71 
73  if (!ls) {
75  return false;
76  }
77 
78  ls->pc_default = pc_default;
79  ls->npairs = npairs;
80 
81  bytecode->args[0] = pc_default;
82  bytecode->type[0] = BYTECODE_TYPE_ADDRESS;
83  bytecode->extra = ls;
84  bytecode->size = offset - jvm->current;
85  return true;
86 }
voidpf uLong offset
Definition: ioapi.h:144
static ut32 align_upper(JavaVM *jvm)
Definition: jvm.c:51
#define RZ_NEW(x)
Definition: rz_types.h:285

References align_upper(), bytecode_t::args, jvm_t::buffer, BYTECODE_TYPE_ADDRESS, jvm_t::current, bytecode_t::extra, lookupswitch_t::npairs, lookupswitch_t::pc_default, RZ_NEW, rz_read_at_be32(), rz_warn_if_reached, bytecode_t::size, jvm_t::size, and bytecode_t::type.

Referenced by decode_instruction().

◆ decode_tableswitch()

static bool decode_tableswitch ( JavaVM jvm,
Bytecode bytecode 
)
static

Definition at line 88 of file jvm.c.

88  {
89  ut32 offset = jvm->current + align_upper(jvm) + 1;
90 
91  if ((jvm->size - offset) < 12) {
93  return false;
94  }
95 
96  ut32 pc_default = rz_read_at_be32(jvm->buffer, offset);
97  offset += sizeof(ut32);
98 
99  ut32 low = rz_read_at_be32(jvm->buffer, offset);
100  offset += sizeof(ut32);
101 
102  ut32 high = rz_read_at_be32(jvm->buffer, offset);
103  offset += sizeof(ut32);
104 
105  ut32 length = high - low;
106 
108  if (!ts) {
110  return false;
111  }
112 
113  ts->pc_default = pc_default;
114  ts->low = low;
115  ts->high = high;
116  ts->length = length;
117 
118  bytecode->args[0] = pc_default;
119  bytecode->type[0] = BYTECODE_TYPE_ADDRESS;
120  bytecode->extra = ts;
121  bytecode->size = offset - jvm->current;
122  return true;
123 }
static static sync static getppid static getegid const char static filename char static len const char char static bufsiz static mask static vfork const void static prot static getpgrp const char static swapflags static arg static fd static protocol static who struct sockaddr static addrlen static backlog struct timeval struct timezone static tz const struct iovec static count static mode const void const struct sockaddr static tolen const char static pathname void static offset struct stat static buf void long static basep static whence static length const void static len static semflg const void static shmflg const struct timespec struct timespec static rem const char static group const void length
Definition: sflib.h:133

References align_upper(), bytecode_t::args, jvm_t::buffer, BYTECODE_TYPE_ADDRESS, jvm_t::current, bytecode_t::extra, tableswitch_t::high, tableswitch_t::length, length, tableswitch_t::low, tableswitch_t::pc_default, RZ_NEW, rz_read_at_be32(), rz_warn_if_reached, bytecode_t::size, jvm_t::size, and bytecode_t::type.

Referenced by decode_instruction().

◆ jvm_fetch()

bool jvm_fetch ( JavaVM jvm,
Bytecode bytecode 
)

Definition at line 1553 of file jvm.c.

1553  {
1554  rz_return_val_if_fail(jvm && bytecode, false);
1555 
1556  return decode_instruction(jvm, bytecode);
1557 }
static bool decode_instruction(JavaVM *jvm, Bytecode *bytecode)
Definition: jvm.c:125

References decode_instruction(), and rz_return_val_if_fail.

Referenced by java_analysis(), and java_disassemble().

◆ jvm_init()

bool jvm_init ( JavaVM jvm,
const ut8 buffer,
const ut32  size,
ut64  pc,
ut64  section 
)

Definition at line 1541 of file jvm.c.

1541  {
1542  rz_return_val_if_fail(jvm && buffer && size > 0, false);
1543 
1544  jvm->buffer = buffer;
1545  jvm->size = size;
1546  jvm->current = 0;
1547  jvm->pc = pc;
1548  jvm->section = section;
1549 
1550  return true;
1551 }
struct buffer buffer
voidpf void uLong size
Definition: ioapi.h:138

References jvm_t::buffer, jvm_t::current, jvm_t::pc, pc, rz_return_val_if_fail, jvm_t::section, and jvm_t::size.

Referenced by java_analysis(), and java_disassemble().