Mark, there is another thing that you maybe could have a look.
Xaphiosis once mentioned that he intercepted function corresponding to "new Stream.File('path')" (I'm not sure to which binary function it corresponds, most file IO related methods seem to be defined in libtinyhttp.so, for example xs_FileSystem_createDirectory should to correspond to FileSystem.createDirectory from FskCore.xsb) which allowed him to change it's behavior if path starts with a particular prefix (he's used /exec but any would do). What I'm looking for is a generic JS => .so binary code gateway that would allow the following calls:
Code:
loadLib(path) - loads so library, returns libHandle (C calls dlopen)
findFunc(libHandle, funcName) - returns function handle (C calls dlsym)
string call[Str|Bitmap|Chunk]Func(libHandle, funcHandle, arg) (C calls the function loaded via findFunc, passing result of the corresponding type back)
unloadLib(libHandle) - (C calls dlclose)
In this list, returning Javascript String/Bitmap/Chunk object looks to be particularly difficult, but this is not necessary, writing result to a /tmp/<some filename generated using handle id> would also be fine.