Rizin
unix-like reverse engineering framework and cli tools
|
#include <rz_userconf.h>
#include <rz_util/rz_str_util.h>
#include <stddef.h>
#include <assert.h>
#include <errno.h>
#include <rz_types_base.h>
#include <rz_constructor.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <stdarg.h>
#include <fcntl.h>
#include <rz_endian.h>
Go to the source code of this file.
Macros | |
#define | _FILE_OFFSET_BITS 64 |
#define | RZ_MODE_PRINT 0x000 |
#define | RZ_MODE_RIZINCMD 0x001 |
#define | RZ_MODE_SET 0x002 |
#define | RZ_MODE_SIMPLE 0x004 |
#define | RZ_MODE_JSON 0x008 |
#define | RZ_MODE_ARRAY 0x010 |
#define | RZ_MODE_SIMPLEST 0x020 |
#define | RZ_MODE_CLASSDUMP 0x040 |
#define | RZ_MODE_EQUAL 0x080 |
#define | RZ_IN /* do not use, implicit */ |
#define | RZ_OUT /* parameter is written, not read */ |
#define | RZ_INOUT /* parameter is read and written */ |
#define | RZ_OWN /* pointer ownership is transferred */ |
#define | RZ_BORROW /* pointer ownership is not transferred, it must not be freed by the receiver */ |
#define | RZ_NONNULL /* pointer can not be null */ |
#define | RZ_NULLABLE /* pointer can be null */ |
#define | RZ_DEPRECATE /* should not be used in new code and should/will be removed in the future */ |
#define | RZ_IFNULL(x) /* default value for the pointer when null */ |
#define | RZ_UNUSED /* unused */ |
#define | RZ_PERM_R 4 |
#define | RZ_PERM_W 2 |
#define | RZ_PERM_X 1 |
#define | RZ_PERM_RW (RZ_PERM_R | RZ_PERM_W) |
#define | RZ_PERM_RX (RZ_PERM_R | RZ_PERM_X) |
#define | RZ_PERM_RWX (RZ_PERM_R | RZ_PERM_W | RZ_PERM_X) |
#define | RZ_PERM_WX (RZ_PERM_W | RZ_PERM_X) |
#define | RZ_PERM_SHAR 8 |
#define | RZ_PERM_PRIV 16 |
#define | RZ_PERM_ACCESS 32 |
#define | RZ_PERM_CREAT 64 |
#define | UNUSED_FUNCTION(x) UNUSED_##x |
#define | __KFBSD__ 0 |
#define | TARGET_OS_IPHONE 0 |
#define | FUNC_ATTR_MALLOC |
#define | FUNC_ATTR_ALLOC_SIZE(x) |
#define | FUNC_ATTR_ALLOC_SIZE_PROD(x, y) |
#define | FUNC_ATTR_ALLOC_ALIGN(x) |
#define | FUNC_ATTR_PURE |
#define | FUNC_ATTR_CONST |
#define | FUNC_ATTR_USED |
#define | FUNC_ATTR_WARN_UNUSED_RESULT |
#define | FUNC_ATTR_ALWAYS_INLINE |
#define | RZ_PRINTF_CHECK(fmt, dots) |
#define | _GNU_SOURCE |
#define | RZ_SYS_DIR "/" |
#define | RZ_SYS_ENVSEP ":" |
#define | RZ_SYS_HOME "HOME" |
#define | RZ_SYS_TMP "TMPDIR" |
#define | RZ_JOIN_2_PATHS(p1, p2) p1 RZ_SYS_DIR p2 |
#define | RZ_JOIN_3_PATHS(p1, p2, p3) p1 RZ_SYS_DIR p2 RZ_SYS_DIR p3 |
#define | RZ_JOIN_4_PATHS(p1, p2, p3, p4) p1 RZ_SYS_DIR p2 RZ_SYS_DIR p3 RZ_SYS_DIR p4 |
#define | RZ_JOIN_5_PATHS(p1, p2, p3, p4, p5) p1 RZ_SYS_DIR p2 RZ_SYS_DIR p3 RZ_SYS_DIR p4 RZ_SYS_DIR p5 |
#define | __packed __attribute__((__packed__)) |
#define | CTO(y, z) ((size_t) & ((y *)0)->z) |
#define | CTA(x, y, z) (x + CTO(y, z)) |
#define | CTI(x, y, z) (*((size_t *)(CTA(x, y, z)))) |
#define | CTS(x, y, z, t, v) |
#define | RZ_IPI |
#define | RZ_HEAP |
#define | RZ_API |
#define | RZ_LIB_VERSION_HEADER(x) RZ_API const char *x##_version(void) |
#define | RZ_LIB_VERSION(x) |
#define | BITS2BYTES(x) (((x) / 8) + (((x) % 8) ? 1 : 0)) |
#define | ZERO_FILL(x) memset(&x, 0, sizeof(x)) |
#define | RZ_NEWS0(x, y) (x *)calloc(y, sizeof(x)) |
#define | RZ_NEWS(x, y) (x *)malloc(sizeof(x) * (y)) |
#define | RZ_NEW0(x) (x *)calloc(1, sizeof(x)) |
#define | RZ_NEW(x) (x *)malloc(sizeof(x)) |
#define | RZ_NEWCOPY(x, y) (x *)rz_new_copy(sizeof(x), y) |
#define | RZ_NEW_COPY(x, y) |
#define | RZ_MEM_ALIGN(x) ((void *)(size_t)(((ut64)(size_t)x) & 0xfffffffffffff000LL)) |
#define | RZ_ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) |
#define | RZ_PTR_MOVE(d, s) |
#define | RZ_PTR_ALIGN(v, t) ((char *)(((size_t)(v)) & ~(t - 1))) |
#define | RZ_PTR_ALIGN_NEXT(v, t) ((char *)(((size_t)(v) + (t - 1)) & ~(t - 1))) |
#define | RZ_BIT_MASK32(x, y) ((1UL << (x)) - (1UL << (y))) |
#define | RZ_BIT_SET(x, y) (((ut8 *)x)[y >> 4] |= (1 << (y & 0xf))) |
#define | RZ_BIT_UNSET(x, y) (((ut8 *)x)[y >> 4] &= ~(1 << (y & 0xf))) |
#define | RZ_BIT_TOGGLE(x, y) (RZ_BIT_CHK(x, y) ? RZ_BIT_UNSET(x, y) : RZ_BIT_SET(x, y)) |
#define | RZ_BIT_CHK(x, y) (*(x) & (1 << (y))) |
#define | PERROR_WITH_FILELINE 0 |
#define | rz_sys_perror(x) rz_sys_perror_str(x); |
#define | eprintf(...) fprintf(stderr, __VA_ARGS__) |
#define | HAVE_EPRINTF 1 |
#define | typeof(arg) __typeof__(arg) |
#define | rz_offsetof(type, member) offsetof(type, member) |
#define | RZ_FREE(x) |
#define | RZ_FREE_CUSTOM(x, y) |
#define | PFMT64x "llx" |
#define | PFMT64d "lld" |
#define | PFMT64u "llu" |
#define | PFMT64o "llo" |
#define | PFMTSZx "zx" |
#define | PFMTSZd "zd" |
#define | PFMTSZu "zu" |
#define | PFMTSZo "zo" |
#define | LDBLFMT "Lf" |
#define | HHXFMT "hhx" |
#define | PFMTDPTR "td" |
#define | PFMT32x "x" |
#define | PFMT32d "d" |
#define | PFMT32u "u" |
#define | PFMT32o "o" |
#define | O_BINARY 0 |
#define | RZ_SYS_BASE ((ut64)0x8048000) |
#define | RZ_SYS_ARCH "unknown" |
#define | RZ_SYS_BITS RZ_SYS_BITS_32 |
#define | RZ_SYS_ENDIAN 0 |
#define | RZ_SYS_ENDIAN_NONE 0 |
#define | RZ_SYS_ENDIAN_LITTLE 1 |
#define | RZ_SYS_ENDIAN_BIG 2 |
#define | RZ_SYS_ENDIAN_BI 3 |
#define | RZ_SYS_OS "unknown" |
#define | RZ_V_NOT(op, fail_ret) |
#define | rz_xwrite(fd, buf, count) RZ_V_NOT(write(fd, buf, count), -1) |
#define | rz_xread(fd, buf, count) RZ_V_NOT(read(fd, buf, count), -1) |
#define | rz_xfreopen(pathname, mode, stream) RZ_V_NOT(freopen(pathname, mode, stream), NULL) |
#define | container_of(ptr, type, member) ((type *)((char *)(__typeof__(((type *)0)->member) *){ ptr } - offsetof(type, member))) |
#define | RZ_REF_NAME refcount |
#define | rz_ref(x) x->RZ_REF_NAME++; |
#define | rz_ref_init(x) x->RZ_REF_NAME = 1 |
#define | rz_unref(x, f) |
#define | RZ_REF_TYPE RzRef RZ_REF_NAME |
#define | RZ_REF_FUNCTIONS(s, n) |
Typedefs | |
typedef int(* | PrintfCallback) (const char *str,...) RZ_PRINTF_CHECK(1 |
typedef int | RzRef |
Functions | |
static void * | rz_new_copy (int size, void *data) |
static void | rz_run_call1 (void *fcn, void *arg1) |
static void | rz_run_call2 (void *fcn, void *arg1, void *arg2) |
static void | rz_run_call3 (void *fcn, void *arg1, void *arg2, void *arg3) |
static void | rz_run_call4 (void *fcn, void *arg1, void *arg2, void *arg3, void *arg4) |
static void | rz_run_call5 (void *fcn, void *arg1, void *arg2, void *arg3, void *arg4, void *arg5) |
static void | rz_run_call6 (void *fcn, void *arg1, void *arg2, void *arg3, void *arg4, void *arg5, void *arg6) |
static void | rz_run_call7 (void *fcn, void *arg1, void *arg2, void *arg3, void *arg4, void *arg5, void *arg6, void *arg7) |
static void | rz_run_call8 (void *fcn, void *arg1, void *arg2, void *arg3, void *arg4, void *arg5, void *arg6, void *arg7, void *arg8) |
static void | rz_run_call9 (void *fcn, void *arg1, void *arg2, void *arg3, void *arg4, void *arg5, void *arg6, void *arg7, void *arg8, void *arg9) |
static void | rz_run_call10 (void *fcn, void *arg1, void *arg2, void *arg3, void *arg4, void *arg5, void *arg6, void *arg7, void *arg8, void *arg9, void *arg10) |
#define __KFBSD__ 0 |
Definition at line 131 of file rz_types.h.
#define __packed __attribute__((__packed__)) |
Definition at line 230 of file rz_types.h.
#define _FILE_OFFSET_BITS 64 |
Definition at line 5 of file rz_types.h.
#define _GNU_SOURCE |
Definition at line 199 of file rz_types.h.
Definition at line 280 of file rz_types.h.
#define container_of | ( | ptr, | |
type, | |||
member | |||
) | ((type *)((char *)(__typeof__(((type *)0)->member) *){ ptr } - offsetof(type, member))) |
Definition at line 650 of file rz_types.h.
Definition at line 237 of file rz_types.h.
#define CTO | ( | y, | |
z | |||
) | ((size_t) & ((y *)0)->z) |
Definition at line 236 of file rz_types.h.
Definition at line 239 of file rz_types.h.
#define eprintf | ( | ... | ) | fprintf(stderr, __VA_ARGS__) |
Definition at line 349 of file rz_types.h.
#define FUNC_ATTR_ALLOC_ALIGN | ( | x | ) |
Definition at line 180 of file rz_types.h.
#define FUNC_ATTR_ALLOC_SIZE | ( | x | ) |
Definition at line 178 of file rz_types.h.
#define FUNC_ATTR_ALLOC_SIZE_PROD | ( | x, | |
y | |||
) |
Definition at line 179 of file rz_types.h.
#define FUNC_ATTR_ALWAYS_INLINE |
Definition at line 185 of file rz_types.h.
#define FUNC_ATTR_CONST |
Definition at line 182 of file rz_types.h.
#define FUNC_ATTR_MALLOC |
Definition at line 177 of file rz_types.h.
#define FUNC_ATTR_PURE |
Definition at line 181 of file rz_types.h.
#define FUNC_ATTR_USED |
Definition at line 183 of file rz_types.h.
#define FUNC_ATTR_WARN_UNUSED_RESULT |
Definition at line 184 of file rz_types.h.
#define HAVE_EPRINTF 1 |
Definition at line 350 of file rz_types.h.
#define HHXFMT "hhx" |
Definition at line 402 of file rz_types.h.
#define LDBLFMT "Lf" |
Definition at line 401 of file rz_types.h.
#define O_BINARY 0 |
Definition at line 413 of file rz_types.h.
#define PERROR_WITH_FILELINE 0 |
Definition at line 323 of file rz_types.h.
#define PFMT32d "d" |
Definition at line 408 of file rz_types.h.
#define PFMT32o "o" |
Definition at line 410 of file rz_types.h.
#define PFMT32u "u" |
Definition at line 409 of file rz_types.h.
#define PFMT32x "x" |
Definition at line 407 of file rz_types.h.
#define PFMT64d "lld" |
Definition at line 394 of file rz_types.h.
#define PFMT64o "llo" |
Definition at line 396 of file rz_types.h.
#define PFMT64u "llu" |
Definition at line 395 of file rz_types.h.
#define PFMT64x "llx" |
Definition at line 393 of file rz_types.h.
#define PFMTDPTR "td" |
Definition at line 405 of file rz_types.h.
#define PFMTSZd "zd" |
Definition at line 398 of file rz_types.h.
#define PFMTSZo "zo" |
Definition at line 400 of file rz_types.h.
#define PFMTSZu "zu" |
Definition at line 399 of file rz_types.h.
#define PFMTSZx "zx" |
Definition at line 397 of file rz_types.h.
#define RZ_API |
Definition at line 269 of file rz_types.h.
Definition at line 300 of file rz_types.h.
Definition at line 316 of file rz_types.h.
Definition at line 310 of file rz_types.h.
Definition at line 311 of file rz_types.h.
#define RZ_BIT_TOGGLE | ( | x, | |
y | |||
) | (RZ_BIT_CHK(x, y) ? RZ_BIT_UNSET(x, y) : RZ_BIT_SET(x, y)) |
Definition at line 313 of file rz_types.h.
Definition at line 312 of file rz_types.h.
#define RZ_BORROW /* pointer ownership is not transferred, it must not be freed by the receiver */ |
Definition at line 63 of file rz_types.h.
Definition at line 66 of file rz_types.h.
#define RZ_FREE | ( | x | ) |
Definition at line 369 of file rz_types.h.
#define RZ_FREE_CUSTOM | ( | x, | |
y | |||
) |
Definition at line 375 of file rz_types.h.
#define RZ_HEAP |
Definition at line 254 of file rz_types.h.
Definition at line 69 of file rz_types.h.
#define RZ_IN /* do not use, implicit */ |
Definition at line 50 of file rz_types.h.
#define RZ_INOUT /* parameter is read and written */ |
Definition at line 52 of file rz_types.h.
#define RZ_IPI |
Definition at line 249 of file rz_types.h.
#define RZ_JOIN_2_PATHS | ( | p1, | |
p2 | |||
) | p1 RZ_SYS_DIR p2 |
Definition at line 224 of file rz_types.h.
#define RZ_JOIN_3_PATHS | ( | p1, | |
p2, | |||
p3 | |||
) | p1 RZ_SYS_DIR p2 RZ_SYS_DIR p3 |
Definition at line 225 of file rz_types.h.
#define RZ_JOIN_4_PATHS | ( | p1, | |
p2, | |||
p3, | |||
p4 | |||
) | p1 RZ_SYS_DIR p2 RZ_SYS_DIR p3 RZ_SYS_DIR p4 |
Definition at line 226 of file rz_types.h.
#define RZ_JOIN_5_PATHS | ( | p1, | |
p2, | |||
p3, | |||
p4, | |||
p5 | |||
) | p1 RZ_SYS_DIR p2 RZ_SYS_DIR p3 RZ_SYS_DIR p4 RZ_SYS_DIR p5 |
Definition at line 227 of file rz_types.h.
#define RZ_LIB_VERSION | ( | x | ) |
Definition at line 275 of file rz_types.h.
Definition at line 273 of file rz_types.h.
Definition at line 299 of file rz_types.h.
#define RZ_MODE_ARRAY 0x010 |
Definition at line 30 of file rz_types.h.
#define RZ_MODE_CLASSDUMP 0x040 |
Definition at line 32 of file rz_types.h.
#define RZ_MODE_EQUAL 0x080 |
Definition at line 33 of file rz_types.h.
#define RZ_MODE_JSON 0x008 |
Definition at line 29 of file rz_types.h.
#define RZ_MODE_PRINT 0x000 |
Definition at line 25 of file rz_types.h.
#define RZ_MODE_RIZINCMD 0x001 |
Definition at line 26 of file rz_types.h.
#define RZ_MODE_SET 0x002 |
Definition at line 27 of file rz_types.h.
#define RZ_MODE_SIMPLE 0x004 |
Definition at line 28 of file rz_types.h.
#define RZ_MODE_SIMPLEST 0x020 |
Definition at line 31 of file rz_types.h.
#define RZ_NEW_COPY | ( | x, | |
y | |||
) |
Definition at line 296 of file rz_types.h.
#define RZ_NEWCOPY | ( | x, | |
y | |||
) | (x *)rz_new_copy(sizeof(x), y) |
Definition at line 286 of file rz_types.h.
#define RZ_NONNULL /* pointer can not be null */ |
Definition at line 64 of file rz_types.h.
#define RZ_NULLABLE /* pointer can be null */ |
Definition at line 65 of file rz_types.h.
Definition at line 360 of file rz_types.h.
#define RZ_OUT /* parameter is written, not read */ |
Definition at line 51 of file rz_types.h.
#define RZ_OWN /* pointer ownership is transferred */ |
Definition at line 62 of file rz_types.h.
#define RZ_PERM_ACCESS 32 |
Definition at line 102 of file rz_types.h.
#define RZ_PERM_CREAT 64 |
Definition at line 103 of file rz_types.h.
#define RZ_PERM_PRIV 16 |
Definition at line 101 of file rz_types.h.
#define RZ_PERM_R 4 |
Definition at line 93 of file rz_types.h.
Definition at line 96 of file rz_types.h.
Definition at line 98 of file rz_types.h.
Definition at line 97 of file rz_types.h.
#define RZ_PERM_SHAR 8 |
Definition at line 100 of file rz_types.h.
#define RZ_PERM_W 2 |
Definition at line 94 of file rz_types.h.
Definition at line 99 of file rz_types.h.
#define RZ_PERM_X 1 |
Definition at line 95 of file rz_types.h.
#define RZ_PRINTF_CHECK | ( | fmt, | |
dots | |||
) |
Definition at line 192 of file rz_types.h.
Definition at line 305 of file rz_types.h.
Definition at line 307 of file rz_types.h.
Definition at line 301 of file rz_types.h.
#define rz_ref | ( | x | ) | x->RZ_REF_NAME++; |
Definition at line 658 of file rz_types.h.
#define rz_ref_init | ( | x | ) | x->RZ_REF_NAME = 1 |
Definition at line 659 of file rz_types.h.
#define RZ_REF_NAME refcount |
Definition at line 657 of file rz_types.h.
#define RZ_REF_TYPE RzRef RZ_REF_NAME |
Definition at line 668 of file rz_types.h.
#define RZ_SYS_ARCH "unknown" |
Definition at line 519 of file rz_types.h.
#define RZ_SYS_BASE ((ut64)0x8048000) |
Definition at line 430 of file rz_types.h.
#define RZ_SYS_BITS RZ_SYS_BITS_32 |
Definition at line 520 of file rz_types.h.
#define RZ_SYS_DIR "/" |
Definition at line 218 of file rz_types.h.
#define RZ_SYS_ENDIAN 0 |
Definition at line 521 of file rz_types.h.
#define RZ_SYS_ENDIAN_BI 3 |
Definition at line 528 of file rz_types.h.
#define RZ_SYS_ENDIAN_BIG 2 |
Definition at line 527 of file rz_types.h.
#define RZ_SYS_ENDIAN_LITTLE 1 |
Definition at line 526 of file rz_types.h.
#define RZ_SYS_ENDIAN_NONE 0 |
Definition at line 525 of file rz_types.h.
#define RZ_SYS_ENVSEP ":" |
Definition at line 219 of file rz_types.h.
#define RZ_SYS_HOME "HOME" |
Definition at line 220 of file rz_types.h.
#define RZ_SYS_OS "unknown" |
Definition at line 587 of file rz_types.h.
#define rz_sys_perror | ( | x | ) | rz_sys_perror_str(x); |
Definition at line 336 of file rz_types.h.
#define RZ_SYS_TMP "TMPDIR" |
Definition at line 221 of file rz_types.h.
Definition at line 660 of file rz_types.h.
#define RZ_UNUSED /* unused */ |
Definition at line 73 of file rz_types.h.
#define RZ_V_NOT | ( | op, | |
fail_ret | |||
) |
Definition at line 644 of file rz_types.h.
Definition at line 643 of file rz_types.h.
Definition at line 642 of file rz_types.h.
#define TARGET_OS_IPHONE 0 |
Definition at line 163 of file rz_types.h.
Definition at line 354 of file rz_types.h.
Definition at line 117 of file rz_types.h.
typedef int(* PrintfCallback) (const char *str,...) RZ_PRINTF_CHECK(1 |
Definition at line 233 of file rz_types.h.
Definition at line 655 of file rz_types.h.
enum RzOutputMode |
Enum to describe the way data are printed.
Definition at line 38 of file rz_types.h.
enum RzSysArch |
Definition at line 530 of file rz_types.h.
|
inlinestatic |
Definition at line 288 of file rz_types.h.
|
inlinestatic |
Definition at line 594 of file rz_types.h.
Referenced by rz_run_start().
|
inlinestatic |
Definition at line 634 of file rz_types.h.
Referenced by rz_run_start().
|
inlinestatic |
Definition at line 598 of file rz_types.h.
Referenced by rz_run_start().
|
inlinestatic |
Definition at line 602 of file rz_types.h.
Referenced by rz_run_start().
|
inlinestatic |
Definition at line 606 of file rz_types.h.
Referenced by rz_run_start().
|
inlinestatic |
|
inlinestatic |
Definition at line 614 of file rz_types.h.
Referenced by rz_run_start().
|
inlinestatic |
Definition at line 619 of file rz_types.h.
Referenced by rz_run_start().
|
inlinestatic |
Definition at line 624 of file rz_types.h.
Referenced by rz_run_start().
|
inlinestatic |
Definition at line 629 of file rz_types.h.
Referenced by rz_run_start().