Deprecate RBinPlugin.file_type() field

This commit is contained in:
pancake 2023-09-14 01:21:59 +02:00 committed by pancake
parent d13ed30754
commit f0b8a61f25
7 changed files with 6 additions and 20 deletions

View File

@ -4,7 +4,7 @@ https://github.com/dockcross/dockcross
Here's and example on how changes required for i.e ARMv5 (no hard float) borrowed from `mk/armel.mk`:
```
```bash
ARCH=arm
CROSS_ROOT=/usr/bin
CROSS_TRIPLET=${ARCH}-linux-gnueabi
@ -34,5 +34,5 @@ $ dockcross make
Here is some more context and references:
https://github.com/radareorg/radare2/pull/5060
https://blogs.nopcode.org/brainstorm/2016/07/26/cross-compiling-with-docker
* https://github.com/radareorg/radare2/pull/5060
* https://blogs.nopcode.org/brainstorm/2016/07/26/cross-compiling-with-docker

View File

@ -285,9 +285,9 @@ R_API int r_bin_object_set_items(RBinFile *bf, RBinObject *bo) {
int minlen = (bf->rbin->minstrlen > 0) ? bf->rbin->minstrlen : p->minstrlen;
bf->bo = bo;
if (p->file_type) {
int type = p->file_type (bf);
if (type == R_BIN_TYPE_CORE) {
bo->info = p->info? p->info (bf): NULL;
if (bo->info->type) {
if (strstr (bo->info->type, "CORE")) {
if (p->regstate) {
bo->regstate = p->regstate (bf);
}
@ -296,7 +296,6 @@ R_API int r_bin_object_set_items(RBinFile *bf, RBinObject *bo) {
}
}
}
// XXX: no way to get info from xtr pluginz?
// Note, object size can not be set from here due to potential
// inconsistencies
@ -350,7 +349,6 @@ R_API int r_bin_object_set_items(RBinFile *bf, RBinObject *bo) {
}
}
}
bo->info = p->info? p->info (bf): NULL;
if (p->libs) {
bo->libs = p->libs (bf);
}

View File

@ -119,7 +119,6 @@ RBinPlugin r_bin_plugin_cgc = {
.create = &create,
.patch_relocs = &patch_relocs,
.write = &r_bin_write_elf,
.file_type = get_file_type,
.regstate = regstate,
.maps = maps,
};

View File

@ -152,7 +152,6 @@ RBinPlugin r_bin_plugin_elf = {
.dbginfo = &r_bin_dbginfo_elf,
.create = &create,
.write = &r_bin_write_elf,
.file_type = &get_file_type,
.regstate = &regstate,
.maps = &maps,
};

View File

@ -10,14 +10,6 @@
static RBinInfo* info(RBinFile *bf);
static int get_file_type(RBinFile *bf) {
ELFOBJ *eo = bf->bo->bin_obj;
char *type = Elf_(get_file_type (eo));
int res = type? (r_str_startswith (type, "CORE") ? R_BIN_TYPE_CORE : R_BIN_TYPE_DEFAULT) : -1;
free (type);
return res;
}
static RList *maps(RBinFile *bf) {
r_return_val_if_fail (bf && bf->bo, NULL);
return Elf_(get_maps)(bf->bo->bin_obj);

View File

@ -155,7 +155,6 @@ RBinPlugin r_bin_plugin_elf64 = {
.create = &create,
.write = &r_bin_write_elf64,
.get_vaddr = &get_elf_vaddr64,
.file_type = &get_file_type,
.regstate = &regstate,
.maps = &maps,
};

View File

@ -556,7 +556,6 @@ typedef struct r_bin_plugin_t {
// TODO: R2_600 RBuffer* (*create)(RBin *bin, RBinCreateOptions *opt);
char* (*demangle)(const char *str);
char* (*regstate)(RBinFile *bf);
int (*file_type)(RBinFile *bf);
/* default value if not specified by user */
int minstrlen;
char strfilter;