mirror of
https://github.com/radareorg/radare2.git
synced 2025-01-07 13:51:16 +00:00
94445e1540
- s/u64/ut64/ - s/u32/ut32/ - s/u16/ut16/ - s/u8/ut8/
54 lines
913 B
C
54 lines
913 B
C
static int bopen(struct r_bin_t *bin)
|
|
{
|
|
}
|
|
|
|
static int bclose(struct r_bin_t *bin)
|
|
{
|
|
free(bin->bin_obj);
|
|
}
|
|
|
|
static ut64 baddr(struct r_bin_t *bin)
|
|
{
|
|
return -0x1000; /* huh */
|
|
}
|
|
|
|
static int check(struct r_bin_t *bin)
|
|
{
|
|
int ret = R_FALSE;
|
|
ut8 buf[4];
|
|
|
|
if ((bin->fd = open(bin->file, 0)) != -1) {
|
|
lseek(bin->fd, 0, SEEK_SET);
|
|
read(bin->fd, buf, 4);
|
|
close(bin->fd);
|
|
if (!memcmp(buf, "\xce\xfa\xed\xfa", 4))
|
|
ret = R_TRUE;
|
|
}
|
|
return ret;
|
|
}
|
|
|
|
struct r_bin_handle_t r_bin_plugin_mach0 = {
|
|
.name = "bin_mach0",
|
|
.desc = "mach0 bin plugin",
|
|
.init = NULL,
|
|
.fini = NULL,
|
|
.open = &bopen,
|
|
.close = &bclose,
|
|
.check = &check,
|
|
.baddr = &baddr,
|
|
.entry = &entry,
|
|
.sections = §ions,
|
|
.symbols = &symbols,
|
|
.imports = &imports,
|
|
.strings = NULL,
|
|
.info = &info,
|
|
.fields = &fields,
|
|
};
|
|
|
|
#ifndef CORELIB
|
|
struct r_lib_struct_t radare_plugin = {
|
|
.type = R_LIB_TYPE_BIN,
|
|
.data = &r_bin_plugin_mach0
|
|
};
|
|
#endif
|