当前位置: 首页>>代码示例>>C++>>正文


C++ r_buf_size函数代码示例

本文整理汇总了C++中r_buf_size函数的典型用法代码示例。如果您正苦于以下问题:C++ r_buf_size函数的具体用法?C++ r_buf_size怎么用?C++ r_buf_size使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了r_buf_size函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: load

static int load(RBinFile *arch) {
	const ut8 *bytes = arch ? r_buf_buffer (arch->buf) : NULL;
	ut64 sz = arch ? r_buf_size (arch->buf): 0;

	if (!arch || !arch->o) return false;
	arch->o->bin_obj = load_bytes (arch, bytes, sz, arch->o->loadaddr, arch->sdb);
	return arch->o->bin_obj ? true: false;
}
开发者ID:cosarara97,项目名称:radare2,代码行数:8,代码来源:bin_coff.c

示例2: load

static int load(RBinFile *arch) {
	const ut8 *bytes = arch ? r_buf_buffer (arch->buf) : NULL;
	ut64 sz = arch ? r_buf_size (arch->buf): 0;

	if (!arch || !arch->o) return R_FALSE;
	arch->o->bin_obj = load_bytes (bytes, sz, arch->o->loadaddr, arch->sdb);
	return arch->o->bin_obj ? R_TRUE: R_FALSE;
}
开发者ID:crowell,项目名称:radare2,代码行数:8,代码来源:bin_dex.c

示例3: load

static bool load(RBinFile *arch) {
	if (arch && arch->buf) {
		const ut8 *bytes = r_buf_buffer (arch->buf);
		ut64 sz = r_buf_size (arch->buf);
		return load_bytes (arch, bytes, sz, arch->o->loadaddr, arch->sdb) != NULL;
	}
	return false;
}
开发者ID:XVilka,项目名称:radare2,代码行数:8,代码来源:bin_mbn.c

示例4: r_buf_size

R_API RIODesc *r_io_open_buffer(RIO *io, RBuffer *b, int flags, int mode) {
	const int bufSize = r_buf_size (b);
	char *uri = r_str_newf ("malloc://%d", bufSize);
	RIODesc *desc = r_io_open_nomap (io, uri, flags, mode);
	if (desc) {
		r_io_desc_write (desc, r_buf_get_at(b, 0, NULL), bufSize);
	}
	return desc;
}
开发者ID:agatti,项目名称:radare2,代码行数:9,代码来源:io.c

示例5: load

static bool load(RBinFile *arch) {
	const ut8 *bytes = arch? r_buf_buffer (arch->buf): NULL;
	ut64 sz = arch? r_buf_size (arch->buf): 0;
	if (!arch || !arch->o) {
		return false;
	}
	arch->rbin->maxstrbuf = 0x20000000;
	return check_bytes (bytes, sz);
}
开发者ID:P4N74,项目名称:radare2,代码行数:9,代码来源:bin_ningba.c

示例6: load

static bool load(RBinFile *bf) {
	const ut8 *bytes = bf? r_buf_buffer (bf->buf): NULL;
	ut64 sz = bf? r_buf_size (bf->buf): 0;
	if (!bf || !bf->o) {
		return false;
	}
	bf->o->bin_obj = load_bytes (bf, bytes, sz, bf->o->loadaddr, bf->sdb);
	return check_bytes (bytes, sz);
}
开发者ID:megabug,项目名称:radare2,代码行数:9,代码来源:bin_ninds.c

示例7: check

static int check(RBinFile *arch) {
	const ut8 *bytes = arch ? r_buf_buffer (arch->buf) : NULL;
	const ut64 size = arch ? r_buf_size (arch->buf) : 0;

	if (!arch || !arch->o || !bytes)
		return false;

	return check_bytes(bytes, size);
}
开发者ID:13572293130,项目名称:radare2,代码行数:9,代码来源:bin_xbe.c

示例8: load

static bool load(RBinFile *bf) {
	if (!bf || !bf->buf || !bf->o) {
		return false;
	}
	const ut64 sz = r_buf_size (bf->buf);
	const ut64 la = bf->o->loadaddr;
	const ut8 *bytes = r_buf_buffer (bf->buf);
	bf->o->bin_obj = load_bytes (bf, bytes, sz, la, bf->sdb);
	return bf->o->bin_obj != NULL;
}
开发者ID:PankajKataria,项目名称:radare2,代码行数:10,代码来源:bin_nro.c

示例9: load

static bool load(RBinFile *bf) {
	if (!bf || !bf->o) {
		return false;
	}
	const ut8 *bytes = r_buf_buffer (bf->buf);
	ut64 sz = r_buf_size (bf->buf);
	const void *res = load_bytes (bf, bytes, sz, bf->o->loadaddr, bf->sdb);
	bf->o->bin_obj = (void *)res;
	return res != NULL;
}
开发者ID:ampotos,项目名称:radare2,代码行数:10,代码来源:bin_mz.c

示例10: r_bin_zimg_new_buf

struct r_bin_zimg_obj_t* r_bin_zimg_new_buf(RBuffer *buf) {
	struct r_bin_zimg_obj_t *bin = R_NEW0 (struct r_bin_zimg_obj_t);
	if (!bin) {
		goto fail;
	}
	bin->size = r_buf_size (buf);
	bin->b = r_buf_ref (buf);
	if (r_buf_size (bin->b) < sizeof (struct zimg_header_t)) {
		goto fail;
	}
	r_buf_read_at (bin->b, 0, (ut8 *)&bin->header, sizeof (bin->header));
	return bin;

fail:
	if (bin) {
		r_buf_free (bin->b);
		free (bin);
	}
	return NULL;
}
开发者ID:das-labor,项目名称:radare2,代码行数:20,代码来源:zimg.c

示例11: load

static int load(RBinFile *arch) {
	const ut8 *byte = arch ? r_buf_buffer(arch->buf) : NULL;
	ut64 size = arch ? r_buf_size(arch->buf) : 0;

	if (!arch || !arch->o) {
		return false;
	}
	if (!(arch->o->bin_obj = load_bytes(arch, byte, \
			size, arch->o->loadaddr, arch->sdb)))
		return false;
	return true;
}
开发者ID:13572293130,项目名称:radare2,代码行数:12,代码来源:bin_omf.c

示例12: load

static int load(RBinFile *arch) {
	const void *res;
	const ut8 *bytes;
	ut64 sz;

	if (!arch || !arch->o)
		return false;

	bytes = r_buf_buffer (arch->buf);
	sz = r_buf_size (arch->buf);
	res = load_bytes (arch, bytes, sz, arch->o->loadaddr, arch->sdb);
	arch->o->bin_obj = (void *)res;
	return res != NULL;
}
开发者ID:cosarara97,项目名称:radare2,代码行数:14,代码来源:bin_mz.c

示例13: entries

static RList* entries(RBinFile *arch) {
	RList* ret = r_list_new ();;
	RBinAddr *ptr = NULL;
	RRarBinObj *bin_obj = arch && arch->o ? arch->o->bin_obj : NULL;
	const ut8 *buf = bin_obj ? r_buf_buffer (bin_obj->buf) : NULL;
	ut64 sz = arch && bin_obj ? r_buf_size (bin_obj->buf) : 0;

	if (!ret) return NULL;
	ret->free = free;
	if (bin_obj && sz > 0x30 && !memcmp (buf+0x30, RAR_CONST, 16)) {
		if ((ptr = R_NEW (RBinAddr))) {
			ptr->vaddr = ptr->paddr = 0x9a;
			r_list_append (ret, ptr);
		}
	}
	return ret;
}
开发者ID:8500616886,项目名称:radare2,代码行数:17,代码来源:bin_rar.c

示例14: r_buf_buffer

static RList *sections(RBinFile *arch) {
	RList *ret = NULL;
	RBinSection *ptr = NULL;
	RRarBinObj *bin_obj = arch && arch->o? arch->o->bin_obj: NULL;
	const ut8 *buf = bin_obj? r_buf_buffer (bin_obj->buf): NULL;
	ut64 sz = 0;
	if (bin_obj) {
		sz = r_buf_size (bin_obj->buf);
	}

	if (!(ret = r_list_new ())) {
		return NULL;
	}
	ret->free = free;

	// TODO: return NULL here?
	if (!buf || sz < 0x30 || memcmp (buf + 0x30, RAR_CONST, 16)) {
		return ret;
	}

	// add text segment
	if (!(ptr = R_NEW0 (RBinSection))) {
		return ret;
	}
	strncpy (ptr->name, "header", R_BIN_SIZEOF_STRINGS);
	ptr->size = ptr->vsize = 0x9a;
	ptr->paddr = 0;
	ptr->vaddr = ptr->paddr;
	ptr->srwx = R_BIN_SCN_READABLE | R_BIN_SCN_MAP; // r--
	ptr->add = true;
	r_list_append (ret, ptr);

	/* rarvm code */
	if (!(ptr = R_NEW0 (RBinSection))) {
		return ret;
	}
	strncpy (ptr->name, "rarvm", R_BIN_SIZEOF_STRINGS);
	ptr->vsize = ptr->size = sz - 0x9a;
	ptr->vaddr = ptr->paddr = 0x9a;
	ptr->srwx = R_BIN_SCN_READABLE | R_BIN_SCN_EXECUTABLE | R_BIN_SCN_MAP; // r-x
	ptr->add = true;
	r_list_append (ret, ptr);
	return ret;
}
开发者ID:Maijin,项目名称:radare2,代码行数:44,代码来源:bin_rar.c

示例15: load

static bool load(RBinFile *bf) {
	int result = false;
	const ut8 *bytes = bf? r_buf_buffer (bf->buf): NULL;
	ut64 sz = bf? r_buf_size (bf->buf): 0;
	struct r_bin_java_obj_t *bin_obj = NULL;

	if (!bf || !bf->o) {
		return false;
	}

	bin_obj = load_bytes (bf, bytes, sz, bf->o->loadaddr, bf->sdb);

	if (bin_obj) {
		if (!bf->o->kv) {
			bf->o->kv = bin_obj->kv;
		}
		bf->o->bin_obj = bin_obj;
		bin_obj->AllJavaBinObjs = DB;
		// XXX - /\ this is a hack, but (one way but) necessary to get access to
		// the object addrs from anal. If only global variables are used,
		// they get "lost" somehow after they are initialized and go out of
		// scope.
		//
		// There are several points of indirection, but here is the gist:
		// 1) RAnal->(through RBinBind) RBin->RBinJavaObj->DB
		//
		// The purpose is to ensure that information about a give class file
		// can be grabbed at any time from RAnal.  This was tried with global
		// variables, but failed when attempting to access the DB
		// in the class.c scope.  Once DB  was moved here, it is initialized
		// once here and assigned to each of the other RBinJavaObjs.
		//
		// Now, the RAnal component of radare can get to each of the
		// RBinJavaObjs for analysing functions and dependencies using an Sdb.
		add_bin_obj_to_sdb (bin_obj);
		if (bf->file) {
			bin_obj->file = strdup (bf->file);
		}
		result = true;
	}
	return result;
}
开发者ID:PankajKataria,项目名称:radare2,代码行数:42,代码来源:bin_java.c


注:本文中的r_buf_size函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。