Rizin
unix-like reverse engineering framework and cli tools
|
Go to the source code of this file.
Macros | |
#define | PIPE_BUF 512 |
#define | SLOP (1 + sizeof(union VALUETYPE)) |
Functions | |
RZ_LIB_VERSION (rz_magic) | |
static void | free_mlist (struct mlist *mlist) |
static int | info_from_stat (RzMagic *ms, unsigned short md) |
static void | close_and_restore (const RzMagic *ms, const char *name, int fd, const struct stat *sb) |
static const char * | file_or_fd (RzMagic *ms, const char *inname, int fd) |
RZ_API RzMagic * | rz_magic_new (int flags) |
RZ_API void | rz_magic_free (RzMagic *ms) |
RZ_API bool | rz_magic_load_buffer (RzMagic *ms, const char *magicdata) |
RZ_API bool | rz_magic_load (RzMagic *ms, const char *magicfile) |
RZ_API bool | rz_magic_compile (RzMagic *ms, const char *magicfile) |
RZ_API bool | rz_magic_check (RzMagic *ms, const char *magicfile) |
RZ_API const char * | rz_magic_descriptor (RzMagic *ms, int fd) |
RZ_API const char * | rz_magic_file (RzMagic *ms, const char *inname) |
RZ_API const char * | rz_magic_buffer (RzMagic *ms, const void *buf, size_t nb) |
RZ_API const char * | rz_magic_error (RzMagic *ms) |
RZ_API int | rz_magic_errno (RzMagic *ms) |
RZ_API void | rz_magic_setflags (RzMagic *ms, int flags) |
#define SLOP (1 + sizeof(union VALUETYPE)) |
|
static |
Definition at line 131 of file magic.c.
References close_and_restore(), done, eprintf, F_GETFL, F_SETFL, fcntl, fd, file_buffer(), file_error(), file_fsmagic(), file_getbuffer(), file_reset(), flags, free(), fstat, info_from_stat(), malloc(), memset(), nbytes, NULL, O_BINARY, O_NONBLOCK, O_RDONLY, PIPE_BUF, r, read(), sb, SLOP, and stat.
Referenced by rz_magic_descriptor(), and rz_magic_file().
|
static |
Definition at line 87 of file magic.c.
References file_delmagic(), and free().
Referenced by rz_magic_check(), rz_magic_compile(), rz_magic_free(), rz_magic_load(), and rz_magic_load_buffer().
Definition at line 102 of file magic.c.
References file_printf(), benchmark::md, and S_ISREG.
Referenced by file_or_fd().
RZ_LIB_VERSION | ( | rz_magic | ) |
Definition at line 308 of file magic.c.
References file_buffer(), file_getbuffer(), file_reset(), and NULL.
Referenced by get_filetype(), and rz_core_magic_at().
Definition at line 294 of file magic.c.
References file_apprentice(), free_mlist(), and NULL.
Definition at line 300 of file magic.c.
References fd, file_or_fd(), and NULL.
RZ_API void rz_magic_free | ( | RzMagic * | ms | ) |
Definition at line 254 of file magic.c.
References free(), and free_mlist().
Referenced by get_filetype(), and rz_core_magic_at().
Definition at line 278 of file magic.c.
References file_apprentice(), and free_mlist().
Referenced by get_filetype(), and rz_core_magic_at().
Definition at line 235 of file magic.c.
References file_reset(), flags, free(), malloc(), NULL, rz_magic_setflags(), and RZ_NEW0.
Referenced by get_filetype(), and rz_core_magic_at().