14 #define RZ_HASH_DEFAULT_BLOCK_SIZE 0x1000
73 printf(
"Usage: rz-hash [-vhBkjLq] [-b S] [-a A] [-c H] [-E A] [-D A] [-s S] [-x S] [-f O] [-t O] [files|-] ...\n");
79 " -h Shows this help page\n"
80 " - Input read from stdin instead from a file\n"
81 " -a algo Hash algorithm to use and you can specify multiple ones by\n"
82 " appending a comma (example: sha1,md4,md5,sha256)\n"
83 " -B Outputs the calculated value for each block\n"
84 " -b size Sets the block size\n"
85 " -c value Compare calculated value with a given one (hexadecimal)\n"
86 " -e endian Sets the endianness (default: 'big' accepted: 'big' or 'little')\n"
87 " -D algo Decrypt the given input; use -S to set key and -I to set IV (if needed)\n"
88 " -E algo Encrypt the given input; use -S to set key and -I to set IV (if needed)\n"
89 " -f from Starts the calculation at given offset\n"
90 " -t to Stops the calculation at given offset\n"
91 " -I iv Sets the initialization vector (IV)\n"
92 " -i times Repeat the calculation N times\n"
93 " -j Outputs the result as a JSON structure\n"
94 " -k Outputs the calculated value using openssh's randomkey algorithm\n"
95 " -L List all algorithms\n"
96 " -q Sets quiet mode (use -qq to get only the calculated value)\n"
97 " -S seed Sets the seed for -a, use '^' to append it before the input, use '@'\n"
98 " prefix to load it from a file and '-' from read it\n"
99 " -K key Sets the hmac key for -a and the key for -E/-D, use '@' prefix to\n"
100 " load it from a file and '-' from read it\n"
101 " from stdin (you can combine them)\n"
102 " -s string Input read from a zero-terminated string instead from a file\n"
103 " -x hex Input read from a hexadecimal value instead from a file\n"
105 " All the inputs (besides -s/-x/-c) can be hexadecimal or strings\n"
106 " if 's:' prefix is specified\n");
110 char flags[7] = { 0 };
112 printf(
"flags algorithm license author\n");
122 if (!strncmp(
"base", rcp->
name, 4) || !strcmp(
"punycode", rcp->
name)) {
124 }
else if (!strcmp(
"rol", rcp->
name)) {
126 }
else if (!strcmp(
"ror", rcp->
name)) {
136 " E = encryption, D = decryption\n"
137 " e = encoding, d = encoding\n"
138 " h = hash, m = hmac\n");
141 #define rz_hash_bool_error(x, o, f, ...) \
142 (x)->operation = o; \
143 RZ_LOG_ERROR("rz-hash: error, " f, ##__VA_ARGS__); \
146 #define rz_hash_error(x, o, f, ...) \
147 (x)->operation = o; \
148 RZ_LOG_ERROR("rz-hash: error, " f, ##__VA_ARGS__); \
151 #define rz_hash_set_val(x, k, d, v) \
154 rz_hash_error(x, RZ_HASH_OP_UNKNOWN, "invalid combination of arguments for '-%c' (expected " #d " but found something else)\n", c); \
159 #define rz_hash_ctx_set_val(x, k, d, v) \
161 if ((x)->k != (d)) { \
162 rz_hash_error(x, RZ_HASH_OP_UNKNOWN, "invalid combination of arguments for '-%c' (expected " #d " but found something else)\n", c); \
167 #define rz_hash_ctx_set_bool(x, k, i, t, f) \
169 if (i && !strcmp(i, t)) { \
171 } else if (i && !strcmp(i, f)) { \
174 rz_hash_error(x, RZ_HASH_OP_UNKNOWN, "expected '%s' or '%s' but got '%s'\n", t, f, i); \
178 #define rz_hash_ctx_set_quiet(x) \
180 if ((x)->mode == RZ_HASH_MODE_STANDARD) { \
181 (x)->mode = RZ_HASH_MODE_QUIET; \
182 } else if ((x)->mode == RZ_HASH_MODE_QUIET) { \
183 (x)->mode = RZ_HASH_MODE_VERY_QUIET; \
184 } else if ((x)->mode == RZ_HASH_MODE_JSON) { \
185 rz_hash_error(x, RZ_HASH_OP_UNKNOWN, "can't be quiet when json mode is selected\n"); \
186 } else if ((x)->mode == RZ_HASH_MODE_RANDOMART) { \
187 rz_hash_error(x, RZ_HASH_OP_UNKNOWN, "can't be quiet when openssh mode is selected\n"); \
191 #define rz_hash_ctx_set_signed(x, k, i) \
193 (x)->k = strtoll((i), NULL, 0); \
195 rz_hash_error(x, RZ_HASH_OP_UNKNOWN, "argument must be > 0\n"); \
199 #define rz_hash_ctx_set_unsigned(x, k, i) \
201 (x)->k = strtoull((i), NULL, 0); \
203 rz_hash_error(x, RZ_HASH_OP_UNKNOWN, "argument must be > 0\n"); \
207 #define rz_hash_ctx_set_input(x, k, s, h) \
210 rz_hash_error(x, RZ_HASH_OP_UNKNOWN, "invalid combination of arguments for '-%c'\n", c); \
211 } else if (h || strlen(s) < 1) { \
212 (x)->k = strdup(s); \
214 (x)->k = rz_str_newf("s:%s", s); \
218 #define rz_hash_ctx_set_mode(x, m) rz_hash_ctx_set_val(x, mode, RZ_HASH_MODE_STANDARD, m)
219 #define rz_hash_ctx_set_op(x, o) rz_hash_ctx_set_val(x, operation, RZ_HASH_OP_UNKNOWN, o)
220 #define rz_hash_ctx_set_str(x, k, s) rz_hash_ctx_set_val(x, k, NULL, strdup(s))
225 if (!strcmp(
string,
"-")) {
228 stringlen = strlen(
string);
230 if (stringlen < 1 || !
string) {
238 RZ_LOG_ERROR(
"rz-hash: error, failed to allocate string in memory.\n");
248 *bufsize = stringlen;
257 if (!strcmp(hexadecimal,
"-")) {
260 hexlen = strlen(hexadecimal);
263 if (hexlen < 1 || !hexadecimal) {
267 }
else if (hexlen & 1) {
268 RZ_LOG_ERROR(
"rz-hash: error, option %s is not a valid hexadecimal (len is not pair: %d).\n",
option, hexlen);
273 st64 binlen = hexlen >> 1;
295 if (!strcmp(
arg,
"-")) {
299 }
else if (
arg[0] ==
'@') {
301 }
else if (!strncmp(
arg,
"s:", 2)) {
319 const char *seed =
NULL;
348 case 'B':
ctx->show_blocks =
true;
break;
368 if (opt.
ind >= argc && !
ctx->input) {
373 if (!
ctx->algorithm) {
378 if (!
ctx->input && !strcmp(
argv[argc - 1],
"-")) {
379 ctx->use_stdin =
true;
386 for (
int i = opt.
ind;
i < argc; ++
i) {
397 if (
ctx->nfiles < 1 && !
ctx->use_stdin && !
ctx->input) {
402 if (strstr(
ctx->algorithm,
"luhn")) {
403 if (strchr(
ctx->algorithm,
',')) {
406 if (!
ctx->input || strncmp(
ctx->input,
"s:", 2)) {
412 if (
ctx->show_blocks) {
415 if (
ctx->block_size < strlen(
ctx->algorithm + 2)) {
416 ctx->block_size = strlen(
ctx->algorithm + 2);
429 if (!
key && strncmp(
"base",
ctx->algorithm, 4) && strcmp(
"punycode",
ctx->algorithm)) {
434 if (!strncmp(
ctx->algorithm,
"base", 4)) {
436 }
else if (strchr(
ctx->algorithm,
',')) {
438 }
else if (
len < 1 ||
c & 1) {
442 if (
ctx->show_blocks) {
452 if (
ctx->show_blocks &&
ctx->compare) {
463 if (
ctx->offset.from &&
ctx->offset.to &&
ctx->offset.from >=
ctx->offset.to) {
466 if (
ctx->block_size &&
ctx->offset.from &&
ctx->offset.to && (
ctx->offset.to -
ctx->offset.from) %
ctx->block_size) {
471 if (seed[0] ==
'^') {
473 ctx->as_prefix =
true;
484 if (!
ctx->block_size) {
508 goto rz_hash_context_create_desc_io_stdin_end;
514 goto rz_hash_context_create_desc_io_stdin_end;
520 goto rz_hash_context_create_desc_io_stdin_end;
524 RZ_LOG_ERROR(
"rz-hash: error, cannot write into malloc://%d buffer\n",
size);
527 goto rz_hash_context_create_desc_io_stdin_end;
530 rz_hash_context_create_desc_io_stdin_end:
546 goto rz_hash_context_create_desc_io_string_end;
550 goto rz_hash_context_create_desc_io_string_end;
555 goto rz_hash_context_create_desc_io_string_end;
557 goto rz_hash_context_create_desc_io_string_end;
563 goto rz_hash_context_create_desc_io_string_end;
569 goto rz_hash_context_create_desc_io_string_end;
576 goto rz_hash_context_create_desc_io_string_end;
579 rz_hash_context_create_desc_io_string_end:
598 RZ_LOG_ERROR(
"rz-hash: error, failed to allocate JSON memory.\n");
599 goto rz_hash_context_run_end;
603 if (
ctx->use_stdin) {
607 goto rz_hash_context_run_end;
612 if (!
run(
ctx, io,
"stdin")) {
613 goto rz_hash_context_run_end;
618 }
else if (
ctx->input) {
619 if (strlen(
ctx->input) > 0) {
623 goto rz_hash_context_run_end;
627 pj_ka(
ctx->pj, !strncmp(
ctx->input,
"s:", 2) ?
"string" :
"hexadecimal");
629 if (!
run(
ctx, io, !strncmp(
ctx->input,
"s:", 2) ?
"string" :
"hexadecimal")) {
630 goto rz_hash_context_run_end;
640 goto rz_hash_context_run_end;
646 goto rz_hash_context_run_end;
661 rz_hash_context_run_end:
670 RZ_LOG_ERROR(
"rz-hash: error, cannot allocate value memory\n");
675 for (
int i = 0, bsize;
i <
len;
i++) {
676 bsize = (
len -
i) * 2 + 1;
696 RZ_LOG_ERROR(
"rz-hash: error, cannot write on stdout\n");
704 RZ_LOG_ERROR(
"rz-hash: error, cannot write on stdout\n");
710 RZ_LOG_ERROR(
"rz-hash: error, cannot write on stdout\n");
730 bool has_seed = !
ctx->iv &&
ctx->seed.len > 0;
731 const char *hmac =
ctx->key.len > 0 ?
"hmac-" :
"";
747 printf(
"%s%s\n%s\n", hmac, hname, rndart);
762 const char *hmac =
ctx->key.len > 0 ?
"hmac-" :
"";
774 printf(
"%s: 0x%08" PFMT64x "-0x%08" PFMT64x " %s%s: computed hash %s the expected one\n",
filename,
ctx->offset.from,
to, hmac, hname, result ?
"matches" :
"doesn't match");
777 printf(
"%s: %s%s: computed hash %s the expected one\n",
filename, hmac, hname, result ?
"matches" :
"doesn't match");
780 printf(
"%s", result ?
"true" :
"false");
786 if (!strcmp(
ctx->algorithm,
"all")) {
802 const char *algorithm;
815 RZ_LOG_ERROR(
"rz-hash: error, empty list of hash algorithms\n");
816 goto calculate_hash_end;
823 RZ_LOG_ERROR(
"rz-hash: error, cannot allocate hash context memory\n");
824 goto calculate_hash_end;
827 if (
ctx->offset.to > filesize) {
828 RZ_LOG_ERROR(
"rz-hash: error, -t value is greater than file size\n");
829 goto calculate_hash_end;
832 if (
ctx->offset.from > filesize) {
833 RZ_LOG_ERROR(
"rz-hash: error, -f value is greater than file size\n");
834 goto calculate_hash_end;
837 bsize =
ctx->block_size;
840 RZ_LOG_ERROR(
"rz-hash: error, cannot allocate block memory\n");
841 goto calculate_hash_end;
844 rz_list_foreach (algorithms, it, algorithm) {
846 goto calculate_hash_end;
851 goto calculate_hash_end;
856 size_t cmphashlen = 0;
861 goto calculate_hash_end;
865 goto calculate_hash_end;
868 if (
ctx->as_prefix &&
ctx->seed.buf &&
870 goto calculate_hash_end;
873 for (
ut64 j =
ctx->offset.from; j <
to; j += bsize) {
876 goto calculate_hash_end;
880 if (!
ctx->as_prefix &&
ctx->seed.buf &&
882 goto calculate_hash_end;
886 goto calculate_hash_end;
889 rz_list_foreach (algorithms, it, algorithm) {
891 if (digest_size != cmphashlen) {
894 result = !memcmp(cmphash, digest, digest_size);
905 }
else if (
ctx->show_blocks) {
907 for (
ut64 j =
ctx->offset.from; j <
to; j += bsize) {
913 goto calculate_hash_end;
916 rz_list_foreach (algorithms, it, algorithm) {
930 goto calculate_hash_end;
933 if (
ctx->as_prefix &&
ctx->seed.buf &&
935 goto calculate_hash_end;
938 for (
ut64 j =
ctx->offset.from; j <
to; j += bsize) {
941 goto calculate_hash_end;
945 if (!
ctx->as_prefix &&
ctx->seed.buf &&
947 goto calculate_hash_end;
952 goto calculate_hash_end;
955 rz_list_foreach (algorithms, it, algorithm) {
987 if (!strncmp(
ctx->iv,
"s:", 2)) {
989 goto calculate_decrypt_end;
993 goto calculate_decrypt_end;
1000 RZ_LOG_ERROR(
"rz-hash: error, failed to allocate memory\n");
1001 goto calculate_decrypt_end;
1005 RZ_LOG_ERROR(
"rz-hash: error, unknown encryption algorithm '%s'\n",
ctx->algorithm);
1006 goto calculate_decrypt_end;
1011 goto calculate_decrypt_end;
1016 goto calculate_decrypt_end;
1021 RZ_LOG_ERROR(
"rz-hash: error, file size is less than 1\n");
1022 goto calculate_decrypt_end;
1025 bsize =
ctx->block_size;
1028 RZ_LOG_ERROR(
"rz-hash: error, cannot allocate block memory\n");
1029 goto calculate_decrypt_end;
1033 for (
ut64 j =
ctx->offset.from; j <
to; j += bsize) {
1040 int plaintext_size = 0;
1046 calculate_decrypt_end:
1055 bool result =
false;
1062 bool requires_key = !strncmp(
"base",
ctx->algorithm, 4) || !strcmp(
"punycode",
ctx->algorithm);
1063 if (!requires_key &&
ctx->key.len < 1) {
1064 RZ_LOG_ERROR(
"rz-hash: error, cannot encrypt without a key\n");
1065 goto calculate_encrypt_end;
1069 if (!strncmp(
ctx->iv,
"s:", 2)) {
1071 goto calculate_encrypt_end;
1075 goto calculate_encrypt_end;
1082 RZ_LOG_ERROR(
"rz-hash: error, failed to allocate memory\n");
1083 goto calculate_encrypt_end;
1087 RZ_LOG_ERROR(
"rz-hash: error, unknown encryption algorithm '%s'\n",
ctx->algorithm);
1088 goto calculate_encrypt_end;
1093 goto calculate_encrypt_end;
1098 goto calculate_encrypt_end;
1103 RZ_LOG_ERROR(
"rz-hash: error, file size is less than 1\n");
1104 goto calculate_encrypt_end;
1107 bsize =
ctx->block_size;
1110 RZ_LOG_ERROR(
"rz-hash: error, cannot allocate block memory\n");
1111 goto calculate_encrypt_end;
1115 for (
ut64 j =
ctx->offset.from; j <
to; j += bsize) {
1122 int ciphertext_size = 0;
1128 calculate_encrypt_end:
1137 const char *
input =
ctx->input + 2;
1143 RZ_LOG_ERROR(
"rz-hash: error, input string is not a number\n");
1148 switch (
ctx->mode) {
1197 free(homeplugindir);
1213 switch (
ctx.operation) {
1219 goto rz_main_rz_hash_end;
1224 goto rz_main_rz_hash_end;
1229 goto rz_main_rz_hash_end;
1234 goto rz_main_rz_hash_end;
1242 goto rz_main_rz_hash_end;
1244 goto rz_main_rz_hash_end;
1250 goto rz_main_rz_hash_end;
1255 rz_main_rz_hash_end:
RZ_API int rz_crypto_update(RzCrypto *cry, const ut8 *buf, int len)
RZ_API bool rz_crypto_set_iv(RzCrypto *cry, const ut8 *iv, int ivlen)
RZ_API int rz_crypto_final(RzCrypto *cry, const ut8 *buf, int len)
RZ_API const ut8 * rz_crypto_get_output(RzCrypto *cry, int *size)
RZ_API bool rz_crypto_set_key(RzCrypto *cry, const ut8 *key, int keylen, int mode, int direction)
RZ_API void rz_crypto_free(RzCrypto *cry)
RZ_API RzCrypto * rz_crypto_new(void)
RZ_API const RzCryptoPlugin * rz_crypto_plugin_by_index(size_t index)
RZ_API bool rz_crypto_use(RzCrypto *cry, const char *algo)
_Use_decl_annotations_ int __cdecl printf(const char *const _Format,...)
static static fork const void static count static fd const char const char static newpath const char static path const char path
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 static arg static fd static protocol static who struct sockaddr static addrlen static backlog struct timeval struct timezone static tz const struct iovec static count static mode const void const struct sockaddr static tolen const char static pathname void static offset struct stat static buf void long static basep static whence static length const void static len key
static int is_string(const ut8 *buf, int size, int *len)
RZ_API RZ_BORROW const ut8 * rz_hash_cfg_get_result(RZ_NONNULL RzHashCfg *md, RZ_NONNULL const char *name, RZ_NONNULL ut32 *size)
Returns the digest value of the requested algorithm name.
RZ_API RZ_OWN RzHashCfg * rz_hash_cfg_new(RZ_NONNULL RzHash *rh)
RZ_API bool rz_hash_plugin_add(RZ_NONNULL RzHash *rh, RZ_NONNULL RZ_OWN const RzHashPlugin *plugin)
Add a new plugin to rh so that RzHashCfg can be created using specific algorithms.
RZ_API void rz_hash_cfg_free(RZ_NONNULL RzHashCfg *md)
RZ_API bool rz_hash_cfg_iterate(RZ_NONNULL RzHashCfg *md, size_t iterate)
Calculate the final hash by iterating its result N times.
RZ_API void rz_hash_free(RzHash *rh)
RZ_API RZ_BORROW const RzHashPlugin * rz_hash_plugin_by_index(RZ_NONNULL RzHash *rh, size_t index)
RZ_API RzHash * rz_hash_new(void)
RZ_API bool rz_hash_cfg_configure(RZ_NONNULL RzHashCfg *md, RZ_NONNULL const char *name)
Allocates and configures the plugin message digest context.
RZ_API bool rz_hash_cfg_hmac(RZ_NONNULL RzHashCfg *md, RZ_NONNULL const ut8 *key, ut64 key_size)
Sets the key for the hmac algorithm.
RZ_API bool rz_hash_cfg_init(RZ_NONNULL RzHashCfg *md)
Resets/initialize the message digest contextes.
RZ_API bool rz_hash_cfg_update(RZ_NONNULL RzHashCfg *md, RZ_NONNULL const ut8 *data, ut64 size)
Inserts data into each the message digest contextes.
RZ_API bool rz_hash_cfg_final(RZ_NONNULL RzHashCfg *md)
Generates the final value of the message digest contextes.
RZ_API RZ_OWN char * rz_hash_cfg_get_result_string(RZ_NONNULL RzHashCfg *md, RZ_NONNULL const char *name, RZ_NULLABLE ut32 *size, bool invert)
Returns the digest value of the requested algorithm name.
RZ_API void Ht_() free(HtName_(Ht) *ht)
memcpy(mem, inblock.get(), min(CONTAINING_RECORD(inblock.get(), MEMBLOCK, data) ->size, size))
static int compare(const char *s1, const char *s2, int l1, int l2)
static void list(RzEgg *egg)
static void hash_context_fini(RzHashContext *ctx)
static RzList * parse_hash_algorithms(RzHashContext *ctx)
#define rz_hash_ctx_set_op(x, o)
@ RZ_HASH_MODE_VERY_QUIET
static bool hash_context_run(RzHashContext *ctx, RzHashRun run)
static bool calculate_encrypt(RzHashContext *ctx, RzIO *io, const char *filename)
#define rz_hash_ctx_set_mode(x, m)
static void hash_load_plugins(RzHashContext *ctx)
#define rz_hash_ctx_set_input(x, k, s, h)
#define rz_hash_error(x, o, f,...)
#define RZ_HASH_DEFAULT_BLOCK_SIZE
static RzIODesc * hash_context_create_desc_io_string(RzIO *io, const char *input)
#define rz_hash_ctx_set_signed(x, k, i)
static RzIODesc * hash_context_create_desc_io_stdin(RzIO *io)
static bool calculate_hash(RzHashContext *ctx, RzIO *io, const char *filename)
static void rz_hash_show_help(bool usage_only)
RZ_API int rz_main_rz_hash(int argc, const char **argv)
static void hash_context_compare_hashes(RzHashContext *ctx, size_t filesize, bool result, const char *hname, const char *filename)
static void hash_print_digest(RzHashContext *ctx, RzHashCfg *md, const char *hname, ut64 from, ut64 to, const char *filename)
static void hash_print_crypto(RzHashContext *ctx, const char *hname, const ut8 *buffer, int len, ut64 from, ut64 to)
#define rz_hash_ctx_set_unsigned(x, k, i)
static void hash_parse_cmdline(int argc, const char **argv, RzHashContext *ctx)
#define rz_hash_bool_error(x, o, f,...)
static bool hash_parse_any(RzHashContext *ctx, const char *option, const char *arg, RzHashBuffer *hb)
bool(* RzHashRun)(RzHashContext *ctx, RzIO *io, const char *filename)
static int lib_hash_cb(RzLibPlugin *pl, void *user, void *data)
static bool calculate_luhn(RzHashContext *ctx, RzIO *io, const char *filename)
#define rz_hash_ctx_set_bool(x, k, i, t, f)
static bool hash_parse_string(const char *option, const char *string, ut8 **buffer, size_t *bufsize)
static bool hash_parse_hexadecimal(const char *option, const char *hexadecimal, ut8 **buffer, size_t *bufsize)
#define rz_hash_set_val(x, k, d, v)
#define rz_hash_ctx_set_quiet(x)
struct rz_hash_context RzHashContext
static bool calculate_decrypt(RzHashContext *ctx, RzIO *io, const char *filename)
static void rz_hash_show_algorithms(RzHashContext *ctx)
#define rz_hash_ctx_set_str(x, k, s)
RZ_API RZ_OWN RzList * rz_list_newf(RzListFree f)
Returns a new initialized RzList pointer and sets the free method.
RZ_API ut32 rz_list_length(RZ_NONNULL const RzList *list)
Returns the length of the list.
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.
void * malloc(size_t size)
static static fork const void static count static fd const char const char static newpath char char argv
RZ_API RZ_OWN char * rz_hash_cfg_randomart(RZ_NONNULL const ut8 *buffer, ut32 length, ut64 address)
Generates a randomart that is meant to be an easily validate buffers.
static int run(int i, const char *arg)
#define rz_warn_if_reached()
RZ_API bool rz_file_is_directory(const char *str)
RZ_API char * rz_stdin_slurp(int *sz)
RZ_API RZ_OWN char * rz_file_slurp(const char *str, RZ_NULLABLE size_t *usz)
RZ_API void rz_getopt_init(RzGetopt *go, int argc, const char **argv, const char *ostr)
RZ_API int rz_getopt_next(RzGetopt *opt)
RZ_API int rz_hex_str2bin(const char *in, ut8 *out)
Convert an input string in into the binary form in out.
RZ_API int rz_io_pwrite_at(RzIO *io, ut64 paddr, const ut8 *buf, int len)
RZ_API ut64 rz_io_desc_size(RzIODesc *desc)
RZ_API void rz_io_free(RzIO *io)
RZ_API RzIODesc * rz_io_open_nomap(RzIO *io, const char *uri, int flags, int mode)
RZ_API int rz_io_pread_at(RzIO *io, ut64 paddr, ut8 *buf, int len)
RZ_API RzIO * rz_io_new(void)
RZ_API bool rz_io_desc_close(RzIODesc *desc)
RZ_API void rz_lib_free(RzLib *lib)
RZ_API RzLib * rz_lib_new(const char *symname, const char *symnamefunc)
RZ_API bool rz_lib_opendir(RzLib *lib, const char *path, bool force)
Open all the libraries in the given directory, if it wasn't already opened.
RZ_API bool rz_lib_add_handler(RzLib *lib, int type, const char *desc, RzLibCallback ct, RzLibCallback dt, void *user)
#define RZ_LOG_ERROR(fmtstr,...)
RZ_API bool rz_calculate_luhn_value(const char *data, ut64 *result)
RZ_API int rz_main_version_print(const char *program)
RZ_API RZ_OWN char * rz_path_home_prefix(RZ_NULLABLE const char *path)
Return path prefixed by the home prefix.
RZ_API RZ_OWN char * rz_path_system(RZ_NULLABLE const char *path)
Return the full system path of the given subpath path.
RZ_API PJ * pj_ka(PJ *j, const char *k)
RZ_API PJ * pj_kb(PJ *j, const char *k, bool v)
RZ_API PJ * pj_end(PJ *j)
RZ_API const char * pj_string(PJ *pj)
RZ_API void pj_free(PJ *j)
RZ_API PJ * pj_ks(PJ *j, const char *k, const char *v)
RZ_API PJ * pj_kn(PJ *j, const char *k, ut64 n)
RZ_API char * rz_str_newf(const char *fmt,...) RZ_PRINTF_CHECK(1
#define RZ_STR_ISEMPTY(x)
RZ_API RzList * rz_str_split_list(char *str, const char *c, int n)
Split the string str according to the substring c and returns a RzList with the result.
RZ_API int rz_str_unescape(char *buf)
RZ_API char * rz_sys_getenv(const char *key)
Get the value of an environment variable named key or NULL if none exists.
static struct sockaddr static addrlen static backlog const void static flags void struct sockaddr from
static struct sockaddr static addrlen static backlog const void static flags void struct sockaddr socklen_t static fromlen const void const struct sockaddr to
static struct sockaddr static addrlen static backlog const void static flags void flags
struct rz_io_desc_t * desc
ut64(WINAPI *w32_GetEnabledXStateFeatures)()
static bool input(void *ud, zip_uint8_t *data, zip_uint64_t length)
int read(izstream &zs, T *x, Items items)