本文整理汇总了C++中r_list_append函数的典型用法代码示例。如果您正苦于以下问题:C++ r_list_append函数的具体用法?C++ r_list_append怎么用?C++ r_list_append使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了r_list_append函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: r_anal_state_insert_bb
R_API void r_anal_state_insert_bb(RAnalState* state, RAnalBlock *bb) {
if (!state || !bb) {
return;
}
if (!r_anal_state_search_bb (state, bb->addr) && state->current_fcn) {
r_list_append (state->current_fcn->bbs, bb);
state->bytes_consumed += state->current_bb->op_sz;
const char *key = sdb_fmt (0, "0x%08"PFMT64x, bb->addr);
if (!ht_insert (state->ht, key, bb)) {
eprintf ("Inserted bb 0x%04"PFMT64x" failure\n", bb->addr);
}
}
}
开发者ID:Maijin,项目名称:radare2,代码行数:13,代码来源:state.c
示例2: entries
static RList* entries(RBinFile *arch) {
RList *ret;
RBinAddr *ptr = NULL;
if (!(ret = r_list_new ()))
return NULL;
ret->free = free;
if (!(ptr = R_NEW0 (RBinAddr)))
return ret;
ptr->paddr = ptr->vaddr = 0;
r_list_append (ret, ptr);
return ret;
}
开发者ID:juhakivekas,项目名称:radare2,代码行数:13,代码来源:bin_art.c
示例3: xrefs_list_cb_any
static int xrefs_list_cb_any(RAnal *anal, const char *k, const char *v) {
//ut64 dst, src = r_num_get (NULL, v);
if (!strncmp (_kpfx, k, strlen (_kpfx))) {
RAnalRef *ref = r_anal_ref_new ();
if (ref) {
ref->addr = r_num_get (NULL, k + strlen (_kpfx) + 1);
ref->at = r_num_get (NULL, v); // XXX
ref->type = _type;
r_list_append (_list, ref);
}
}
return true;
}
开发者ID:XVilka,项目名称:radare2,代码行数:13,代码来源:xrefs.c
示例4: callback_list
static int callback_list(void *u, const char *k, const char *v) {
RList *list = (RList*)u;
if (!strchr (k, '.')) {
RSyscallItem *si = r_syscall_item_new_from_string (k, v);
if (!si) {
return 1;
}
if (!strchr (si->name, '.')) {
r_list_append (list, si);
}
}
return 1; // continue loop
}
开发者ID:gareth8118,项目名称:radare2,代码行数:13,代码来源:syscall.c
示例5: r_list_newf
static RList *entries(RBinFile *bf) {
RList /*<RBinAddr>*/ *ret = r_list_newf (free);
if (!ret) {
return NULL;
}
RBinAddr *ptr = R_NEW0 (RBinAddr);
if (ptr) {
ptr->paddr = N64_ROM_START;
ptr->vaddr = baddr (bf);
r_list_append (ret, ptr);
}
return ret;
}
开发者ID:montekki,项目名称:radare2,代码行数:13,代码来源:bin_z64.c
示例6: entries
static RList* entries(RBinArch *arch) {
RList* ret = r_list_new ();;
RBinAddr *ptr = NULL;
if (!ret) return NULL;
ret->free = free;
if (!memcmp (arch->buf+0x30, "\x00\x00\x00\x00\x20\x73\x74\x64\x6f\x75\x74\x20\x21\x55\x0c\xcd", 16)) {
if ((ptr = R_NEW (RBinAddr))) {
ptr->rva = ptr->offset = 0x9a;
r_list_append (ret, ptr);
}
}
return ret;
}
开发者ID:BatchDrake,项目名称:radare2,代码行数:13,代码来源:bin_rar.c
示例7: sections
static RList* sections(RBinFile *arch){
ut8 bank;
int i;
RList *ret = r_list_new();
r_buf_read_at (arch->buf, 0x148, &bank, 1);
bank=gb_get_rombanks(bank);
RBinSection *rombank[bank];
if (!ret ) return NULL;
if (!arch || !arch->buf) {
free (ret);
return NULL;
}
ret->free = free;
rombank[0] = R_NEW0 (RBinSection);
strncpy (rombank[0]->name, "rombank00", R_BIN_SIZEOF_STRINGS);
rombank[0]->offset = 0;
rombank[0]->size = 0x4000;
rombank[0]->vsize = 0x4000;
rombank[0]->rva = 0;
rombank[0]->srwx = r_str_rwx ("rx");
r_list_append (ret, rombank[0]);
for (i=1;i<bank;i++) {
rombank[i] = R_NEW0 (RBinSection);
sprintf (rombank[i]->name,"rombank%02x",i);
rombank[i]->offset = i*0x4000;
rombank[i]->rva = i*0x10000-0xc000; //spaaaaaaaaaaaaaaaace!!!
rombank[i]->size = rombank[i]->vsize = 0x4000;
rombank[i]->srwx=r_str_rwx ("rx");
r_list_append (ret,rombank[i]);
}
return ret;
}
开发者ID:17twenty,项目名称:radare2,代码行数:39,代码来源:bin_ningb.c
示例8: sections
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:13572293130,项目名称:radare2,代码行数:39,代码来源:bin_rar.c
示例9: R_NEW0
static RList *sections(RBinFile *bf) {
RList *ret = NULL;
RBinSection *sections[4] = {
NULL, NULL, NULL, NULL
};
int i, corrupt = false;
if (!(ret = r_list_new ())) {
return NULL;
}
/* FIRM has always 4 sections, normally the 4th section is not used */
for (i = 0; i < 4; i++) {
/* Check if section is used */
if (loaded_header.sections[i].size) {
sections[i] = R_NEW0 (RBinSection);
/* Firmware Type ('0'=ARM9/'1'=ARM11) */
if (loaded_header.sections[i].type == 0x0) {
strncpy (sections[i]->name, "arm9", 4);
} else if (loaded_header.sections[i].type == 0x1) {
strncpy (sections[i]->name, "arm11", 5);
} else {
corrupt = true;
break;
}
sections[i]->size = loaded_header.sections[i].size;
sections[i]->vsize = loaded_header.sections[i].size;
sections[i]->paddr = loaded_header.sections[i].offset;
sections[i]->vaddr = loaded_header.sections[i].address;
sections[i]->srwx = r_str_rwx ("mrwx");
sections[i]->add = true;
}
}
/* Append sections or free them if file is corrupt to avoid memory leaks */
for (i = 0; i < 4; i++) {
if (sections[i]) {
if (corrupt) {
free (sections[i]);
} else {
r_list_append (ret, sections[i]);
}
}
}
if (corrupt) {
r_list_free (ret);
return NULL;
}
return ret;
}
开发者ID:PankajKataria,项目名称:radare2,代码行数:51,代码来源:bin_nin3ds.c
示例10: r_list_destroy
R_API RList *r_core_asm_bwdisassemble (RCore *core, ut64 addr, int n, int len) {
RCoreAsmHit *hit;
RAsmOp op;
RList *hits = NULL;
ut8 *buf;
ut64 at;
int instrlen, ni, idx;
if (!(hits = r_core_asm_hit_list_new ()))
return NULL;
buf = (ut8 *)malloc (len);
if (!buf) {
r_list_destroy (hits);
return NULL;
}
if (r_io_read_at (core->io, addr-len, buf, len) != len) {
r_list_destroy (hits);
free (buf);
return NULL;
}
for (idx = 1; idx < len; idx++) {
if (r_cons_singleton ()->breaked)
break;
at = addr - idx; ni = 1;
while (at < addr) {
r_asm_set_pc (core->assembler, at);
//XXX HACK We need another way to detect invalid disasm!!
if (!(instrlen = r_asm_disassemble (core->assembler, &op, buf+(len-(addr-at)), addr-at)) || strstr (op.buf_asm, "invalid")) {
break;
} else {
at += instrlen;
if (at == addr) {
if (ni == n) {
if (!(hit = r_core_asm_hit_new ())) {
r_list_destroy (hits);
free (buf);
return NULL;
}
hit->addr = addr-idx;
hit->len = idx;
hit->code = NULL;
r_list_append (hits, hit);
}
} else ni++;
}
}
}
r_asm_set_pc (core->assembler, addr);
free (buf);
return hits;
}
开发者ID:moon2l,项目名称:radare2,代码行数:51,代码来源:asm.c
示例11: sections
static RList* sections(RBinFile *arch) {
RList *ret = NULL;
if (!(ret = r_list_new ()))
return NULL;
RBinSection *ptr;
if (!(ptr = R_NEW0 (RBinSection)))
return ret;
strcpy (ptr->name, "vtable");
ptr->paddr = ptr->vaddr = 0;
ptr->size = ptr->vsize = 0x100;
ptr->srwx = R_BIN_SCN_MAP;
ptr->add = true;
r_list_append (ret, ptr);
if (!(ptr = R_NEW0 (RBinSection)))
return ret;
strcpy (ptr->name, "header");
ptr->paddr = ptr->vaddr = 0x100;
ptr->size = ptr->vsize = sizeof (SMD_Header);
ptr->srwx = R_BIN_SCN_MAP;
ptr->add = true;
r_list_append (ret, ptr);
if (!(ptr = R_NEW0 (RBinSection)))
return ret;
strcpy (ptr->name, "text");
ptr->paddr = ptr->vaddr = 0x100 + sizeof (SMD_Header);
{
SMD_Header * hdr = (SMD_Header*)(arch->buf->buf + 0x100);
ut64 baddr = hdr->RamStart;
ptr->vaddr += baddr;
}
ptr->size = ptr->vsize = arch->buf->length - ptr->paddr;
ptr->srwx = R_BIN_SCN_MAP;
ptr->add = true;
r_list_append (ret, ptr);
return ret;
}
开发者ID:Hyask,项目名称:radare2,代码行数:38,代码来源:bin_smd.c
示例12: symbols
static RList* symbols(RBinFile *arch) {
RList *ret = NULL;
RBinSymbol *ptr[3];
if (!(ret = r_list_new()))
return NULL;
ret->free = free;
if (!(ptr[0] = R_NEW0 (RBinSymbol)))
return ret;
if (!ptr[0]->name) {
ptr[0]->name = calloc(1, R_BIN_SIZEOF_STRINGS);
}
strncpy (ptr[0]->name, "NMI_VECTOR_START_ADDRESS", R_BIN_SIZEOF_STRINGS);
ptr[0]->vaddr = NMI_VECTOR_START_ADDRESS;
ptr[0]->size = 2;
ptr[0]->ordinal = 0;
r_list_append (ret, ptr[0]);
if (!(ptr[1] = R_NEW0 (RBinSymbol)))
return ret;
if (!ptr[1]->name) {
ptr[1]->name = calloc(1, R_BIN_SIZEOF_STRINGS);
}
strncpy (ptr[1]->name, "RESET_VECTOR_START_ADDRESS", R_BIN_SIZEOF_STRINGS);
ptr[1]->vaddr = RESET_VECTOR_START_ADDRESS;
ptr[1]->size = 2;
ptr[1]->ordinal = 1;
r_list_append (ret, ptr[1]);
if (!(ptr[2] = R_NEW0 (RBinSymbol)))
return ret;
if (!ptr[2]->name) {
ptr[2]->name = calloc(1, R_BIN_SIZEOF_STRINGS);
}
strncpy (ptr[2]->name, "IRQ_VECTOR_START_ADDRESS", R_BIN_SIZEOF_STRINGS);
ptr[2]->vaddr = IRQ_VECTOR_START_ADDRESS;
ptr[2]->size = 2;
ptr[2]->ordinal = 2;
r_list_append (ret, ptr[2]);
return ret;
}
开发者ID:johnjohnsp1,项目名称:radare2,代码行数:38,代码来源:bin_nes.c
示例13: entries
static RList* entries(RBinArch *arch) {
RList *ret;
RBinAddr *ptr = NULL;
if (!(ret = r_list_new ()))
return NULL;
ret->free = free;
if (!(ptr = R_NEW (RBinAddr)))
return ret;
memset (ptr, '\0', sizeof (RBinAddr));
ptr->offset = ptr->rva = 0xffff0;
r_list_append (ret, ptr);
return ret;
}
开发者ID:eddyb,项目名称:radare2,代码行数:14,代码来源:bin_bios.c
示例14: add_hit_to_hits
static void add_hit_to_hits(RList* hits, ut64 addr, int len, ut8 is_valid) {
RCoreAsmHit *hit = r_core_asm_hit_new();
if (hit) {
IFDBG eprintf("*** Inserting instruction (valid?: %d): instr_addr: 0x%"PFMT64x" instr_len: %d\n", is_valid, addr, len);
hit->addr = addr;
hit->len = len;
hit->valid = is_valid;
hit->code = NULL;
if (!r_list_append (hits, hit)){
free (hit);
IFDBG eprintf ("hit couldn't be added to the list in %s at %d\n", __FILE__, __LINE__);
}
}
}
开发者ID:AmesianX,项目名称:radare2,代码行数:14,代码来源:asm.c
示例15: entries
static RList* entries(RBinFile *bf) {
RList *ret;
RBinAddr *ptr = NULL;
if (!(ret = r_list_new ())) {
return NULL;
}
if (!(ptr = R_NEW0 (RBinAddr))) {
return ret;
}
ptr->paddr = RAM_START_ADDRESS;
ptr->vaddr = 0;
r_list_append (ret, ptr);
return ret;
}
开发者ID:leberus,项目名称:radare2,代码行数:14,代码来源:bin_spc700.c
示例16: baddr
static RList *entries(RBinFile *bf) {
RList *ret;
RBinAddr *ptr = NULL;
if (!(ret = r_list_new ())) {
return NULL;
}
ret->free = free;
if ((ptr = R_NEW0 (RBinAddr))) {
ptr->paddr = 0x80;
ptr->vaddr = ptr->paddr + baddr (bf);
r_list_append (ret, ptr);
}
return ret;
}
开发者ID:PankajKataria,项目名称:radare2,代码行数:14,代码来源:bin_nro.c
示例17: r_list_new
static RList *sections(RBinFile *arch) {
RList *shared = r_list_new ();
if (!shared) {
return NULL;
}
RList *cobjs = r_list_new ();
if (!cobjs) {
return NULL;
}
interned_table = r_list_new ();
if (!interned_table) {
return NULL;
}
r_list_append (shared, cobjs);
r_list_append (shared, interned_table);
arch->o->bin_obj = shared;
RList *sections = r_list_new ();
if (!sections) {
return NULL;
}
pyc_get_sections (sections, cobjs, arch->buf, version.magic);
return sections;
}
开发者ID:radare,项目名称:radare2-extras,代码行数:23,代码来源:bin_pyc.c
示例18: entries
static RList* entries(RBinFile *arch) {
RList* ret;
RBinAddr *ptr = NULL;
if (!(ret = r_list_new ()))
return NULL;
ret->free = free;
if ((ptr = R_NEW0 (RBinAddr))) {
ptr->paddr = 40 + sb.code_pa;
ptr->vaddr = 40 + sb.code_pa + sb.vaddr;
r_list_append (ret, ptr);
}
return ret;
}
开发者ID:AitorATuin,项目名称:radare2,代码行数:14,代码来源:bin_mbn.c
示例19: lines
static RList* lines(RBinArch *arch) {
int i;
char *file = strdup (arch->file);
RList *list = r_list_new ();
RBinJavaObj *b = arch->bin_obj;
file = r_str_replace (file, ".class", ".java", 0);
for (i=0; i<b->lines.count; i++) {
RBinDwarfRow *row = R_NEW (RBinDwarfRow);
r_bin_dwarf_line_new (row, b->lines.addr[i], file, b->lines.line[i]);
r_list_append (list, row);
}
free (file);
return list;
}
开发者ID:0xroot,项目名称:radare2,代码行数:14,代码来源:bin_java.c
示例20: entries
static RList* entries(RBinFile *arch) {
RList* ret;
RBinAddr *ptr = NULL;
if (!(ret = r_list_new ()))
return NULL;
ret->free = free;
if ((ptr = R_NEW (RBinAddr))) {
ptr->paddr = 8*4;
ptr->vaddr = 8*4;// + baddr (arch);
r_list_append (ret, ptr);
}
return ret;
}
开发者ID:AnwarMohamed,项目名称:radare2,代码行数:14,代码来源:bin_p9.c
注:本文中的r_list_append函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论