radare/radare2 — pull request #848 by deeso (2014-04-29 21:21:37+00:00)
Title: Overhauled how files are loaded. 

Now *all* files use an IO plugin the default one is mmap'ed. This is a major overhaul of all the IO layer that forces all local file loading done by RBin and RCore to use IO Plugins, which is why it has been submitted as a separate pull request. Mac OSX and Linux have both built and passed most tests successfully (io ff and enum 32 tests failed on Mac and io ff failed on Linux).

The purpose for this overhaul is to ensure that testing can be conducted and we can ensure consistent results whether the file is loaded locally or remotely. The *default* file plugin is a clone of the io_mmap plugin. Both have been fixed and should work for loading files on the local filesystem.

In order to facilitate this change, a hook was added to the IO such that RBin can grab and RIO Component and perform file opens and reads. This is not ideal because it could lead to race conditions in the future, since the RIO component becomes an unprotected resource (e.g. others may be reading and writing at the same time). This issue can be addressed in the future.