Rizin
unix-like reverse engineering framework and cli tools
cmd_plugins.c
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: 2009-2020 pancake <pancake@nopcode.org>
2 // SPDX-FileCopyrightText: 2020 ret2libc <sirmy15@gmail.com>
3 // SPDX-License-Identifier: LGPL-3.0-only
4 
5 #include <rz_core.h>
6 
7 RZ_IPI RzCmdStatus rz_plugins_load_handler(RzCore *core, int argc, const char **argv) {
9 }
10 
11 RZ_IPI RzCmdStatus rz_plugins_unload_handler(RzCore *core, int argc, const char **argv) {
13 }
14 
16  return rz_core_lang_plugins_print(core->lang, state);
17 }
18 
20  return rz_core_asm_plugins_print(core, NULL, state);
21 }
22 
24  return rz_core_core_plugins_print(core, state);
25 }
26 
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 }
33 
35  return rz_core_hash_plugins_print(core->hash, state);
36 }
37 
39  return rz_core_bin_plugins_print(core->bin, state);
40 }
41 
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 }
52 
55 }
#define RZ_IPI
Definition: analysis_wasm.c:11
RZ_API RzCmdStatus rz_core_asm_plugins_print(RzCore *core, const char *arch, RzCmdStateOutput *state)
Definition: casm.c:150
RZ_API RzCmdStatus rz_core_bin_plugins_print(RzBin *bin, RzCmdStateOutput *state)
Definition: cbin.c:4855
RZ_API RzCmdStatus rz_core_debug_plugins_print(RzCore *core, RzCmdStateOutput *state)
Definition: cdebug.c:329
RZ_API RzCmdStatus rz_core_hash_plugins_print(RzHash *hash, RzCmdStateOutput *state)
Definition: chash.c:34
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 RzCmdStatus rz_core_lang_plugins_print(RzLang *lang, RzCmdStateOutput *state)
Definition: clang.c:33
RZ_IPI RzCmdStatus rz_plugins_hash_print_handler(RzCore *core, int argc, const char **argv, RzCmdStateOutput *state)
Definition: cmd_plugins.c:34
RZ_IPI RzCmdStatus rz_plugins_debug_print_handler(RzCore *core, int argc, const char **argv, RzCmdStateOutput *state)
Definition: cmd_plugins.c:27
RZ_IPI RzCmdStatus rz_plugins_bin_print_handler(RzCore *core, int argc, const char **argv, RzCmdStateOutput *state)
Definition: cmd_plugins.c:38
RZ_IPI RzCmdStatus rz_plugins_io_print_handler(RzCore *core, int argc, const char **argv, RzCmdStateOutput *state)
Definition: cmd_plugins.c:42
RZ_IPI RzCmdStatus rz_plugins_unload_handler(RzCore *core, int argc, const char **argv)
Definition: cmd_plugins.c:11
RZ_IPI RzCmdStatus rz_plugins_core_print_handler(RzCore *core, int argc, const char **argv, RzCmdStateOutput *state)
Definition: cmd_plugins.c:23
RZ_IPI RzCmdStatus rz_plugins_asm_print_handler(RzCore *core, int argc, const char **argv, RzCmdStateOutput *state)
Definition: cmd_plugins.c:19
RZ_IPI RzCmdStatus rz_plugins_parser_print_handler(RzCore *core, int argc, const char **argv, RzCmdStateOutput *state)
Definition: cmd_plugins.c:53
RZ_IPI RzCmdStatus rz_plugins_lang_print_handler(RzCore *core, int argc, const char **argv, RzCmdStateOutput *state)
Definition: cmd_plugins.c:15
RZ_IPI RzCmdStatus rz_plugins_load_handler(RzCore *core, int argc, const char **argv)
Definition: cmd_plugins.c:7
RZ_API RzConfigNode * rz_config_set(RzConfig *cfg, RZ_NONNULL const char *name, const char *value)
Definition: config.c:267
RZ_API RzCmdStatus rz_core_parser_plugins_print(RzParse *parser, RzCmdStateOutput *state)
Definition: cparser.c:27
#define NULL
Definition: cris-opc.c:27
RZ_API RzCmdStatus rz_core_core_plugins_print(RzCore *core, RzCmdStateOutput *state)
Definition: core.c:3483
static static fork const void static count static fd const char const char static newpath char char argv
Definition: sflib.h:40
enum rz_cmd_status_t RzCmdStatus
@ 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
RZ_API int rz_lib_close(RzLib *lib, const char *file)
Definition: lib.c:227
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
RZ_API const char * rz_str_trim_head_ro(const char *str)
Definition: str_trim.c:86
Represent the output state of a command handler.
Definition: rz_cmd.h:91
RzBin * bin
Definition: rz_core.h:298
RzLang * lang
Definition: rz_core.h:328
RzIO * io
Definition: rz_core.h:313
RzLib * lib
Definition: rz_core.h:318
RzParse * parser
Definition: rz_core.h:326
RzHash * hash
Definition: rz_core.h:389
RzConfig * config
Definition: rz_core.h:300
Definition: dis.h:43