To start adopting a more portable face I have added a layer on top of the io
operations to be able to hook via 'plugins' these calls and enable network,
OS specific, and debugging filedescriptors libraries to be used in windows too
and enable multiple hooks and crossed operations between handlers.

ATM this is an scratchy plugin interface, but it looks like:

 posix.c

plugin_t posix_plugin = {
        .name = "posix",
        .handle_fd = posix_handle_fd,
        .handle_open = posix_handle_open,
        .open = posix_open,
        .read = posix_read,
        .write = posix_write,
        .lseek = posix_lseek,
        .close = posix_close
};

Just implement these methods and register the plugin into the plugin handlers
array in plugin.c:

     plugins[0] = &posix_plugin;

That's all :)

I'm thinking on extending radare to a complete system shell with 'ls' and 'cd'
commands and hook getdents() to be able to list files remotely or so. This
ability will enable radare to handle more powerful file formats like XML
and be able to avoid the use of bash :)  .. twd... just kidding?

  --pancake
_______________________________________________
radare mailing list
[email protected]
https://lists.nopcode.org/mailman/listinfo/radare

Reply via email to