7 #define return_error_if_size_lt(a, b) \
10 RZ_LOG_ERROR("[!] java_assembler: no enough output buffer (requires %d bytes).\n", b); \
15 #define return_error_if_empty_input(a, b) \
17 if (RZ_STR_ISEMPTY(a) || b < 1) { \
18 RZ_LOG_ERROR("[!] java_assembler: the input is empty.\n"); \
180 const char *next =
NULL;
209 const char *next =
NULL;
235 if (!strncmp(
input,
"bool", strlen(
"bool"))) {
237 }
else if (!strncmp(
input,
"char", strlen(
"char"))) {
239 }
else if (!strncmp(
input,
"float", strlen(
"float"))) {
241 }
else if (!strncmp(
input,
"double", strlen(
"double"))) {
243 }
else if (!strncmp(
input,
"byte", strlen(
"byte"))) {
245 }
else if (!strncmp(
input,
"short", strlen(
"short"))) {
247 }
else if (!strncmp(
input,
"int", strlen(
"int"))) {
249 }
else if (!strncmp(
input,
"long", strlen(
"long"))) {
252 RZ_LOG_ERROR(
"[!] java_assembler: '%s' is not a valid native type (accepted: bool, char, float, double, byte, short, int, long).\n",
input);
262 #define NS(x) x, (sizeof(x) - 1)
486 RZ_LOG_ERROR(
"[!] java_assembler: invalid assembly.\n");
#define BYTECODE_C7_IFNONNULL
#define BYTECODE_C8_GOTO_W
#define BYTECODE_33_BALOAD
#define BYTECODE_C3_MONITOREXIT
#define BYTECODE_35_SALOAD
#define BYTECODE_36_ISTORE
#define BYTECODE_3E_ISTORE_3
#define BYTECODE_17_FLOAD
#define BYTECODE_BF_ATHROW
#define BYTECODE_FE_IMPDEP1
#define BYTECODE_31_DALOAD
#define BYTECODE_56_SASTORE
#define BYTECODE_53_AASTORE
#define BYTECODE_09_LCONST_0
#define BYTECODE_1C_ILOAD_2
#define BYTECODE_A3_IF_ICMPGT
#define BYTECODE_98_DCMPG
#define BYTECODE_C5_MULTIANEWARRAY
#define BYTECODE_5A_DUP_X1
#define BYTECODE_A0_IF_ICMPNE
#define BYTECODE_3B_ISTORE_0
#define BYTECODE_06_ICONST_3
#define BYTECODE_B9_INVOKEINTERFACE
#define BYTECODE_45_FSTORE_2
#define BYTECODE_B0_ARETURN
#define BYTECODE_08_ICONST_5
#define BYTECODE_19_ALOAD
#define BYTECODE_07_ICONST_4
#define BYTECODE_40_LSTORE_1
#define BYTECODE_C6_IFNULL
#define BYTECODE_3D_ISTORE_2
#define BYTECODE_51_FASTORE
#define BYTECODE_38_FSTORE
#define BYTECODE_10_BIPUSH
#define BYTECODE_4A_DSTORE_3
#define BYTECODE_AE_FRETURN
#define BYTECODE_25_FLOAD_3
#define BYTECODE_50_LASTORE
#define BYTECODE_3F_LSTORE_0
#define BYTECODE_97_DCMPL
#define BYTECODE_4F_IASTORE
#define BYTECODE_29_DLOAD_3
#define BYTECODE_A2_IF_ICMPGE
#define BYTECODE_5B_DUP_X2
#define BYTECODE_11_SIPUSH
#define BYTECODE_B2_GETSTATIC
#define BYTECODE_7D_LUSHR
#define BYTECODE_26_DLOAD_0
#define BYTECODE_28_DLOAD_2
#define BYTECODE_B8_INVOKESTATIC
#define BYTECODE_CA_BREAKPOINT
#define BYTECODE_02_ICONST_M1
#define BYTECODE_4B_ASTORE_0
#define BYTECODE_42_LSTORE_3
#define BYTECODE_44_FSTORE_1
#define BYTECODE_BE_ARRAYLENGTH
#define BYTECODE_4C_ASTORE_1
#define BYTECODE_AC_IRETURN
#define BYTECODE_0A_LCONST_1
#define BYTECODE_B4_GETFIELD
#define BYTECODE_AF_DRETURN
#define BYTECODE_AA_TABLESWITCH
#define BYTECODE_BC_NEWARRAY
#define BYTECODE_AD_LRETURN
#define BYTECODE_24_FLOAD_2
#define BYTECODE_46_FSTORE_3
#define BYTECODE_1D_ILOAD_3
#define BYTECODE_52_DASTORE
#define BYTECODE_04_ICONST_1
#define BYTECODE_96_FCMPG
#define BYTECODE_C1_INSTANCEOF
#define BYTECODE_0B_FCONST_0
#define BYTECODE_0E_DCONST_0
#define BYTECODE_03_ICONST_0
#define BYTECODE_2A_ALOAD_0
#define BYTECODE_43_FSTORE_0
#define BYTECODE_13_LDC_W
#define BYTECODE_B7_INVOKESPECIAL
#define BYTECODE_C9_JSR_W
#define BYTECODE_30_FALOAD
#define BYTECODE_1A_ILOAD_0
#define BYTECODE_27_DLOAD_1
#define BYTECODE_4D_ASTORE_2
#define BYTECODE_22_FLOAD_0
#define BYTECODE_32_AALOAD
#define BYTECODE_A6_IF_ACMPNE
#define BYTECODE_FF_IMPDEP2
#define BYTECODE_5E_DUP2_X2
#define BYTECODE_2F_LALOAD
#define BYTECODE_49_DSTORE_2
#define BYTECODE_0F_DCONST_1
#define BYTECODE_21_LLOAD_3
#define BYTECODE_9F_IF_ICMPEQ
#define BYTECODE_54_BASTORE
#define BYTECODE_AB_LOOKUPSWITCH
#define BYTECODE_1E_LLOAD_0
#define BYTECODE_05_ICONST_2
#define BYTECODE_2C_ALOAD_2
#define BYTECODE_15_ILOAD
#define BYTECODE_BA_INVOKEDYNAMIC
#define BYTECODE_47_DSTORE_0
#define BYTECODE_7C_IUSHR
#define BYTECODE_39_DSTORE
#define BYTECODE_01_ACONST_NULL
#define BYTECODE_B3_PUTSTATIC
#define BYTECODE_A4_IF_ICMPLE
#define BYTECODE_1B_ILOAD_1
#define BYTECODE_B5_PUTFIELD
#define BYTECODE_A1_IF_ICMPLT
#define BYTECODE_0C_FCONST_1
#define BYTECODE_4E_ASTORE_3
#define BYTECODE_20_LLOAD_2
#define BYTECODE_1F_LLOAD_1
#define BYTECODE_48_DSTORE_1
#define BYTECODE_23_FLOAD_1
#define BYTECODE_0D_FCONST_2
#define BYTECODE_5D_DUP2_X1
#define BYTECODE_3A_ASTORE
#define BYTECODE_C0_CHECKCAST
#define BYTECODE_41_LSTORE_2
#define BYTECODE_95_FCMPL
#define BYTECODE_B1_RETURN
#define BYTECODE_18_DLOAD
#define BYTECODE_3C_ISTORE_1
#define BYTECODE_2D_ALOAD_3
#define BYTECODE_BD_ANEWARRAY
#define BYTECODE_14_LDC2_W
#define BYTECODE_34_CALOAD
#define BYTECODE_2B_ALOAD_1
#define BYTECODE_37_LSTORE
#define BYTECODE_A5_IF_ACMPEQ
#define BYTECODE_16_LLOAD
#define BYTECODE_55_CASTORE
#define BYTECODE_C2_MONITORENTER
#define BYTECODE_B6_INVOKEVIRTUAL
#define BYTECODE_2E_IALOAD
#define JAVA_ASM_CONSTANT_POOL_STR
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
static bool encode_ut8x2(ut8 bytecode, const char *input, st32 input_size, ut8 *output, st32 output_size, ut64 pc, st32 *written)
static bool encode_addr16(ut8 bytecode, const char *input, st32 input_size, ut8 *output, st32 output_size, ut64 pc, st32 *written)
static bool encode_not_implemented(ut8 bytecode, const char *input, st32 input_size, ut8 *output, st32 output_size, ut64 pc, st32 *written)
static bool encode_const_pool16(ut8 bytecode, const char *input, st32 input_size, ut8 *output, st32 output_size, ut64 pc, st32 *written)
#define return_error_if_empty_input(a, b)
static bool encode_addr32(ut8 bytecode, const char *input, st32 input_size, ut8 *output, st32 output_size, ut64 pc, st32 *written)
static bool encode_const_pool16_ut8(ut8 bytecode, const char *input, st32 input_size, ut8 *output, st32 output_size, ut64 pc, st32 *written)
static bool encode_ut8(ut8 bytecode, const char *input, st32 input_size, ut8 *output, st32 output_size, ut64 pc, st32 *written)
bool java_assembler(const char *input, st32 input_size, ut8 *output, st32 output_size, ut64 pc, st32 *written)
bool(* AsmEncoder)(ut8 bytecode, const char *input, st32 input_size, ut8 *output, st32 output_size, ut64 pc, st32 *written)
static bool encode_st16(ut8 bytecode, const char *input, st32 input_size, ut8 *output, st32 output_size, ut64 pc, st32 *written)
static bool encode_const_pool8(ut8 bytecode, const char *input, st32 input_size, ut8 *output, st32 output_size, ut64 pc, st32 *written)
static bool encode_st8(ut8 bytecode, const char *input, st32 input_size, ut8 *output, st32 output_size, ut64 pc, st32 *written)
static const JavaAsm instructions[205]
#define return_error_if_size_lt(a, b)
static bool encode_only_bcode(ut8 bytecode, const char *input, st32 input_size, ut8 *output, st32 output_size, ut64 pc, st32 *written)
static bool encode_atype(ut8 bytecode, const char *input, st32 input_size, ut8 *output, st32 output_size, ut64 pc, st32 *written)
static static fork const void static count static fd const char const char static newpath char char char static envp time_t static t const char static mode static whence const char static dir time_t static t unsigned static seconds const char struct utimbuf static buf static inc static sig const char static mode static oldfd struct tms static buf static getgid static geteuid const char static filename static arg static mask struct ustat static ubuf static getppid static setsid static egid sigset_t static set struct timeval struct timezone static tz fd_set fd_set fd_set struct timeval static timeout const char char static bufsiz const char static swapflags void static offset const char static length static mode static who const char struct statfs static buf unsigned unsigned num
#define rz_return_val_if_fail(expr, val)
static void rz_write_be16(void *dest, ut16 val)
static void rz_write_be32(void *dest, ut32 val)
#define RZ_LOG_ERROR(fmtstr,...)
RZ_API bool rz_is_valid_input_num_value(RzNum *num, const char *input_value)
RZ_API const char * rz_str_trim_head_ro(const char *str)
RZ_API int rz_str_ncasecmp(const char *dst, const char *orig, size_t n)
ut64(WINAPI *w32_GetEnabledXStateFeatures)()
static bool input(void *ud, zip_uint8_t *data, zip_uint64_t length)