本文整理汇总了C++中check_bytes函数的典型用法代码示例。如果您正苦于以下问题:C++ check_bytes函数的具体用法?C++ check_bytes怎么用?C++ check_bytes使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了check_bytes函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: check
static int check(RBin *bin) {
int size = 0, ret = false;
ut8 *filebuf = (ut8*)r_file_slurp_range (bin->file, 0, 4, &size);
ret = check_bytes (filebuf, size);
free (filebuf);
return ret;
}
开发者ID:EliaGeretto,项目名称:radare2,代码行数:7,代码来源:bin_xtr_dyldcache.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 check_bytes (bytes, sz);
}
开发者ID:CodingFree,项目名称:radare2,代码行数:7,代码来源:bin_bf.c
示例3: main
int main(void)
{
void *addr;
int fd, ret;
fd = open(FILE_NAME, O_CREAT | O_RDWR, 0755);
if (fd < 0) {
perror("Open failed");
exit(1);
}
addr = mmap(ADDR, LENGTH, PROTECTION, FLAGS, fd, 0);
if (addr == MAP_FAILED) {
perror("mmap");
unlink(FILE_NAME);
exit(1);
}
printf("Returned address is %p\n", addr);
check_bytes(addr);
write_bytes(addr);
ret = read_bytes(addr);
munmap(addr, LENGTH);
close(fd);
unlink(FILE_NAME);
return ret;
}
开发者ID:020gzh,项目名称:linux,代码行数:29,代码来源:hugepage-mmap.c
示例4: load_bytes
static bool load_bytes(RBinFile *bf, void **bin_obj, const ut8 *buf, ut64 sz, ut64 loadaddr, Sdb *sdb) {
if (check_bytes (buf, sz)) {
*bin_obj = memcpy (&n64_header, buf, sizeof (N64Header));
return true;
}
return false;
}
开发者ID:radare,项目名称:radare2,代码行数:7,代码来源:bin_z64.c
示例5: check
static int check(RBinFile *arch) {
if (arch && arch->buf) {
const ut8 *bytes = r_buf_buffer (arch->buf);
ut64 sz = r_buf_size (arch->buf);
return check_bytes (bytes, sz);
}
return false;
}
开发者ID:Darredevil,项目名称:radare2,代码行数:8,代码来源:bin_mbn.c
示例6: 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
示例7: load
static bool load(RBinFile *bf) {
if (!bf || !bf->o) {
return false;
}
ut64 sz;
const ut8 *bytes = r_buf_buffer (bf->buf, &sz);
load_bytes (bf, &bf->o->bin_obj, bytes, sz, bf->o->loadaddr, bf->sdb);
return check_bytes (bytes, sz);
}
开发者ID:radare,项目名称:radare2,代码行数:9,代码来源:bin_z64.c
示例8: 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
示例9: 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
示例10: r_bin_wasm_init
static void *load_bytes(RBinFile *bf, const ut8 *buf, ut64 sz, ut64 loadaddr, Sdb *sdb){
if (!buf || !sz || sz == UT64_MAX) {
return NULL;
}
if (!check_bytes (buf, sz)) {
return NULL;
}
return r_bin_wasm_init (bf);
}
开发者ID:ampotos,项目名称:radare2,代码行数:9,代码来源:bin_wasm.c
示例11: read_bytes
static void read_bytes(char *addr)
{
unsigned long i;
check_bytes(addr);
for (i = 0; i < LENGTH; i++)
if (*(addr + i) != (char)i) {
printf("Mismatch at %lu\n", i);
break;
}
}
开发者ID:CSCLOG,项目名称:beaglebone,代码行数:11,代码来源:hugepage-mmap.c
示例12: read_bytes
static int read_bytes(char *addr)
{
unsigned long i;
check_bytes(addr);
for (i = 0; i < LENGTH; i++)
if (*(addr + i) != (char)i) {
printf("Mismatch at %lu\n", i);
return 1;
}
return 0;
}
开发者ID:020gzh,项目名称:linux,代码行数:12,代码来源:hugepage-mmap.c
示例13: main
int main(void)
{
void *addr;
int ret;
addr = mmap(ADDR, LENGTH, PROTECTION, FLAGS, 0, 0);
if (addr == MAP_FAILED) {
perror("mmap");
exit(1);
}
printf("Returned address is %p\n", addr);
check_bytes(addr);
write_bytes(addr);
ret = read_bytes(addr);
munmap(addr, LENGTH);
return ret;
}
开发者ID:383530895,项目名称:linux,代码行数:20,代码来源:map_hugetlb.c
示例14: load_bytes
static void * load_bytes(RBinFile *arch, const ut8 *buf, ut64 sz, ut64 loadaddr, Sdb *sdb){
check_bytes (buf, sz);
// XXX: this may be wrong if check_bytes is true
return R_NOTNULL;
}
开发者ID:13572293130,项目名称:radare2,代码行数:5,代码来源:bin_pebble.c
示例15: load_bytes
static void * load_bytes(RBinFile *arch, const ut8 *buf, ut64 sz, ut64 loadaddr, Sdb *sdb){
return (void*)(size_t)check_bytes (buf, sz);
}
开发者ID:AitorATuin,项目名称:radare2,代码行数:3,代码来源:bin_mbn.c
示例16: load
static bool load(RBinFile *arch) {
ut64 sz;
const ut8 *bytes = arch ? r_buf_buffer (arch->buf, &sz) : NULL;
return check_bytes (bytes, sz);
}
开发者ID:radare,项目名称:radare2-extras,代码行数:5,代码来源:bin_md380fw.c
示例17: load_bytes
static bool load_bytes(RBinFile *bf, void **bin_obj, const ut8 *buf, ut64 sz, ut64 loadaddr, Sdb *sdb){
return (bool)(void*)(size_t)check_bytes (buf, sz);
}
开发者ID:radare,项目名称:radare2-extras,代码行数:3,代码来源:bin_md380fw.c
示例18: memcpy
static void *load_bytes(RBinFile *bf, const ut8 *buf, ut64 sz, ut64 loadaddr, Sdb *sdb) {
if (check_bytes (r_buf_buffer (bf->buf), sz)) {
return memcpy (&n64_header, buf, sizeof (N64Header));
}
return NULL;
}
开发者ID:montekki,项目名称:radare2,代码行数:6,代码来源:bin_z64.c
示例19: load_bytes
static void * load_bytes(RBinFile *arch, const ut8 *buf, ut64 sz, ut64 loadaddr, Sdb *sdb){
if (check_bytes (buf, sz))
return R_NOTNULL;
return NULL;
}
开发者ID:AitorATuin,项目名称:radare2,代码行数:5,代码来源:bin_fs.c
示例20: load_bytes
static void * load_bytes(const ut8 *buf, ut64 sz, ut64 loadaddr, Sdb *sdb){
return check_bytes (buf, sz);
}
开发者ID:kuduka,项目名称:radare2,代码行数:3,代码来源:bin_bios.c
注:本文中的check_bytes函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论