mirror of
https://github.com/radareorg/radare2.git
synced 2025-02-26 17:15:38 +00:00
* some more renaming
This commit is contained in:
parent
4ead120e53
commit
8ab4969851
@ -502,7 +502,7 @@ static int rabin_show_srcline(ut64 at) {
|
||||
/* bin callback */
|
||||
static int __lib_bin_cb(struct r_lib_plugin_t *pl, void *user, void *data) {
|
||||
struct r_bin_plugin_t *hand = (struct r_bin_plugin_t *)data;
|
||||
//printf(" * Added (dis)assembly handler\n");
|
||||
//printf(" * Added (dis)assembly plugin\n");
|
||||
r_bin_add (bin, hand);
|
||||
return R_TRUE;
|
||||
}
|
||||
|
@ -12,7 +12,7 @@ R_API int r_bp_plugin_add(struct r_bp_t *bp, struct r_bp_plugin_t *foo)
|
||||
{
|
||||
struct list_head *pos;
|
||||
if (bp == NULL) {
|
||||
eprintf("Cannot add plugin because dbg->bp is null and/or handle is null\n");
|
||||
eprintf("Cannot add plugin because dbg->bp is null and/or plugin is null\n");
|
||||
return R_FALSE;
|
||||
}
|
||||
/* avoid dupped plugins */
|
||||
|
@ -44,7 +44,7 @@ R_API int r_cmd_plugin_check(struct r_cmd_t *cmd, const char *a0) {
|
||||
R_API int r_cmd_plugin_list(struct r_cmd_t *cmd) {
|
||||
int n = 0;
|
||||
struct list_head *pos;
|
||||
cmd->printf ("IO handlers:\n");
|
||||
cmd->printf ("IO plugins:\n");
|
||||
list_for_each_prev(pos, &cmd->plist) {
|
||||
struct r_cmd_list_t *il = list_entry(pos, struct r_cmd_list_t, list);
|
||||
cmd->printf(" - %s\n", il->plugin->name);
|
||||
|
@ -78,7 +78,7 @@ typedef struct r_io_t {
|
||||
//};
|
||||
|
||||
typedef struct r_io_plugin_t {
|
||||
void *handle;
|
||||
void *plugin;
|
||||
char *name;
|
||||
char *desc;
|
||||
void *widget;
|
||||
@ -92,8 +92,8 @@ typedef struct r_io_plugin_t {
|
||||
int (*write)(RIO *io, int fd, const ut8 *buf, int count);
|
||||
int (*close)(RIO *io, int fd);
|
||||
int (*resize)(RIO *io, int fd, ut64 size);
|
||||
int (*handle_open)(RIO *io, const char *);
|
||||
//int (*handle_fd)(RIO *, int);
|
||||
int (*plugin_open)(RIO *io, const char *);
|
||||
//int (*plugin_fd)(RIO *, int);
|
||||
int fds[R_IO_NFDS];
|
||||
} RIOPlugin;
|
||||
|
||||
@ -139,14 +139,14 @@ typedef struct r_io_desc_t {
|
||||
int fd;
|
||||
int flags;
|
||||
char name[4096];
|
||||
struct r_io_plugin_t *handle;
|
||||
struct r_io_plugin_t *plugin;
|
||||
struct list_head list;
|
||||
} RIODesc;
|
||||
|
||||
#ifdef R_API
|
||||
#define r_io_bind_init(x) memset(&x,0,sizeof(x))
|
||||
|
||||
/* io/handle.c */
|
||||
/* io/plugin.c */
|
||||
R_API RIO *r_io_new();
|
||||
R_API RIO *r_io_free(RIO *io);
|
||||
R_API int r_io_plugin_init(RIO *io);
|
||||
@ -237,7 +237,7 @@ R_API int r_io_wundo_set(RIO *io, int n, int set);
|
||||
|
||||
/* io/desc.c */
|
||||
R_API int r_io_desc_init(RIO *io);
|
||||
R_API int r_io_desc_add(RIO *io, int fd, const char *file, int flags, struct r_io_plugin_t *handle);
|
||||
R_API int r_io_desc_add(RIO *io, int fd, const char *file, int flags, struct r_io_plugin_t *plugin);
|
||||
R_API int r_io_desc_del(RIO *io, int fd);
|
||||
R_API struct r_io_desc_t *r_io_desc_get(RIO *io, int fd);
|
||||
R_API int r_io_desc_generate(RIO *io);
|
||||
|
@ -7,14 +7,14 @@ R_API int r_io_desc_init(struct r_io_t *io) {
|
||||
return R_TRUE;
|
||||
}
|
||||
|
||||
R_API int r_io_desc_add(struct r_io_t *io, int fd, const char *file, int flags, struct r_io_plugin_t *handle) {
|
||||
R_API int r_io_desc_add(struct r_io_t *io, int fd, const char *file, int flags, struct r_io_plugin_t *plugin) {
|
||||
RIODesc *desc = R_NEW (RIODesc);
|
||||
if (desc == NULL)
|
||||
return R_FALSE;
|
||||
strncpy (desc->name, file, sizeof (desc->name));
|
||||
desc->flags = flags;
|
||||
desc->fd = fd;
|
||||
desc->handle = handle;
|
||||
desc->plugin = plugin;
|
||||
list_add_tail (&(desc->list), &(io->desc));
|
||||
return R_TRUE;
|
||||
}
|
||||
|
@ -148,7 +148,7 @@ R_API int r_io_read(struct r_io_t *io, ut8 *buf, int len) {
|
||||
if (io->plugin && io->plugin->read) {
|
||||
if (io->plugin->read != NULL)
|
||||
ret = io->plugin->read(io, io->fd, buf, len);
|
||||
else eprintf ("IO handler for fd=%d has no read()\n", io->fd);
|
||||
else eprintf ("IO plugin for fd=%d has no read()\n", io->fd);
|
||||
} else ret = read (io->fd, buf, len);
|
||||
if (ret>0 && ret<len)
|
||||
memset (buf+ret, 0xff, len-ret);
|
||||
|
@ -252,11 +252,11 @@ static int __init(struct r_io_t *io) {
|
||||
}
|
||||
|
||||
struct r_io_plugin_t r_io_plugin_debug = {
|
||||
//void *handle;
|
||||
//void *plugin;
|
||||
.name = "debug",
|
||||
.desc = "Debug a program or pid. dbg:///bin/ls, dbg://1388",
|
||||
.open = __open,
|
||||
.handle_open = __plugin_open,
|
||||
.plugin_open = __plugin_open,
|
||||
.lseek = NULL,
|
||||
.system = NULL,
|
||||
.debug = (void *)1,
|
||||
|
@ -164,14 +164,14 @@ static int ewf__init(struct r_io_t *io) {
|
||||
}
|
||||
|
||||
struct r_io_plugin_t r_io_plugin_ewf = {
|
||||
//void *handle;
|
||||
//void *plugin;
|
||||
.name = "ewf",
|
||||
.desc = "Forensic file formats (Encase, ..) (ewf://file, els://file)",
|
||||
.open = ewf__open,
|
||||
.close = ewf__close,
|
||||
.read = ewf__read,
|
||||
.handle_open = ewf__plugin_open,
|
||||
.handle_fd = ewf__plugin_fd,
|
||||
.plugin_open = ewf__plugin_open,
|
||||
.plugin_fd = ewf__plugin_fd,
|
||||
.lseek = ewf__lseek,
|
||||
.system = NULL, // ewf__system,
|
||||
.init = ewf__init,
|
||||
|
@ -208,13 +208,13 @@ static int __init(struct r_io_t *io) {
|
||||
|
||||
// TODO: rename ptrace to io_mach .. err io.ptrace ??
|
||||
struct r_io_plugin_t r_io_plugin_mach = {
|
||||
//void *handle;
|
||||
//void *plugin;
|
||||
.name = "mach",
|
||||
.desc = "mach debug io",
|
||||
.open = __open,
|
||||
.close = __close,
|
||||
.read = __read,
|
||||
.handle_open = __plugin_open,
|
||||
.plugin_open = __plugin_open,
|
||||
.lseek = __lseek,
|
||||
.system = __system,
|
||||
.init = __init,
|
||||
|
@ -103,13 +103,13 @@ static int __system(struct r_io_t *io, int fd, const char *cmd)
|
||||
}
|
||||
|
||||
struct r_io_plugin_t r_io_plugin_malloc = {
|
||||
//void *handle;
|
||||
//void *plugin;
|
||||
.name = "malloc",
|
||||
.desc = "memory allocation ( malloc://size-in-bytes )",
|
||||
.open = __open,
|
||||
.close = __close,
|
||||
.read = __read,
|
||||
.handle_open = __plugin_open,
|
||||
.plugin_open = __plugin_open,
|
||||
.lseek = __lseek,
|
||||
.system = __system,
|
||||
.init = __init,
|
||||
|
@ -113,13 +113,13 @@ static int __init(struct r_io_t *io) {
|
||||
|
||||
// TODO: rename ptrace to io_ptrace .. err io.ptrace ??
|
||||
struct r_io_plugin_t r_io_plugin_procpid = {
|
||||
//void *handle;
|
||||
//void *plugin;
|
||||
.name = "procpid",
|
||||
.desc = "proc/pid/mem io",
|
||||
.open = __open,
|
||||
.close = __close,
|
||||
.read = __read,
|
||||
.handle_open = __plugin_open,
|
||||
.plugin_open = __plugin_open,
|
||||
.lseek = __lseek,
|
||||
.system = __system,
|
||||
.init = __init,
|
||||
|
@ -151,13 +151,13 @@ static int __init(struct r_io_t *io) {
|
||||
|
||||
// TODO: rename ptrace to io_ptrace .. err io.ptrace ??
|
||||
struct r_io_plugin_t r_io_plugin_ptrace = {
|
||||
//void *handle;
|
||||
//void *plugin;
|
||||
.name = "io_ptrace",
|
||||
.desc = "ptrace io",
|
||||
.open = __open,
|
||||
.close = __close,
|
||||
.read = __read,
|
||||
.handle_open = __plugin_open,
|
||||
.plugin_open = __plugin_open,
|
||||
.lseek = __lseek,
|
||||
.system = __system,
|
||||
.init = __init,
|
||||
|
@ -88,13 +88,13 @@ static int shm__init(struct r_io_t *io)
|
||||
}
|
||||
|
||||
struct r_io_plugin_t r_io_plugin_shm = {
|
||||
//void *handle;
|
||||
//void *plugin;
|
||||
.name = "shm",
|
||||
.desc = "shared memory resources (shm://key)",
|
||||
.open = shm__open,
|
||||
.close = shm__close,
|
||||
.read = shm__read,
|
||||
.handle_open = shm__plugin_open,
|
||||
.plugin_open = shm__plugin_open,
|
||||
.lseek = shm__lseek,
|
||||
.system = NULL, // shm__system,
|
||||
.init = shm__init,
|
||||
|
@ -92,13 +92,13 @@ static int __init(struct r_io_t *io) {
|
||||
|
||||
// TODO: rename w32dbg to io_w32dbg .. err io.w32dbg ??
|
||||
struct r_io_plugin_t r_io_plugin_w32dbg = {
|
||||
//void *handle;
|
||||
//void *plugin;
|
||||
.name = "io_w32dbg",
|
||||
.desc = "w32dbg io",
|
||||
.open = __open,
|
||||
.close = __close,
|
||||
.read = __read,
|
||||
.handle_open = __plugin_open,
|
||||
.plugin_open = __plugin_open,
|
||||
.lseek = __lseek,
|
||||
.system = __system,
|
||||
.init = __init,
|
||||
|
@ -39,9 +39,9 @@ R_API struct r_io_plugin_t *r_io_plugin_resolve(struct r_io_t *io, const char *f
|
||||
struct r_io_list_t *il = list_entry(pos, struct r_io_list_t, list);
|
||||
if (il->plugin == NULL)
|
||||
continue;
|
||||
if (il->plugin->handle_open == NULL)
|
||||
if (il->plugin->plugin_open == NULL)
|
||||
continue;
|
||||
if (il->plugin->handle_open(io, filename))
|
||||
if (il->plugin->plugin_open(io, filename))
|
||||
return il->plugin;
|
||||
}
|
||||
return NULL;
|
||||
@ -100,7 +100,7 @@ R_API int r_io_plugin_close(struct r_io_t *io, int fd, struct r_io_plugin_t *plu
|
||||
R_API int r_io_plugin_list(struct r_io_t *io) {
|
||||
int n = 0;
|
||||
struct list_head *pos;
|
||||
io->printf ("IO handlers:\n");
|
||||
io->printf ("IO plugins:\n");
|
||||
list_for_each_prev(pos, &io->io_list) {
|
||||
struct r_io_list_t *il = list_entry(pos, struct r_io_list_t, list);
|
||||
io->printf(" - %s\n", il->plugin->name);
|
||||
|
Loading…
x
Reference in New Issue
Block a user