Rizin
unix-like reverse engineering framework and cli tools
cmd_plugins.c File Reference
#include <rz_core.h>

Go to the source code of this file.

Functions

RZ_IPI RzCmdStatus rz_plugins_load_handler (RzCore *core, int argc, const char **argv)
 
RZ_IPI RzCmdStatus rz_plugins_unload_handler (RzCore *core, int argc, const char **argv)
 
RZ_IPI RzCmdStatus rz_plugins_lang_print_handler (RzCore *core, int argc, const char **argv, RzCmdStateOutput *state)
 
RZ_IPI RzCmdStatus rz_plugins_asm_print_handler (RzCore *core, int argc, const char **argv, RzCmdStateOutput *state)
 
RZ_IPI RzCmdStatus rz_plugins_core_print_handler (RzCore *core, int argc, const char **argv, RzCmdStateOutput *state)
 
RZ_IPI RzCmdStatus rz_plugins_debug_print_handler (RzCore *core, int argc, const char **argv, RzCmdStateOutput *state)
 
RZ_IPI RzCmdStatus rz_plugins_hash_print_handler (RzCore *core, int argc, const char **argv, RzCmdStateOutput *state)
 
RZ_IPI RzCmdStatus rz_plugins_bin_print_handler (RzCore *core, int argc, const char **argv, RzCmdStateOutput *state)
 
RZ_IPI RzCmdStatus rz_plugins_io_print_handler (RzCore *core, int argc, const char **argv, RzCmdStateOutput *state)
 
RZ_IPI RzCmdStatus rz_plugins_parser_print_handler (RzCore *core, int argc, const char **argv, RzCmdStateOutput *state)
 

Function Documentation

◆ rz_plugins_asm_print_handler()

RZ_IPI RzCmdStatus rz_plugins_asm_print_handler ( RzCore core,
int  argc,
const char **  argv,
RzCmdStateOutput state 
)

Definition at line 19 of file cmd_plugins.c.

19  {
20  return rz_core_asm_plugins_print(core, NULL, state);
21 }
RZ_API RzCmdStatus rz_core_asm_plugins_print(RzCore *core, const char *arch, RzCmdStateOutput *state)
Definition: casm.c:150
#define NULL
Definition: cris-opc.c:27
Definition: dis.h:43

References NULL, and rz_core_asm_plugins_print().

Referenced by rzshell_cmddescs_init().

◆ rz_plugins_bin_print_handler()

RZ_IPI RzCmdStatus rz_plugins_bin_print_handler ( RzCore core,
int  argc,
const char **  argv,
RzCmdStateOutput state 
)

Definition at line 38 of file cmd_plugins.c.

38  {
39  return rz_core_bin_plugins_print(core->bin, state);
40 }
RZ_API RzCmdStatus rz_core_bin_plugins_print(RzBin *bin, RzCmdStateOutput *state)
Definition: cbin.c:4855
RzBin * bin
Definition: rz_core.h:298

References rz_core_t::bin, and rz_core_bin_plugins_print().

Referenced by rzshell_cmddescs_init().

◆ rz_plugins_core_print_handler()

RZ_IPI RzCmdStatus rz_plugins_core_print_handler ( RzCore core,
int  argc,
const char **  argv,
RzCmdStateOutput state 
)

Definition at line 23 of file cmd_plugins.c.

23  {
24  return rz_core_core_plugins_print(core, state);
25 }
RZ_API RzCmdStatus rz_core_core_plugins_print(RzCore *core, RzCmdStateOutput *state)
Definition: core.c:3483

References rz_core_core_plugins_print().

Referenced by rzshell_cmddescs_init().

◆ rz_plugins_debug_print_handler()

RZ_IPI RzCmdStatus rz_plugins_debug_print_handler ( RzCore core,
int  argc,
const char **  argv,
RzCmdStateOutput state 
)

Definition at line 27 of file cmd_plugins.c.

27  {
28  if (argc > 1) {
29  return rz_config_set(core->config, "dbg.backend", argv[1]) ? RZ_CMD_STATUS_OK : RZ_CMD_STATUS_ERROR;
30  }
31  return rz_core_debug_plugins_print(core, state);
32 }
RZ_API RzCmdStatus rz_core_debug_plugins_print(RzCore *core, RzCmdStateOutput *state)
Definition: cdebug.c:329
RZ_API RzConfigNode * rz_config_set(RzConfig *cfg, RZ_NONNULL const char *name, const char *value)
Definition: config.c:267
static static fork const void static count static fd const char const char static newpath char char argv
Definition: sflib.h:40
@ RZ_CMD_STATUS_OK
command handler exited in the right way
Definition: rz_cmd.h:24
@ RZ_CMD_STATUS_ERROR
command handler had issues while running (e.g. allocation error, etc.)
Definition: rz_cmd.h:26
RzConfig * config
Definition: rz_core.h:300

References argv, rz_core_t::config, RZ_CMD_STATUS_ERROR, RZ_CMD_STATUS_OK, rz_config_set(), and rz_core_debug_plugins_print().

Referenced by rzshell_cmddescs_init().

◆ rz_plugins_hash_print_handler()

RZ_IPI RzCmdStatus rz_plugins_hash_print_handler ( RzCore core,
int  argc,
const char **  argv,
RzCmdStateOutput state 
)

Definition at line 34 of file cmd_plugins.c.

34  {
35  return rz_core_hash_plugins_print(core->hash, state);
36 }
RZ_API RzCmdStatus rz_core_hash_plugins_print(RzHash *hash, RzCmdStateOutput *state)
Definition: chash.c:34
RzHash * hash
Definition: rz_core.h:389

References rz_core_t::hash, and rz_core_hash_plugins_print().

Referenced by rzshell_cmddescs_init().

◆ rz_plugins_io_print_handler()

RZ_IPI RzCmdStatus rz_plugins_io_print_handler ( RzCore core,
int  argc,
const char **  argv,
RzCmdStateOutput state 
)

Definition at line 42 of file cmd_plugins.c.

42  {
43  if (argc > 1) {
44  if (rz_lib_open(core->lib, argv[1]) == -1) {
45  RZ_LOG_ERROR("Could not load an IO plugin from '%s'\n", argv[1]);
46  return RZ_CMD_STATUS_ERROR;
47  }
48  return RZ_CMD_STATUS_OK;
49  }
50  return rz_core_io_plugins_print(core->io, state);
51 }
RZ_API RzCmdStatus rz_core_io_plugins_print(RzIO *io, RzCmdStateOutput *state)
Print the registered IO plugins according to state.
Definition: cio.c:481
RZ_API int rz_lib_open(RzLib *lib, const char *file)
Definition: lib.c:281
#define RZ_LOG_ERROR(fmtstr,...)
Definition: rz_log.h:58
RzIO * io
Definition: rz_core.h:313
RzLib * lib
Definition: rz_core.h:318

References argv, rz_core_t::io, rz_core_t::lib, RZ_CMD_STATUS_ERROR, RZ_CMD_STATUS_OK, rz_core_io_plugins_print(), rz_lib_open(), and RZ_LOG_ERROR.

Referenced by rzshell_cmddescs_init().

◆ rz_plugins_lang_print_handler()

RZ_IPI RzCmdStatus rz_plugins_lang_print_handler ( RzCore core,
int  argc,
const char **  argv,
RzCmdStateOutput state 
)

Definition at line 15 of file cmd_plugins.c.

15  {
16  return rz_core_lang_plugins_print(core->lang, state);
17 }
RZ_API RzCmdStatus rz_core_lang_plugins_print(RzLang *lang, RzCmdStateOutput *state)
Definition: clang.c:33
RzLang * lang
Definition: rz_core.h:328

References rz_core_t::lang, and rz_core_lang_plugins_print().

Referenced by rzshell_cmddescs_init().

◆ rz_plugins_load_handler()

RZ_IPI RzCmdStatus rz_plugins_load_handler ( RzCore core,
int  argc,
const char **  argv 
)

Definition at line 7 of file cmd_plugins.c.

7  {
9 }
RZ_API const char * rz_str_trim_head_ro(const char *str)
Definition: str_trim.c:86

References argv, rz_core_t::lib, RZ_CMD_STATUS_ERROR, RZ_CMD_STATUS_OK, rz_lib_open(), and rz_str_trim_head_ro().

Referenced by rzshell_cmddescs_init().

◆ rz_plugins_parser_print_handler()

RZ_IPI RzCmdStatus rz_plugins_parser_print_handler ( RzCore core,
int  argc,
const char **  argv,
RzCmdStateOutput state 
)

Definition at line 53 of file cmd_plugins.c.

53  {
55 }
RZ_API RzCmdStatus rz_core_parser_plugins_print(RzParse *parser, RzCmdStateOutput *state)
Definition: cparser.c:27
RzParse * parser
Definition: rz_core.h:326

References rz_core_t::parser, and rz_core_parser_plugins_print().

Referenced by rzshell_cmddescs_init().

◆ rz_plugins_unload_handler()

RZ_IPI RzCmdStatus rz_plugins_unload_handler ( RzCore core,
int  argc,
const char **  argv 
)

Definition at line 11 of file cmd_plugins.c.

11  {
13 }
RZ_API int rz_lib_close(RzLib *lib, const char *file)
Definition: lib.c:227

References argv, rz_core_t::lib, RZ_CMD_STATUS_ERROR, RZ_CMD_STATUS_OK, rz_lib_close(), and rz_str_trim_head_ro().

Referenced by rzshell_cmddescs_init().