13 #include "../format/java/class_bin.h"
15 #define name_args(name) (cmd_##name##_args)
16 #define name_help(name) (cmd_##name##_help)
17 #define name_handler(name) (rz_cmd_##name##_handler)
18 #define static_description_without_args(command, summ) \
19 static const RzCmdDescArg name_args(command)[] = { \
22 static const RzCmdDescHelp name_help(command) = { \
24 .args = name_args(command), \
26 #define rz_cmd_desc_argv_modes_new_warn(rcmd, root, cmd, flags) \
27 rz_warn_if_fail(rz_cmd_desc_argv_modes_new(rcmd, root, #cmd, flags, name_handler(cmd), &name_help(cmd)))
29 #define rz_cmd_desc_argv_new_warn(rcmd, root, cmd) \
30 rz_warn_if_fail(rz_cmd_desc_argv_new(rcmd, root, #cmd, name_handler(cmd), &name_help(cmd)))
37 if (!analysis || !analysis->
binb.
bin) {
41 if (!
b->cur || !
b->cur->o) {
247 RZ_LOG_ERROR(
"can't resolve constant pool index %d\n", index);
253 RZ_LOG_ERROR(
"can't resolve constant pool index %d\n", index);
270 .
summary =
"Core plugin to visualize java class information",
289 .summary =
"resolves the class constant pool value at a given index",
319 .desc =
"Suite of java commands, type `java` for more info",
320 .license =
"LGPL-3.0-only",
326 #ifndef RZ_PLUGIN_INCORE
RZ_API void rz_bin_java_class_const_pool_as_json(RZ_NONNULL RzBinJavaClass *bin, RZ_NONNULL PJ *j)
Returns the class const pool in json format via PJ arg.
RZ_API void rz_bin_java_class_interfaces_as_text(RZ_NONNULL RzBinJavaClass *bin, RZ_NONNULL RzStrBuf *sb)
Returns the class interfaces as text via RzStrBuf arg.
RZ_API void rz_bin_java_class_as_json(RZ_NONNULL RzBinJavaClass *bin, RZ_NONNULL PJ *j)
Returns the class info as json.
RZ_API void rz_bin_java_class_fields_as_json(RZ_NONNULL RzBinJavaClass *bin, RZ_NONNULL PJ *j)
Returns the fields in json format via PJ arg.
RZ_API RZ_OWN char * rz_bin_java_class_const_pool_resolve_index(RZ_NONNULL RzBinJavaClass *bin, st32 index)
Returns the string linked to the class const pool index.
RZ_API void rz_bin_java_class_as_text(RZ_NONNULL RzBinJavaClass *bin, RZ_NONNULL RzStrBuf *sb)
Returns the class info as text.
RZ_API void rz_bin_java_class_as_source_code(RZ_NONNULL RzBinJavaClass *bin, RZ_NONNULL RzStrBuf *sb)
Returns the class info as text source code.
RZ_API void rz_bin_java_class_const_pool_as_text(RZ_NONNULL RzBinJavaClass *bin, RZ_NONNULL RzStrBuf *sb)
Returns the class const pool in text format via RzStrBuf arg.
RZ_API void rz_bin_java_class_interfaces_as_json(RZ_NONNULL RzBinJavaClass *bin, RZ_NONNULL PJ *j)
Returns the class interfaces as json via PJ arg.
RZ_API void rz_bin_java_class_methods_as_text(RZ_NONNULL RzBinJavaClass *bin, RZ_NONNULL RzStrBuf *sb)
Returns the methods in text format via RzStrBuf arg.
RZ_API void rz_bin_java_class_fields_as_text(RZ_NONNULL RzBinJavaClass *bin, RZ_NONNULL RzStrBuf *sb)
Returns the fields in text format via RzStrBuf arg.
RZ_API void rz_bin_java_class_methods_as_json(RZ_NONNULL RzBinJavaClass *bin, RZ_NONNULL PJ *j)
Returns the methods in json format via PJ arg.
RZ_API RzCmdDesc * rz_cmd_get_root(RzCmd *cmd)
Get the root command descriptor.
RZ_API RzCmdDesc * rz_cmd_desc_group_new(RzCmd *cmd, RzCmdDesc *parent, const char *name, RzCmdArgvCb cb, const RzCmdDescHelp *help, const RzCmdDescHelp *group_help)
Create a new command descriptor for a name that is used both as a group but that has a sub-command wi...
RZ_API void rz_cons_println(const char *str)
RZ_IPI RzCmdStatus rz_cmd_javar_handler(RzCore *core, int argc, const char **argv)
#define rz_cmd_desc_argv_new_warn(rcmd, root, cmd)
static RzBinJavaClass * core_java_get_class(RzCore *core)
RZ_API RzLibStruct rizin_plugin
RZ_IPI RzCmdStatus rz_cmd_javas_handler(RzCore *core, int argc, const char **argv)
RZ_IPI RzCmdStatus rz_cmd_javai_handler(RzCore *core, int argc, const char **argv, RzOutputMode mode)
RZ_IPI RzCmdStatus rz_cmd_javap_handler(RzCore *core, int argc, const char **argv, RzOutputMode mode)
static const RzCmdDescHelp java_usage
#define rz_cmd_desc_argv_modes_new_warn(rcmd, root, cmd, flags)
RZ_IPI RzCmdStatus rz_cmd_javam_handler(RzCore *core, int argc, const char **argv, RzOutputMode mode)
RZ_IPI RzCmdStatus rz_cmd_javac_handler(RzCore *core, int argc, const char **argv, RzOutputMode mode)
static bool rz_cmd_java_init_handler(RzCore *core)
RzCorePlugin rz_core_plugin_java
RZ_IPI RzCmdStatus rz_cmd_javaf_handler(RzCore *core, int argc, const char **argv, RzOutputMode mode)
#define static_description_without_args(command, summ)
RZ_API void Ht_() free(HtName_(Ht) *ht)
RZ_API RZ_OWN char * rz_demangler_java(RZ_NULLABLE const char *symbol)
Demangles java symbols.
static static fork const void static count static fd const char const char static newpath char char argv
#define rz_warn_if_reached()
enum rz_cmd_status_t RzCmdStatus
@ RZ_CMD_ARG_TYPE_NUM
Argument is a number.
@ RZ_CMD_STATUS_OK
command handler exited in the right way
@ RZ_CMD_STATUS_WRONG_ARGS
command handler could not handle the arguments passed to it
@ RZ_CMD_STATUS_INVALID
command could not be executed (e.g. shell level error, bad expression, etc.)
@ RZ_CMD_STATUS_ERROR
command handler had issues while running (e.g. allocation error, etc.)
#define RZ_LOG_ERROR(fmtstr,...)
RZ_API ut64 rz_num_math(RzNum *num, const char *str)
RZ_API const char * pj_string(PJ *pj)
RZ_API void pj_free(PJ *j)
RZ_API char * rz_strbuf_get(RzStrBuf *sb)
RZ_API RzStrBuf * rz_strbuf_new(const char *s)
RZ_API void rz_strbuf_free(RzStrBuf *sb)
RzOutputMode
Enum to describe the way data are printed.
@ RZ_OUTPUT_MODE_STANDARD