15 printf(
"Usage: rz-sign [options] [file]\n"
16 " -h this help message\n"
17 " -a [-a] add extra 'a' to analysis command (available only with -o option)\n"
18 " -e [k=v] set an evaluable config variable (available only with -o option)\n"
19 " -c [output.pat] [input.sig] parses a FLIRT signature and converts it to its other format\n"
20 " -o [output.sig] [input.bin] performs an analysis on the binary and generates the FLIRT signature.\n"
21 " -d [flirt.sig] parses a FLIRT signature and dump its content\n"
23 " -v show version information\n"
25 " rz-sign -d signature.sig\n"
26 " rz-sign -c new_signature.pat old_signature.sig\n"
27 " rz-sign -o libc.sig libc.so.6\n");
33 case 0:
cmd =
"aa";
break;
34 case 1:
cmd =
"aaa";
break;
35 default:
cmd =
"aaaa";
break;
42 const char *input_file =
NULL;
43 const char *output_file =
NULL;
53 size_t complexity = 0;
69 RZ_LOG_ERROR(
"rz-sign: cannot combine option -%c with previous options\n",
c);
74 output_file = opt.
arg;
78 RZ_LOG_ERROR(
"rz-sign: cannot combine option -%c with previous options\n",
c);
83 output_file = opt.
arg;
87 RZ_LOG_ERROR(
"rz-sign: cannot combine option -%c with previous options\n",
c);
96 RZ_LOG_ERROR(
"rz-sign: cannot add evaluable config variable '%s' to RzList\n", opt.
arg);
117 if (opt.
ind >= argc) {
127 RZ_LOG_ERROR(
"rz-sign: Invalid analysis complexity (too many -a defined, max -aa)\n");
147 RZ_LOG_ERROR(
"rz-sign: Could not open file %s\n", input_file);
162 rz_list_foreach (evars, it,
config) {
176 rz_cons_printf(
"rz-sign: %s was converted to %s.\n", input_file, output_file);
186 rz_cons_printf(
"rz-sign: written %u signatures to %s.\n", n_nodes, output_file);
195 RZ_LOG_ERROR(
"rz-sign: missing option, please set -c or -d or -o\n");
RZ_API int rz_core_bin_update_arch_bits(RzCore *r)
RZ_API RZ_BORROW RzCoreFile * rz_core_file_open(RZ_NONNULL RzCore *r, RZ_NONNULL const char *file, int flags, ut64 loadaddr)
Tries to open the file as is, otherwise tries as is a compilation of files.
RZ_API bool rz_core_bin_load(RZ_NONNULL RzCore *r, RZ_NULLABLE const char *filenameuri, ut64 baddr)
RZ_API int rz_core_cmd0(RzCore *core, const char *cmd)
RZ_API bool rz_config_eval(RZ_NONNULL RzConfig *cfg, RZ_NONNULL const char *str)
Sets the configuration variable and its value passed as argument.
RZ_API RzConfigNode * rz_config_set_i(RzConfig *cfg, RZ_NONNULL const char *name, const ut64 i)
RZ_API RzConfigNode * rz_config_set_b(RzConfig *cfg, RZ_NONNULL const char *name, bool value)
RZ_API void rz_cons_set_interactive(bool x)
RZ_API int rz_cons_printf(const char *format,...)
RZ_API void rz_cons_flush(void)
RZ_API void rz_cons_reset(void)
_Use_decl_annotations_ int __cdecl printf(const char *const _Format,...)
RZ_API bool rz_core_flirt_convert_file(RZ_NONNULL RzCore *core, RZ_NONNULL const char *input_file, RZ_NONNULL const char *output_file)
converts a FLIRT file to the other format.
RZ_API bool rz_core_flirt_create_file(RZ_NONNULL RzCore *core, RZ_NONNULL const char *output_file, RZ_NULLABLE ut32 *written_nodes)
Generates a new FLIRT file from a given RzCore structure.
RZ_API bool rz_core_flirt_dump_file(RZ_NONNULL const char *flirt_file)
Dumps the contents of a FLIRT file.
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 cmd
RZ_API void Ht_() free(HtName_(Ht) *ht)
RZ_API void rz_core_free(RzCore *c)
RZ_API RzCore * rz_core_new(void)
@ RZ_SIGN_OPT_CONVERT_FLIRT
@ RZ_SIGN_OPT_CREATE_FLIRT
static void rz_sign_show_help(void)
static void perform_analysis(RzCore *core, size_t complexity)
RZ_API int rz_main_rz_sign(int argc, const char **argv)
RZ_API RZ_OWN RzList * rz_list_newf(RzListFree f)
Returns a new initialized RzList pointer and sets the free method.
RZ_API RZ_BORROW RzListIter * rz_list_append(RZ_NONNULL RzList *list, void *data)
Appends at the end of the list a new element.
RZ_API void rz_list_free(RZ_NONNULL RzList *list)
Empties the list and frees the list pointer.
RZ_API int rz_core_loadlibs(RzCore *core, int where)
static static fork const void static count static fd const char const char static newpath char char argv
RZ_API void rz_getopt_init(RzGetopt *go, int argc, const char **argv, const char *ostr)
RZ_API int rz_getopt_next(RzGetopt *opt)
#define RZ_LOG_ERROR(fmtstr,...)
RZ_API int rz_main_version_print(const char *program)
RZ_API char * rz_str_new(const char *str)