43 const char zero[8] = { 0, 0, 0, 0, 0, 0, 0, 0 };
44 return (!memcmp(
buf, &zero,
size)) ? 1 : 0;
54 return (!memcmp(
buf,
"\xff\xff\xff\xff\xff\xff\xff\xff",
size)) ? 1 : 0;
57 #define USE_IS_VALID_OFFSET 1
69 #if USE_IS_VALID_OFFSET
79 if (
n > 0xffffffffffffLL)
90 if ((
size >= 4 && !memcmp(
buf,
"\xcf\xfa\xed\xfe", 4))) {
93 if ((
size >= 4 && !memcmp(
buf,
"\x7f\x45\x4c\x46", 4))) {
96 if ((
size >= 2 && !memcmp(
buf,
"MZ", 2))) {
105 int i,
len, mallocsz = 1024;
129 for (
i = 0;
i <
len;
i++) {
132 if (
i > 0 &&
d->len >
len) {
149 const char *
k = pal->
num;
209 RzAnalysisData *ad =
RZ_NEW0(RzAnalysisData);
244 RzAnalysisData *ad =
RZ_NEW0(RzAnalysisData);
249 ad->buf = (
ut8 *)&(ad->sbuf);
275 if (
d->buf != (
ut8 *)&(
d->sbuf)) {
287 int word = wordsize ? wordsize :
RZ_MIN(8,
bits / 8);
301 for (
i = 1;
i <
len;
i++) {
312 if (is_sequence >
len - 2) {
316 if (is_pattern >
len - 2) {
352 RzAnalysisData *data;
353 int word =
a->bits / 8;
354 for (
i = j = 0;
i <
len; j++) {
363 switch (data->type) {
369 if (data->ptr > 1000) {
394 if ((inv * 100 / j) > 60) {
397 if ((unk * 100 / j) > 60) {
400 if ((
num * 100 / j) > 60) {
403 if ((
str * 100 / j) > 40) {
int bits(struct state *s, int need)
RZ_API RzAnalysisData * rz_analysis_data_new(ut64 addr, int type, ut64 n, const ut8 *buf, int len)
static int is_null(const ut8 *buf, int size)
RZ_API const char * rz_analysis_datatype_to_string(RzAnalysisDataType t)
RZ_API RzAnalysisData * rz_analysis_data(RzAnalysis *analysis, ut64 addr, const ut8 *buf, int size, int wordsize)
RZ_API const char * rz_analysis_data_kind(RzAnalysis *a, ut64 addr, const ut8 *buf, int len)
static ut64 is_pointer(RzAnalysis *analysis, const ut8 *buf, int size)
RZ_API RzAnalysisData * rz_analysis_data_new_string(ut64 addr, const char *p, int len, int type)
RZ_API void rz_analysis_data_free(RzAnalysisData *d)
static int is_number(const ut8 *buf, int size)
static int is_string(const ut8 *buf, int size, int *len)
static bool is_bin(const ut8 *buf, int size)
RZ_API char * rz_analysis_data_to_string(RzAnalysisData *d, RzConsPrintablePalette *pal)
static int is_invalid(const ut8 *buf, int size)
RZ_API void Ht_() free(HtName_(Ht) *ht)
return memset(p, 0, total)
memcpy(mem, inblock.get(), min(CONTAINING_RECORD(inblock.get(), MEMBLOCK, data) ->size, size))
void * malloc(size_t size)
static static fork const void static count static fd const char const char static newpath char char char static envp time_t static t const char static mode static whence const char static dir time_t static t unsigned static seconds const char struct utimbuf static buf static inc static sig const char static mode static oldfd struct tms static buf static getgid static geteuid const char static filename static arg static mask struct ustat static ubuf static getppid static setsid static egid sigset_t static set struct timeval struct timezone static tz fd_set fd_set fd_set struct timeval static timeout const char char static bufsiz const char static swapflags void static offset const char static length static mode static who const char struct statfs static buf unsigned unsigned num
static uint32_t const uint8_t * buf2
@ RZ_ANALYSIS_DATA_TYPE_INVALID
@ RZ_ANALYSIS_DATA_TYPE_PATTERN
@ RZ_ANALYSIS_DATA_TYPE_UNKNOWN
@ RZ_ANALYSIS_DATA_TYPE_NUMBER
@ RZ_ANALYSIS_DATA_TYPE_STRING
@ RZ_ANALYSIS_DATA_TYPE_WIDE_STRING
@ RZ_ANALYSIS_DATA_TYPE_HEADER
@ RZ_ANALYSIS_DATA_TYPE_POINTER
@ RZ_ANALYSIS_DATA_TYPE_SEQUENCE
@ RZ_ANALYSIS_DATA_TYPE_NULL
@ RZ_ANALYSIS_DATATYPE_FLOAT
@ RZ_ANALYSIS_DATATYPE_INT64
@ RZ_ANALYSIS_DATATYPE_STRING
@ RZ_ANALYSIS_DATATYPE_NULL
@ RZ_ANALYSIS_DATATYPE_INT32
@ RZ_ANALYSIS_DATATYPE_ARRAY
@ RZ_ANALYSIS_DATATYPE_CLASS
@ RZ_ANALYSIS_DATATYPE_BOOLEAN
@ RZ_ANALYSIS_DATATYPE_OBJECT
@ RZ_ANALYSIS_DATATYPE_INT16
enum rz_analysis_data_type_t RzAnalysisDataType
#define RZ_LOG_ERROR(fmtstr,...)
RZ_API ut64 rz_mem_get_num(const ut8 *b, int size)
RZ_API RZ_OWN char * rz_strbuf_drain(RzStrBuf *sb)
RZ_API bool rz_strbuf_reserve(RzStrBuf *sb, size_t len)
RZ_API bool rz_strbuf_append(RzStrBuf *sb, const char *s)
RZ_API RzStrBuf * rz_strbuf_new(const char *s)
RZ_API void rz_strbuf_free(RzStrBuf *sb)
RZ_API bool rz_strbuf_appendf(RzStrBuf *sb, const char *fmt,...) RZ_PRINTF_CHECK(2
RzIOIsValidOff is_valid_offset
ut64(WINAPI *w32_GetEnabledXStateFeatures)()