本文整理汇总了C++中r_buf_size函数的典型用法代码示例。如果您正苦于以下问题:C++ r_buf_size函数的具体用法?C++ r_buf_size怎么用?C++ r_buf_size使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了r_buf_size函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: R_NEW0
static RList *sections(RBinFile *arch) {
RList *ret = NULL;
RBinSection *s = R_NEW0 (RBinSection);
ut64 sz = r_buf_size (arch->buf);
if (!(ret = r_list_new ())) {
free (s);
return NULL;
}
strcpy (s->name, "ROM");
s->paddr = 0;
s->vaddr = 0x8000000;
s->size = sz;
s->vsize = 0x2000000;
s->srwx = R_BIN_SCN_READABLE | R_BIN_SCN_EXECUTABLE | R_BIN_SCN_MAP;
s->add = true;
r_list_append (ret, s);
return ret;
}
开发者ID:P4N74,项目名称:radare2,代码行数:20,代码来源:bin_ningba.c
示例17: r_list_new
static RList *sections(RBinFile *bf) {
RList /*<RBinSection>*/ *ret = r_list_new ();
if (!ret) {
return NULL;
}
RBinSection *text = R_NEW0 (RBinSection);
if (!text) {
r_list_free (ret);
return NULL;
}
text->name = strdup ("text");
text->size = r_buf_size (bf->buf) - N64_ROM_START;
text->vsize = text->size;
text->paddr = N64_ROM_START;
text->vaddr = baddr (bf);
text->perm = R_PERM_RX;
text->add = true;
r_list_append (ret, text);
return ret;
}
开发者ID:radare,项目名称:radare2,代码行数:20,代码来源:bin_z64.c
示例18: art_header_load
static int art_header_load(ARTHeader *art, RBuffer *buf, Sdb *db) {
/* TODO: handle read errors here */
if (r_buf_size (buf) < sizeof (ARTHeader)) {
return false;
}
(void) r_buf_fread_at (buf, 0, (ut8 *) art, "IIiiiiiiiiiiii", 1);
sdb_set (db, "img.base", sdb_fmt (0, "0x%x", art->image_base), 0);
sdb_set (db, "img.size", sdb_fmt (0, "0x%x", art->image_size), 0);
sdb_set (db, "art.checksum", sdb_fmt (0, "0x%x", art->checksum), 0);
sdb_set (db, "art.version", sdb_fmt (0, "%c%c%c",
art->version[0], art->version[1], art->version[2]), 0);
sdb_set (db, "oat.begin", sdb_fmt (0, "0x%x", art->oat_file_begin), 0);
sdb_set (db, "oat.end", sdb_fmt (0, "0x%x", art->oat_file_end), 0);
sdb_set (db, "oat_data.begin", sdb_fmt (0, "0x%x", art->oat_data_begin), 0);
sdb_set (db, "oat_data.end", sdb_fmt (0, "0x%x", art->oat_data_end), 0);
sdb_set (db, "patch_delta", sdb_fmt (0, "0x%x", art->patch_delta), 0);
sdb_set (db, "image_roots", sdb_fmt (0, "0x%x", art->image_roots), 0);
sdb_set (db, "compile_pic", sdb_fmt (0, "0x%x", art->compile_pic), 0);
return true;
}
开发者ID:Xxmmy,项目名称:radare2,代码行数:20,代码来源:bin_art.c
示例19: lmf_header_load
static int lmf_header_load(lmf_header *lmfh, RBuffer *buf, Sdb *db) {
if (r_buf_size (buf) < sizeof (lmf_header)) {
return false;
}
if (r_buf_fread_at (buf, QNX_HEADER_ADDR, (ut8 *) lmfh, "iiiiiiiicccciiiicc", 1) < QNX_HDR_SIZE) {
return false;
}
sdb_set (db, "qnx.version", sdb_fmt ("0x%xH", lmfh->version), 0);
sdb_set (db, "qnx.cflags", sdb_fmt ("0x%xH", lmfh->cflags), 0);
sdb_set (db, "qnx.cpu", sdb_fmt ("0x%xH", lmfh->cpu), 0);
sdb_set (db, "qnx.fpu", sdb_fmt ("0x%xH", lmfh->fpu), 0);
sdb_set (db, "qnx.code_index", sdb_fmt ("0x%x", lmfh->code_index), 0);
sdb_set (db, "qnx.stack_index", sdb_fmt ("0x%x", lmfh->stack_index), 0);
sdb_set (db, "qnx.heap_index", sdb_fmt ("0x%x", lmfh->heap_index), 0);
sdb_set (db, "qnx.argv_index", sdb_fmt ("0x%x", lmfh->argv_index), 0);
sdb_set (db, "qnx.code_offset", sdb_fmt ("0x%x", lmfh->code_offset), 0);
sdb_set (db, "qnx.stack_nbytes", sdb_fmt ("0x%x", lmfh->stack_nbytes), 0);
sdb_set (db, "qnx.heap_nbytes", sdb_fmt ("0x%x", lmfh->heap_nbytes), 0);
sdb_set (db, "qnx.image_base", sdb_fmt ("0x%x", lmfh->image_base), 0);
return true;
}
开发者ID:das-labor,项目名称:radare2,代码行数:21,代码来源:bin_qnx.c
示例20: symbols
static RList* symbols(RBinFile *bf) {
RList *ret = NULL;
const ut8 *b = bf ? r_buf_buffer (bf->buf) : NULL;
ut64 sz = bf ? r_buf_size (bf->buf): 0;
if (!(ret = r_list_newf (free))) {
return NULL;
}
if (false) { // TODO bf->cpu && !strcmp (bf->cpu, "atmega8")) {
/* ... */
} else {
/* atmega8 */
addptr (ret, "int0", 2, b, sz);
addptr (ret, "int1", 4, b, sz);
addptr (ret, "timer2cmp", 6, b, sz);
addptr (ret, "timer2ovf", 8, b, sz);
addptr (ret, "timer1capt", 10, b, sz);
addptr (ret, "timer1cmpa", 12, b, sz);
/* ... */
}
return ret;
}
开发者ID:montekki,项目名称:radare2,代码行数:22,代码来源:bin_avr.c
注:本文中的r_buf_size函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论