Rizin
unix-like reverse engineering framework and cli tools
|
#include <rz_userconf.h>
#include "file.h"
#include "rz_regex.h"
#include <string.h>
#include <ctype.h>
#include <stdlib.h>
#include "rz_util/rz_time.h"
Go to the source code of this file.
Macros | |
#define | RZ_MAGIC_DESC ((ms->flags & RZ_MAGIC_MIME) ? m->mimetype : m->desc) |
#define | DO_CVT(fld, cast) |
#define | DO_CVT2(fld, cast) |
#define | RZ_REGEX_STARTEND 0 |
Functions | |
static int | match (RzMagic *, struct rz_magic *, ut32, const ut8 *, size_t, int) |
static int | mget (RzMagic *, const ut8 *, struct rz_magic *, size_t, unsigned int) |
static int | magiccheck (RzMagic *, struct rz_magic *) |
static st32 | mprint (RzMagic *, struct rz_magic *) |
static void | mdebug (ut32, const char *, size_t) |
static int | mcopy (RzMagic *, union VALUETYPE *, int, int, const ut8 *, ut32, size_t, size_t) |
static int | mconvert (RzMagic *, struct rz_magic *) |
static int | print_sep (RzMagic *, int) |
static void | cvt_8 (union VALUETYPE *, const struct rz_magic *) |
static void | cvt_16 (union VALUETYPE *, const struct rz_magic *) |
static void | cvt_32 (union VALUETYPE *, const struct rz_magic *) |
static void | cvt_64 (union VALUETYPE *, const struct rz_magic *) |
int | file_softmagic (RzMagic *ms, const ut8 *buf, size_t nbytes, int mode) |
static int | check_fmt (RzMagic *ms, struct rz_magic *m) |
char * | strdupn (const char *str, size_t n) |
static void | cvt_float (union VALUETYPE *p, const struct rz_magic *m) |
static void | cvt_double (union VALUETYPE *p, const struct rz_magic *m) |
static ut64 | file_strncmp (const char *s1, const char *s2, size_t len, ut32 flags) |
static ut64 | file_strncmp16 (const char *a, const char *b, size_t len, ut32 flags) |
#define DO_CVT | ( | fld, | |
cast | |||
) |
Definition at line 564 of file softmagic.c.
#define DO_CVT2 | ( | fld, | |
cast | |||
) |
Definition at line 611 of file softmagic.c.
Definition at line 63 of file softmagic.c.
#define RZ_REGEX_STARTEND 0 |
|
static |
Definition at line 276 of file softmagic.c.
References file_magerror(), RZ_MAGIC_DESC, rz_regex_comp(), rz_regex_error(), rz_regex_exec(), RZ_REGEX_EXTENDED, rz_regex_fini(), and RZ_REGEX_NOSUB.
Referenced by mprint().
|
static |
|
static |
|
static |
Definition at line 607 of file softmagic.c.
References DO_CVT, and ut64().
Referenced by mconvert().
|
static |
|
static |
|
static |
Definition at line 628 of file softmagic.c.
Referenced by mconvert().
Definition at line 70 of file softmagic.c.
Definition at line 1232 of file softmagic.c.
References a, b, flags, islower, isspace, isupper, L, len, s1, s2, tolower, toupper, ut64(), and v.
Referenced by file_strncmp16(), and magiccheck().
Definition at line 1290 of file softmagic.c.
References a, b, file_strncmp(), flags, and len.
Referenced by magiccheck().
|
static |
Definition at line 1300 of file softmagic.c.
References c, eprintf, file_magerror(), file_signextend(), file_strncmp(), file_strncmp16(), setup::idx, int, regress::m, p, PFMT64d, PFMT64u, PFMT64x, rz_regmatch_t::rm_eo, rz_regmatch_t::rm_so, RZ_MIN, rz_regex_comp(), rz_regex_error(), rz_regex_exec(), RZ_REGEX_EXTENDED, rz_regex_fini(), RZ_REGEX_ICASE, RZ_REGEX_NEWLINE, RZ_REGEX_NOMATCH, RZ_REGEX_STARTEND, st64, UNSIGNED, ut64(), UT64_MAX, and v.
Referenced by match().
|
static |
Definition at line 108 of file softmagic.c.
References file_check_mem(), file_printf(), regress::m, magiccheck(), mget(), mprint(), nbytes, print_sep(), RZ_MAGIC_DESC, and s.
Referenced by file_softmagic().
|
static |
Definition at line 641 of file softmagic.c.
References cvt_16(), cvt_32(), cvt_64(), cvt_8(), cvt_double(), cvt_float(), file_magerror(), len, regress::m, p, rz_read_be32(), rz_read_le32(), st32, and ut64().
Referenced by mget().
|
static |
Definition at line 774 of file softmagic.c.
References eprintf, file_showstr(), len, and cmd_descs_generate::str.
Referenced by mget().
|
static |
Definition at line 884 of file softmagic.c.
References count, file_mdump(), regress::m, mconvert(), mcopy(), mdebug(), nbytes, off, p, s, and st32.
Referenced by match().
|
static |
Definition at line 311 of file softmagic.c.
References ASCTIME_BUF_MINLEN, check_fmt(), file_fmttime(), file_magerror(), file_oomem(), file_printf(), file_signextend(), test-lz4-speed::float, free(), regress::m, malloc(), NULL, p, RZ_MAGIC_DESC, snprintf, st32, strdupn(), ut64(), and v.
Referenced by match().
Definition at line 297 of file softmagic.c.
References len, malloc(), memcpy(), n, NULL, and cmd_descs_generate::str.
Referenced by mprint().