13 #include "../format/dex/dex.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_state_new(rcmd, root, #cmd, flags, name_handler(cmd), &name_help(cmd)))
34 if (!analysis || !analysis->
binb.
bin) {
38 if (!
b->cur || !
b->cur->o) {
42 return plugin && !strcmp(plugin->
name,
"dex") ? (
RzBinDex *)
b->cur->o->bin_obj :
NULL;
50 for (
size_t i = 0;
i < strlen(
str); ++
i) {
142 rz_list_foreach (class_def->
static_fields, it, encoded_field) {
234 rz_list_foreach (class_def->
static_fields, it, encoded_field) {
287 .
summary =
"Core plugin to visualize dex class information",
314 .desc =
"Suite of dex commands, type `dex` for more info",
315 .license =
"LGPL-3.0-only",
321 #ifndef RZ_PLUGIN_INCORE
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 int rz_cons_printf(const char *format,...)
static const RzCmdDescHelp dex_usage
static bool rz_cmd_dex_init_handler(RzCore *core)
RzCorePlugin rz_core_plugin_dex
static void dex_print_class_def_exports(RzBinDex *dex, ut32 index, DexClassDef *class_def)
RZ_IPI RzCmdStatus rz_cmd_dexe_handler(RzCore *core, int argc, const char **argv, RzCmdStateOutput *state)
static char * decode_access_flags(ut32 access_flags)
RZ_API RzLibStruct rizin_plugin
static void dex_print_encoded_method(RzBinDex *dex, ut32 index, DexEncodedMethod *encoded_method)
static void dex_print_encoded_field(RzBinDex *dex, ut32 index, DexEncodedField *encoded_field)
static RzBinDex * core_dex_get_class(RzCore *core)
#define rz_cmd_desc_argv_modes_new_warn(rcmd, root, cmd, flags)
static void dex_print_class_def(RzBinDex *dex, ut32 index, DexClassDef *class_def)
#define static_description_without_args(command, summ)
RZ_IPI RzCmdStatus rz_cmd_dexs_handler(RzCore *core, int argc, const char **argv, RzCmdStateOutput *state)
RZ_API RZ_OWN char * rz_bin_dex_resolve_string_by_idx(RZ_NONNULL RzBinDex *dex, ut32 string_idx)
Returns the resolved string linked to the given string id.
RZ_API RZ_OWN char * rz_bin_dex_resolve_type_id_by_idx(RZ_NONNULL RzBinDex *dex, ut32 type_idx)
Returns the resolved string linked to the given type id.
RZ_API RZ_OWN char * rz_bin_dex_version(RZ_NONNULL RzBinDex *dex)
Returns the dex version (string format)
RZ_API RZ_OWN char * rz_bin_dex_access_flags_readable(ut32 access_flags)
RZ_API RZ_OWN char * rz_bin_dex_resolve_proto_by_idx(RZ_NONNULL RzBinDex *dex, ut32 proto_idx)
Returns the resolved string linked to the given prototype id.
RZ_API void Ht_() free(HtName_(Ht) *ht)
RZ_API ut32 rz_list_length(RZ_NONNULL const RzList *list)
Returns the length of the list.
static static fork const void static count static fd const char const char static newpath char char argv
return strdup("=SP r13\n" "=LR r14\n" "=PC r15\n" "=A0 r0\n" "=A1 r1\n" "=A2 r2\n" "=A3 r3\n" "=ZF zf\n" "=SF nf\n" "=OF vf\n" "=CF cf\n" "=SN or0\n" "gpr lr .32 56 0\n" "gpr pc .32 60 0\n" "gpr cpsr .32 64 0 ____tfiae_________________qvczn\n" "gpr or0 .32 68 0\n" "gpr tf .1 64.5 0 thumb\n" "gpr ef .1 64.9 0 endian\n" "gpr jf .1 64.24 0 java\n" "gpr qf .1 64.27 0 sticky_overflow\n" "gpr vf .1 64.28 0 overflow\n" "gpr cf .1 64.29 0 carry\n" "gpr zf .1 64.30 0 zero\n" "gpr nf .1 64.31 0 negative\n" "gpr itc .4 64.10 0 if_then_count\n" "gpr gef .4 64.16 0 great_or_equal\n" "gpr r0 .32 0 0\n" "gpr r1 .32 4 0\n" "gpr r2 .32 8 0\n" "gpr r3 .32 12 0\n" "gpr r4 .32 16 0\n" "gpr r5 .32 20 0\n" "gpr r6 .32 24 0\n" "gpr r7 .32 28 0\n" "gpr r8 .32 32 0\n" "gpr r9 .32 36 0\n" "gpr r10 .32 40 0\n" "gpr r11 .32 44 0\n" "gpr r12 .32 48 0\n" "gpr r13 .32 52 0\n" "gpr r14 .32 56 0\n" "gpr r15 .32 60 0\n" "gpr r16 .32 64 0\n" "gpr r17 .32 68 0\n")
#define rz_warn_if_reached()
enum rz_cmd_status_t RzCmdStatus
@ 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_ERROR
command handler had issues while running (e.g. allocation error, etc.)
@ RZ_OUTPUT_MODE_STANDARD
static size_t rz_pvector_len(const RzPVector *vec)
static void * rz_pvector_at(const RzPVector *vec, size_t index)
ut32 static_values_offset
Represent the output state of a command handler.